XP upon Free Unit

Zagaroth

Chieftain
Joined
Nov 27, 2009
Messages
60
SO I am experimenting a little bit, and I created a building that gives a free unit upon completion of the building. that part works, great.

This building also gives XP. This works perfect for all units created later, but not for the Free Unit.

So, is there either A) a general way to fix this, or B) an XML phrase I can add inside the free unit description to give bonus XP to that unit?

<Building_FreeUnits>
<Row>
<BuildingType>BUILDING_PALACE_TEST</BuildingType>
<UnitType>UNIT_SCOUT</UnitType>
<NumUnits>1</NumUnits>
</Row>
</Building_FreeUnits>
 
The free units are always made that way. The same effect occurs when you build the Terracotta Army and get the free units from that that via the <InstantMilitaryIncrease>. There's nothing to add via XML to the <Building_FreeUnits> table to make it give the XP's.

An lua program could be written to force the game to add the XP's to the unit, but you'd have to also use Machiavelli24's Building Created snippet to 'catch' when the building is constructed, and then have your lua program take action from that point to add the XP's to the unit.
 
Top Bottom