gerg357 Posted August 20, 2016 Share Posted August 20, 2016 lets say i click activator to start it then i want it to do something else if 3 days has passed since it was activated/clicked Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 21, 2016 Share Posted August 21, 2016 (edited) The following is an activate then 3 days later something else happens without activating again. Bare minimum code. Scriptname SomeScript Extends ObjectReference Event OnActivate(ObjectReference akActionRef) Float TimeToAct = Utility.GetCurrentGameTime() + 3.0 RegisterForSingleUpdate(TimeToAct) EndEvent Event OnUpdate() ;do whatever after at least 3 days have passed EndEvent The next one changes behavior when the activator is clicked again at least 3 days later. Scriptname SomeScript Extends ObjectReference Bool BeenClicked = false Float TimeToAct Event OnActivate(ObjectReference akActionRef) If BeenClicked == false BeenClicked = true TimeToAct = Utility.GetCurrentGameTime() + 3.0 Else If Utility.GetCurrentGameTime() < TimeToAct ;do action when less than 3 days Else BeenClicked = false ;do action when 3 days or greater EndIf EndIf EndEvent EDIT: There are other ways to do this as well. Those are just the easiest ones for me to write up. Edited August 21, 2016 by IsharaMeradin Link to comment Share on other sites More sharing options...
gerg357 Posted August 21, 2016 Author Share Posted August 21, 2016 Hey thx for the help man Link to comment Share on other sites More sharing options...
Ghaunadaur Posted August 22, 2016 Share Posted August 22, 2016 If it's 3 days, I'd recommend to use RegisterForSingleUpdateGameTime and OnUpdateGameTime instead of RegisterForSingleUpdate. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 22, 2016 Share Posted August 22, 2016 I knew there were game time versions, just slipped my mind. Those would be better to use. Would shorten the first code option posted earlier. Scriptname SomeScript Extends ObjectReference Event OnActivate(ObjectReference akActionRef) RegisterForSingleUpdateGameTime(3.0) EndEvent Event OnUpdateGameTime() ;do whatever after at least 3 days have passed EndEvent Link to comment Share on other sites More sharing options...
lofgren Posted August 22, 2016 Share Posted August 22, 2016 I think gametime updates are on the scale of hours, so 3 game days would be RegisterForSingleUpdateGameTime(72.0) Link to comment Share on other sites More sharing options...
gerg357 Posted September 27, 2016 Author Share Posted September 27, 2016 Thx I'll try that Link to comment Share on other sites More sharing options...
Recommended Posts