OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: White Angel on 05 Oct 2005, 13:50:54

Title: Disable the Save Game or not :-\
Post by: White Angel on 05 Oct 2005, 13:50:54
Hi all,  

I have a little problem with a new beta mission i am working on.

All the mission is linked with a countdown. It start at the beginning of the mission and when the countdown reach zero the last objectif can be completed. The countdown appears on the top of the screen each minutes, with the help of a script. I like this idea in mission and i find it work pretty well.
The problem appears during testing when i do a savegame. After each save game the countdown start to the initial value  ???  it is a bit anoying because some of my triggers are linked with this countdown (some enemies meeting ...). And after a save game, when i am ready to attack at the good time, i need to wait the time i have planned for the approch  :-\

Is there a possibility to disable SaveGame in misisons or to save the point reach by the countdown in each Save Game ?

Thanks a lot.
Title: Re:Disable the Save Game or not :-\
Post by: THobson on 05 Oct 2005, 14:02:36
I don't believe so.  The problem could be that the command time resets after a save.

Try using _time instead, this is the time since the script started running.

Or try saving the time periodically to a global variable and using that instead.

Title: Re:Disable the Save Game or not :-\
Post by: THobson on 05 Oct 2005, 18:30:34
Something like:

*** NB Edited after it was first posted ***

Code: [Select]
CurrentTime = _time
BaseTime = 0
NewBase = 0
#loop
~1
if (CurrentTime > BaseTime + _time) then {BaseTime = NewBase}
NewBase  =  BaseTime + _time
CurrentTime = BaseTime + _time
goto"loop"

Then do all your checking on CurrentTime

Title: Re:Disable the Save Game or not :-\
Post by: White Angel on 06 Oct 2005, 12:33:36
Thank you very much THobson.

I have modified my script according to yours and it works pretty well.

 ;)