Jump to content

So scripts lose their variables when moved?


Halstrom

Recommended Posts

If I have a script in a bottle of beer containing a variable telling how much beer is in the bottle like

 

 

if iDoOnce < 1

Set iDoOnce to 1

Set iBeer to 100

endif

 

 

and the script adjusts the int as hslf the beer is drunk, then I pass the bottle to a NPC, does it reset to 100?

Link to comment

I wager that as soon as you pass that bottle, it's no longer "that" bottle. In inventory they're this sort of half-refs (ie weapons & armor can have damage), in-world if moved from an inventory they're a dynamic ref (0x etc formid) and if geck-placed they're real refs. Passing that bottle is bound to change the state of something one way or another and probably cause an alternate instance of the effect script to start (or not, who knows).

Link to comment

Yeah, I'm pretty certain I get away with the GrowthTime variables not reseting in ARMOR pregnancy eggs and babies in most occasions of picking them up, passing to NPC's and putting them in boxes etc.

Maybe ARMOR are different to MISC since they remember health.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use