ajs52698 Posted September 18, 2016 Share Posted September 18, 2016 (edited) Im having a hard time finding a way to condition a certain object to be placed only if a certain amount of time has passed since a another action before happened. Im aware of timers and this | but could use some help. V https://forums.nexusmods.com/index.php?/topic/4779470-how-to-get-game-days-passed-with-activator/ Im unable to use isharas suggesting as I need it to be condition for when a object is placed, to start a timer. Really what I need is a condition such as hastimerexpired, that would solve all my problems :( Edited September 18, 2016 by ajs52698 Link to comment Share on other sites More sharing options...
LoneRaptor Posted September 18, 2016 Share Posted September 18, 2016 (edited) If you are placing the object in script you can start a timer when you've placed the item and have it change a global variable withc you can then use as a condition with GetGlobalvalue. For example:GlobalVariable Property HasTimerExpired Auto ;Add this to the start of your script ;Code that places the object StartTimer(Amount of time in seconds,TimerID) ;The TimerID is an int you use when it expires then later in the script you put thisEvent OnTimer(int aiTimerID) If aiTimerID == TimerID HasTimerExpired.SetValue(1) ;Change the HasTimerExpierd for the name of your golobalvariable and make sure to add an unique prefix to it so it won't conflict with other mods EndIf EndEventYou can use the condition GetGlobalvalue = 1 to detect if the timer has expired, But if you don't reset it to 0 after youve used this it will only work once. If you want to use this as a condition in script you can use If(HasTimerExpiered.GetValue() == 1)If your not placing the item in script you'll have to find a way of detecting when the items gets placed. Edited September 18, 2016 by LoneRaptor Link to comment Share on other sites More sharing options...
ajs52698 Posted September 18, 2016 Author Share Posted September 18, 2016 (edited) Would there be way to set a seperate timer for each object? Say I was getting a object from a array and for each one have a timer rather than having 1 timer updated each time a object is spawned. The way I was thinking of doing this is with the random int, so say for each object StartTimer(24,RandomInt(0,25), but im not sure if thats practical Edited September 18, 2016 by ajs52698 Link to comment Share on other sites More sharing options...
LoneRaptor Posted September 18, 2016 Share Posted September 18, 2016 (edited) You coud use the index of the location in your array as the timerID but you would need to know the index for each item in your array. Then in the on timer change the If accordingly. Edit: you would also need a global for each item. Edited September 18, 2016 by LoneRaptor Link to comment Share on other sites More sharing options...
ajs52698 Posted September 18, 2016 Author Share Posted September 18, 2016 (edited) so its gets tedious very quickly ha Think for now Ill use your code and later on attempt to implement a more specific timing system Edited September 18, 2016 by ajs52698 Link to comment Share on other sites More sharing options...
ajs52698 Posted September 18, 2016 Author Share Posted September 18, 2016 (edited) 1 Edited September 18, 2016 by ajs52698 Link to comment Share on other sites More sharing options...
Recommended Posts