jastey Posted January 10, 2009 Share Posted January 10, 2009 I have what it seems a principal problem concerning the understanding how timers are handled. I want to prolong a game timer after it is set so that it runs longer than in the original game. Since this timer is set at various places and to ensure compatibility also for a later install, what I wanted to do is to re-set the timer to a longer value. The timer is the global timer (no real time) "udEscape". I patch the baldur.bcs with the following script block: IF GlobalTimerNotExpired("udEscape","GLOBAL") Global("C#SB_AbolethKampfTimer","GLOBAL",0) THEN RESPONSE #100 SetGlobalTimer("udEscape","GLOBAL",ONE_DAY) SetGlobal("C#SB_AbolethKampfTimer","GLOBAL",1) Continue() END The block gets executed at the right time (checked by getting the variable in game). Still the original timer length "180" seems to be active, since the timer ends with all consequences about 5-10 min after it was originally set in the game. It is the timer that runs after the deamon ritual in Ust Natha. I want to give the party enough time to return to the city before it gets hostile (in the mod, Adalon helps for this), but it doesn't seem to work the way I think it should. I checked with NI for the timer and for the "DrowCityHostile" variable in the game and see no reason why it should get set in my case if the timer is still running. How would I prolong a running timer, or is it not possible? Or does anyone know what I might have overlooked in this particular case? Link to comment
the bigg Posted January 10, 2009 Share Posted January 10, 2009 Short answer: IncreaseGlobal("TimerName","GLOBAL",Time_to_increase) should work. Technical answer: timers are stored as the absolute time at which the timer will end. For example, assume you've been playing for 100000 wall clock seconds and start a RealTimer a day long (86400 seconds): the timer variable will be set to 186400. If you increase the timer by 3600 (one real-time hour), the timer variable will be set to 190000, effectively equivalent to prolonging the RealTimer by one hour. Same thing applies to in-game Timers. Link to comment
jastey Posted January 10, 2009 Author Share Posted January 10, 2009 Ah, I will try the IncreaseGlobal, then. I think I understood what you said. Thank you! Link to comment
jastey Posted January 10, 2009 Author Share Posted January 10, 2009 No, IncrementGlobal didn't do it, either. I am clueless. I have not enough patience to test this timer prolonging thing. Maybe I overlooked something in this special case, but I wouldn't know what. EDIT: I added a checkvariable and no, it is the mentioned script block that sets the variable. So the setting / increasing of the timer has no effect. Weird. Link to comment
Taimon Posted January 11, 2009 Share Posted January 11, 2009 Resetting the timer is possible (with your first approach), at least it did work in my simple test case. Are you sure the timer isn't reset by some dialogue/script after your block in baldur.bcs triggered? Link to comment
jastey Posted January 11, 2009 Author Share Posted January 11, 2009 I checked several times, and it is one special script block that sets the variable, which only comes true if the timer run. The resetting of the timer was executed, too, and still it wasn't prolonged. I really don't know. I resolved the problem now by adding another variable to the original game script block, now I have control over the execution of this block (it will be executed if the timer run AND the variable is set), which seems to work fine. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.