Reset a Global variable.

Post » Fri Feb 01, 2013 8:16 am

Hi internet peoples!

If i have a global variable that can range from 3 to 0, what would i need to attach the script to to detect when this variable has reached 0 and reset it back to 3?

this is for a little item dispenser in a shop that each time the global ticks down it disables one item on the shelf. when it reaches 0 the shop is sold out. when the global gets reset, the items get re enabled.

also, do you guys think i should reset the global when the player leaves the cell, or should i put it on a short 5 minute timer?
User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Fri Feb 01, 2013 3:46 am

Would you want the shop to restock while the NPC is in it? Or for the NPC to just walk outside and come back and have stock to purchase again? Otherwise, you could use the same timers that govern the vendors inventory resets.
User avatar
Eileen Müller
 
Posts: 3366
Joined: Fri Apr 13, 2007 9:06 am


Return to V - Skyrim