LUA Problem (Solved)
Posted: Mon Sep 29, 2008 12:35 pm
Error Message:
Function:
Problem is that the whole function isn't running, but I guess that's because of that error message.
So, is there anything wrong? Yes StopEEUnits is true when I try to test it. (It becomes true as a result of an event)
The function is located in ScriptPostLoad() below conquest:Start().
If you need any other information just tell me and I will post it.
Code: Select all
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to perform arithmetic on a function value
stack traceback:
(none): in function `ScriptPostLoad'Code: Select all
OnCharacterChangeClass(
-function(player)
if StopEEUnits == true then
print("StopEEUnits is working!")
if GetCharacterClass(player) == 8 and GetCharacterTeam(player) == 2 then
print("haha_inf_penguin check is working!")
AddReinforcements(CIS, 1 )
KillObject( GetCharacterUnit(player) )
SelectCharacterClass(player, "cis_inf_trooper")
SpawnCharacter(player, GetPathPoint("penguin_spawn", 0))
elseif GetCharacterClass(player) == 8 and GetCharacterTeam(player) == 1 then
AddReinforcements(REP, 1 )
KillObject( GetCharacterUnit(player) )
SelectCharacterClass(player, "rep_inf_ep3_rifleman")
SpawnCharacter(player, GetPathPoint("golem_spawn", 0))
end
elseif StopEEUnits == false then return
end
end
)So, is there anything wrong? Yes StopEEUnits is true when I try to test it. (It becomes true as a result of an event)
The function is located in ScriptPostLoad() below conquest:Start().
If you need any other information just tell me and I will post it.