Jump to content

Creating a magazine rack help


dunkemdeep

Recommended Posts

Hello All

What Started out as a simple room mod to learn how to use geck has led me to I thinks version 15z of my learning mod. I'm currently stuck with two things if anyone could point me in the right direction.

Firstly I'm trying to make a magazine rack, The script I'm using is from another mod who has given permission to use, however after some time studying his mod and others with magazine racks I still have no idea how to build it. I wanted to use some wooden static shelves but they have no option to apply the script. I have also spent time trying to find a tutorial but without any luck.

My second problem is similar to the first in that I want to try and build a display which shows items, similar to that which can be found in the underwater home mod that shows food stock and medical stocks.

Could anyone help please.

 

Link to comment
Share on other sites

You need to create a new activator using the mesh you want for your display (in this case the static wooden shelves). If you're unsure about how to do that, I refer you to my earlier post in this other thread: https://forums.nexusmods.com/index.php?/topic/7913813-scripting-issues/&do=findComment&comment=72689108

 

Once you've created your new activator, apply your script to that activator. Then, you'll have to add the rack to the world, and then place the items you want to display into the world with the "Persistent Reference" and "Initially Disabled" flags checked. Give each display item a unique Editor ID (i.e. Magazine001REF, Magazine002REF, etc.), and then in your script, use the Enable command to make them display when the player activates the magazine rack.

Link to comment
Share on other sites

I'm so sorry in a rush to test it and get out in the sun I never had a magazine in my inventory to properly test the display case, Being a plonker I thought it was working after just seeing the display case name show up after hovering the mouse over it how wrong was I :sad:

Since then I have tried a lot of things to get this to work but after two days my head is battered and I'm still no closer to getting it working.

Are long posts allowed so that I can say all that I 've done so far?

Edited by dunkemdeep
Link to comment
Share on other sites

There is not a limit on the length of posts. (Well, there is probably a practical limit, but I haven't hit it yet and I've posted a number of lengthy ones.)

 

It is a courtesy to your audience to post "code" inside of the "code tag" (so it preserves indentation) and then lengthy details like "code" inside of the "spoiler tag" (which hides it behind a "show" button) so only those interested in the gory details have to wade through it. See "How to markup images (etc) in forum posts and comments" article for how to use "tags".

 

-Dubious-

Link to comment
Share on other sites

Thanks for that Dubiousintent :)

 

Here is what I have done so far:

First attempt.

Using two resized static generic bookshelves stacked ontop of each other I created a static collection then used them to create an activator and added the script (Script is from the NV Novac Apartment mod by VIPerMX).

Then I placed the magazines on the sheleves giving them ref id mag01 upto mag14 and book01 to book 14, I made sure all had the Persistence and Initally Disabled flags ticked, saved then went into game seen the activator name but clicked on it and nothing would happen. It gave the E activate message but nothing else.

Second Attempt

same as above but just used a single static shelf, same outcome.

Third attempt

Turned the static shelf into a container, applied the script and put the magazines in place, I could put the mags in but nothing would show on display.

Fourth attempt

Used a static generic bookshelf without any activator or script applied, instead I encased the bookshelf with a locker which I applied a null texture too. I placed the magazines on the shelves and applied the script to the locker. Still could only place magazines in and nothing would display.

I have no idea on what to try next :(

here is the code I'm using

scn DunksScriptBookShelves


ref self

BEGIN onClose

	set self to this
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVBarter >= 1
		mag01.enable
	Else
		mag01.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVCritical >= 1
		mag02.enable
	Else
		mag02.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVEnergyWeapons >= 1
		mag03.enable
	Else
		mag03.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVExplosives >= 1
		mag04.enable
	Else
		mag04.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVGuns >= 1
		mag05.enable
	Else
		mag05.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVLockpick >= 1
		mag06.enable
	Else
		mag06.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVMedicine >= 1
		mag07.enable
	Else
		mag07.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVMeleeWeapons >= 1
		mag08.enable
	Else
		mag08.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVRepair >= 1
		mag09.enable
	Else
		mag09.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVScience >= 1
		mag10.enable
	Else
		mag10.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVSneak >= 1
		mag11.enable
	Else
		mag11.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVSpeech >= 1
		mag12.enable
	Else
		mag12.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVSurvival >= 1
		mag13.enable
	Else
		mag13.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount MagazineNVUnarmed >= 1
		mag14.enable
	Else
		mag14.disable
	EndIf

-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillBarter >= 1
		book01.enable
	Else
		book01.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillBigGuns >= 1
		book02.enable
	Else
		book02.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillEnergyWeapons >= 1
		book03.enable
	Else
		book03.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillExplosives >= 1
		book04.enable
	Else
		book04.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillGuns >= 1
		book05.enable
	Else
		book05.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillLockpicking >= 1
		book06.enable
	Else
		book06.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillMedicine >= 1
		book07.enable
	Else
		book07.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillMelee >= 1
		book08.enable
	Else
		book08.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillRepair >= 1
		book09.enable
	Else
		book09.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillScience >= 1
		book10.enable
	Else
		book10.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillSneak >= 1
		book11.enable
	Else
		book11.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillSpeech >= 1
		book12.enable
	Else
		book12.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillSurvival >= 1
		book13.enable
	Else
		book13.disable
	EndIf
-------------------------------------------------------------------------------------------
	If self.getitemcount BookSkillUnarmed >= 1
		book14.enable
	Else
		book14.disable
	EndIf

END
Link to comment
Share on other sites

The script for an Activator is an "Object Script". "This" is another name for "GetSelf". From the GECKWiki page:

  Quote

GetSelf is only useful when this information is accessed externally, or when the scripted reference's RefID needs to be passed as a parameter to a function like PushActorAway
and
GetSelf shouldn't be used in object scripts on an item that is or can be in inventory.

See the GECKWiki "Associating data with a reference" page, and 'TIP Reference Variables explained' under the 'GECK Form-ID Base-ID Ref-ID and Editor-ID' section of the wiki "Getting started creating mods using GECK" article. When things do not go as expected, then you need to insert "debugging statements" to find out exactly what is not as you expect. Please see 'TIP Debugging data to file' under the "Scripting" section of the same article.

 

Also, a conditoinal test such as ">=1" is actually two tests: one for "equality" and one for "greater than". It is more efficient to use a single test where possible, such as ">0" instead.

 

-Dubious-

Link to comment
Share on other sites

Hey there, welcome to modding.
It's always nice to see when others either try to figure things out. I don't feel that alone anymore. ^^

 

  On 8/26/2019 at 12:26 PM, dunkemdeep said:

Third attempt

Turned the static shelf into a container, applied the script and put the magazines in place, I could put the mags in but nothing would show on display.

That's actually how I solved my showcase in my enhancement for the Goodsprings Farmhouse from Ignis101 and the updated version by my old mentor.
The funny thing what I accidently discovered is, that when I turn a wall cabinet into an activator then the doors of it are actually animated. :O
Many things in the game have some animation textures, but they are nowhere used.
The problem with that was, that the activator is no container for sure. So I added a container inside the sink (cannot be interacted with), which gets activated when the player opens the wall cabinet doors. XD
Here the script for the doors:

  Reveal hidden contents



Here the script for the "space" which was an invisible activator that used the same mesh as the door, but the textures got replaced with NUll TEXTURE set.

  Reveal hidden contents


These are the very inconvenient showcase scripts. They are UDFs called, when the container menu is left.

  Reveal hidden contents


This UDF gets called by the previous UDF. Scripts have a limited length.
I actually think it's pretty dumb to program like that, but it works and it only runs once when the respective event triggers the call.

  Reveal hidden contents

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...