What's wrong with this: Problem of variable?
*
Tested with Ironfist version 1.2.1+ (version of December 15, 2016).
*
In the scenario "TestScri.mx2" (
Massive Test of Project Ironfist Script System), I recruited Rangers with this code:
rangerRecruit = 0;
function OnUnitRecruit(CREATURE_RANGER)
MessageBox("I see you.");
rangerRecruit = 1;
MessageBox(rangerRecruit);
end;
if rangerRecruit == 1 then
MessageBox("This should be displayed after recruiting Ranger.");
end;
The message box "This should be displayed after recruiting Ranger." is never displayed.
***** Edited *****
rangerRecruit = 0;
function OnUnitRecruit(creatureid)
if creatureid == CREATURE_RANGER then
MessageBox("I see you at Ranger.");
rangerRecruit = 1;
MessageBox(rangerRecruit);
end
end;
if rangerRecruit == 1 then
MessageBox("This should be displayed after recruiting Ranger.");
end;
The message box "This should be displayed after recruiting Ranger." is never displayed.