GetUnitDef(int id) return a null pointer when called during initialization of an ai
however, GetUnitDef("ARMCOM") works fine for me; is it possible that the unit ids are not set when spring ai intefrace calls InitAI() ??
GetUnitDef(int id) causing trouble
Moderators: hoijui, Moderators
wewll, you shuldn't call it during the init, as you don't have any units.
the first unit you see is the commander after the game start and before the first update.
the best place to put it is inside a unitcreated (called whenewer a unit is started being built) or unitfinisched (called when the unit is ready).
the first unit you see is the commander after the game start and before the first update.
the best place to put it is inside a unitcreated (called whenewer a unit is started being built) or unitfinisched (called when the unit is ready).