Tempermental TimerElapse

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Tempermental TimerElapse

Post by Ace_Azzameen_5 »

I have an OnTimerElapse event that does not trigger sometimes.
It always starts and shows, but then onelapse the Elapse event is Ignored.

This does not happen when I use my variable to skip to the part of this campaign mission where the timer is called. This skipping code just calls the the same function that completing the previous objective does.

I have another skipping code that calls the same Objective complete function, but 1 second after (via a timer) the map starts. Using this code, the timer won't elapse either.

The TimerElapse is not working, no print("output") and no desired code.

What gives? Does anybody know something, some code in my LUA (Aside from something explicitly written to break the timer?) that would break this?


I do have occasionally get (depending upon which sides and sky's my code randomly loads, I think) a crash based on the String Pool is full message, but only BF2_modtools.exe crashes, not the game proper.
Would it be wise to go through my code, and DeleteEntity every dead object that won't be respawned, DestroyTimer every timer that won't be resused, and = nil all my variables that I
am done with?

Otherwise, the only solution is to have players change my maps 'config' file to run my skip code after beating the first part of the level :P :roll:

Thanks,
AceAzz

My LUA is 2180 lines long and calls several other files, but I can post if someone thinks that will help.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Tempermental TimerElapse

Post by [RDH]Zerted »

Ace_Azzameen_5 wrote:Would it be wise to go through my code, and DeleteEntity every dead object that won't be respawned, DestroyTimer every timer that won't be resused, and = nil all my variables that I am done with?
Yes, you should completely wipe out things the map no longer needs when its done with them. There is a limit to the amount of timers, so make sure to destroy or reuse those. If you are using local varName = value then you don't need to nil out your variables. They are removed automatcially when they go out of scope. If you aren't using local, then each variable is staying around forever (which you don't want).
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Tempermental TimerElapse

Post by Ace_Azzameen_5 »

I got it to work, I can't believe I didn't think to try this, I just moved the TimerElapse stuff into a function, and called it from an if statement from a previously used timer.
(If Blah = 1 then
bombard()
else
OriginalTimerFunction()
end
) ...
Its ugly but it works and the destroy timer stuff didn't seem to be working anyway. But I will clean up my timers and variables anyway and see if the separate timer works again. Although for my non-repeat use timers that are not simultaneous, I think I'll replace them with one timer and if statements.
Post Reply