LUA Code - Flag Teleports - Updated
Posted: Tue Sep 29, 2009 6:26 pm
I'm writing a code so that, when the player spawns as a specific unit, the flag in a 1-flag CTF match is teleported to their matrix (so they pick it up).
The code:
I get some odd CTD-causing errors, though:
Aside from the stock errors, these are the only ones in my error log. I have no mungelog.
My code looks all right to me - I have all the ends and ) in the right spots...and anyway the error doesn't mention LUA (though the code must be the cause of the error). ANy ideas on how to fix this?
EDIT - Hmm, the crash was probably due to another issue, because I ran it again and I was able to play. However, when I spawned as the dark trooper, nothing happened. Also, no AI were spawning. I captured the flag manually and the capture region didn't work. I got this:
What does that mean? My setup teams section:
The code:
Hidden/Spoiler:
Code: Select all
Message Severity: 2
.\Memory\RedMemory.cpp(634)
Allocating 408136 bytes attempt failed - no free blocks left in Heap 5 (Runtime)
Message Severity: 3
.\Memory\RedMemory.cpp(538)
Allocating 408136 bytes failed - no free blocks left in Heap 5 (Runtime)My code looks all right to me - I have all the ends and ) in the right spots...and anyway the error doesn't mention LUA (though the code must be the cause of the error). ANy ideas on how to fix this?
EDIT - Hmm, the crash was probably due to another issue, because I ran it again and I was able to play. However, when I spawned as the dark trooper, nothing happened. Also, no AI were spawning. I captured the flag manually and the capture region didn't work. I got this:
Code: Select all
Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: table index is nil
stack traceback:
(none): in function `SoundEvent_SetupTeams'
(none): in function `ScriptPostLoad'Hidden/Spoiler: