Tested with Ironifist version 1.2.1+ (version of December 15, 2016).
*
In the scenario "TestScri.mx2" (
Massive Test of Project Ironfist Script System), I recruited creatures with this code:
BUG: With OnUnitRecruit(creatureid), whenever a creature is recruited regardless of the name of the creature specified, the instuction is executed (test in a town and at the Ruins).And (creatureid) cannot be replaced by the number correspondence, per example, "OnUnitRecruit(CREATURE_RANGER)" cannot be replaced by "OnUnitRecruit(2)".function OnUnitRecruit(CREATURE_RANGER)
MessageBox("I see you at Ranger.");
end;
--<
it does not work, whenever a creature is recruited regardless of the name of the creature specified, the instuction is executed and the message box is displayed (test in a town and at the Ruins).function OnUnitRecruit(CREATURE_MEDUSA)
MessageBox("I see you at Medusa.");
end;
--<
it does not work, whenever a creature is recruited regardless of the name of the creature specified, the instuction is executed and the message box is displayed (test in a town and at the Ruins).function OnUnitRecruit(2)
--<
it does not work and a Script Error window is displayed. MessageBox("I see you at Ranger with 2.");
end;
***** Edited *****
Do not bother, the expression has to be written this way and everything works well:
function OnUnitRecruit(creatureid)
if creatureid == CREATURE_MEDUSA then
MessageBox("I see you at Medusa.");
elseif creatureid == CREATURE_RANGER then
MessageBox("I see you at Ranger.");
elseif creatureid == 0 then
MessageBox("I see you at Peasant.");
end
end;