Jump to content

Changing globals every three days


gob2

Recommended Posts

Every three in-game days I'd like to change a few custom global values, so a cell's lvl'd spawns "cycle" on or off depending on the day.

 

For example:

 

Integers a,b,c are used for "chance-none" values. On day one, a and b are set to "0" while c is set to "100". On day 2, a and c are "0" while b is "100", and day three sets a as "100" while b and c are zero. Something like that. Then it loops back to day one and so on indefinitely.

 

Does this make sense? What's the best way to do this? How does something like this interact with sleeping/waiting?

 

Thank you for checking this out.

Link to comment
Share on other sites

A start game enabled quest with this script attached:

GlobalVariable Property pGlobalChanceNoneA Auto Const Mandatory
GlobalVariable Property pGlobalChanceNoneB Auto Const Mandatory
GlobalVariable Property pGlobalChanceNoneC Auto Const Mandatory
Int iSequence

Event OnQuestInit()
 pGlobalChanceNoneA.SetValue(100)  
 pGlobalChanceNoneB.SetValue(0)  
 pGlobalChanceNoneC.SetValue(0)  
 iSequence = 2 
 StartTimerGameTime(72, aiTimerID = 0)
EndEvent

Event OnTimerGameTime(int aiTimerID)
 If (iSequence == 1)
  pGlobalChanceNoneA.SetValue(100)  
  pGlobalChanceNoneB.SetValue(0)  
  pGlobalChanceNoneC.SetValue(0)  
  iSequence = 2
 ElseIf (iSequence == 2)
  pGlobalChanceNoneA.SetValue(0)  
  pGlobalChanceNoneB.SetValue(100)  
  pGlobalChanceNoneC.SetValue(0)  
  iSequence = 3
 ElseIf (iSequence = 3)
  pGlobalChanceNoneA.SetValue(0)  
  pGlobalChanceNoneB.SetValue(0)  
  pGlobalChanceNoneC.SetValue(100)  
  iSequence = 1
 EndIf
 StartTimerGameTime(72, aiTimerID = 0)
EndEvent 

Edited by SKK50
Link to comment
Share on other sites

  • Recently Browsing   0 members

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