arcticnightwolf
Emperor
- Joined
- Jun 8, 2008
- Messages
- 1,301
Doesn't anybody know how to get UnitType from unit? Resp. converting int CyUnit.getUnitType to wstring or reversing gc.getInfoTypeForString ... ?
I have unit (ie Archer) and I want to rename it to "unit of city" (ie Archer of Washington) and I don't want to check unit for each type (( doing "if unit.getUnitType() == gc.getInfoTypeForString('UNITTYPE_ARCHER')" for each unit ))
( Not sure what does wstring getUnitName on not-yet-named unit, but i want to avoid this due to later problems with upgrading already named units. )
I'm quite sure that there have to be some function on this, but I cannot find it ...
I have unit (ie Archer) and I want to rename it to "unit of city" (ie Archer of Washington) and I don't want to check unit for each type (( doing "if unit.getUnitType() == gc.getInfoTypeForString('UNITTYPE_ARCHER')" for each unit ))
( Not sure what does wstring getUnitName on not-yet-named unit, but i want to avoid this due to later problems with upgrading already named units. )
I'm quite sure that there have to be some function on this, but I cannot find it ...