Oh, yeah, sorry, its GetUnitsAtLocation, or UnitsInCell.
Announcement
Collapse
No announcement yet.
IW, Could you help with one of yours Slics?
Collapse
X
-
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
-
It strikes me that the veteran function is never actually used in the code. I don't know how that got through...
Add these lines:
Code:HandleEvent(MoveUnits) 'MakeVeteran' pre { location_t tmpLoc; tmpLoc = unit[0].location; tmpPlayer = unit[0].owner; VeteranEffect(tmpLoc, tmpPlayer); }
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
-
Just use this:
Code:void_f VeteranEffect (location_t tmpLoc, int_t tmpPlayer) { int_t i; unit_t tmpUnit; int_t tmpNum; int_t numUnits; int_t tmpPlayer2; player[0] = tmpPlayer; numUnits = player[0].units; tmpPlayer2 = tmpPlayer; if (IsPlayerAlive(tmpPlayer2)) { // Make all Units non veteran, except Special Units for (i = 0; i < numUnits; i = i + 1) { GetUnitByIndex(tmpPlayer2, i, tmpUnit); tmpNum = tmpUnit.type; if (tmpNum >= 106 && tmpNum <= 112) { ToggleVeteran(tmpUnit, 1); } else { ToggleVeteran(tmpUnit, 0); } } } // Make all Units veterans who share the location Alexander, Robin Hood and Richard The Lion Heart tmpNum = GetUnitsAtLocation(tmpLoc); for (i = 0; i < tmpNum; i = i + 1) { GetUnitFromCell(tmpLoc, i, tmpUnit); ToggleVeteran(tmpUnit, 1); } } HandleEvent(MoveUnits) 'MakeVeteran' pre { location_t tmpLoc; tmpLoc = unit[0].location; tmpPlayer = unit[0].owner; VeteranEffect(tmpLoc, tmpPlayer); }
BenConcrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
Originally posted by Immortal Wombat
and that you have not got CannotBuild lines in their units.txt entries.
Ben"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
Comment