Jump to content

Gun Rack Display script problems


2Dope

Recommended Posts

Ok, now I DO have a problem with my Gun Rack Display ...

 

But its not with my script ...

 

Here's my script code (with generic references):

 

scn GunDisplayScript

BEGIN OnClose

if (LockerRef.GetItemCount Weap10mmPistol > 0)
	WeaponRef.enable
elseif (LockerRef.GetItemCount Weap10mmPistol == 0)
	WeaponRef.disable
endif

END

 

That works fine if I use it on a standard container found in the game, like a footlocker, or vault locker.

 

If I create my own container, choose the mesh I want to use, and set that script to my new container, it no longer works...

 

Can anyone shed some light on this?

 

(Yes, all my references work, else the script wouldn't save :P)

Link to comment
Share on other sites

Have you tried OnActivate?

 

OnActivate doesn't appear to work unless its an activator, but that's not what I want, as that will check on activation, whether to display guns contained in it, therefore I would have to use the container twice, once to put guns in, and once again to make it check.

 

Basically the script runs once my container closes to check whether to display the guns contained in it. But it doesn't appear to work with custom containers. It's doing my head in trying to get it to work, maybe its a bug within the game itself, not what I am doing with the container/script... I dunno...

Link to comment
Share on other sites

AH! After a little bit of messing around, used gamemode, and my custom container now runs the script properly. Thanks Alexx378!

 

PS, it was probably the way I was using OnActivate at the time when it wasn't working (was just starting modding, so probably didn't quite understand how it worked)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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