i want to add a script to the unit ability bonus vs mounted units, so that if a mounted unit is damaged by a unit with said ability, the mounted unit is replace with another unit.
i think that i need to add a new element, let call it <AntiMounted>, to the CIV5UnitPromotions.xml and write a script to do whatever it's suppose to do.
i have decent knowledge on programing in various languages, so the script itself won't be that much of a problem, i have to find the commands for what is this unit's class or how much damage has the unit taken. what i do not know is whether or not it is even possible to add a new element and if so, where would it calls the script for the new element from.
there is a very good chance that this is quite possible, because you can gift units, update units, promote units and capture units... all of which changes the current unit into something else. and with settlers, the captured unit is a worker. so for certain you can change a unit into something else, just that the condition is changed.
also with the elements like <Pillage> when set to true it allows a unit to pillage an improved tile. where is the script that is activated when this happens? if i can find where this is located then i can add a new element and create a script for it in similar fashion.
so my question is where are the codes for all these elements? i hope it's not hardcode into the game, cause then this is probably undoable... but if you have any ideas, let me know. thanks
i think that i need to add a new element, let call it <AntiMounted>, to the CIV5UnitPromotions.xml and write a script to do whatever it's suppose to do.
Code:
<UnitPromotions_UnitCombatMods>
<Row>
<PromotionType>PROMOTION_ANTI_MOUNTED_II</PromotionType>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
<Modifier>100</Modifier>
<AntiMounted>true</AntiMounted>
</Row>
</UnitPromotions_UnitCombatMods>
i have decent knowledge on programing in various languages, so the script itself won't be that much of a problem, i have to find the commands for what is this unit's class or how much damage has the unit taken. what i do not know is whether or not it is even possible to add a new element and if so, where would it calls the script for the new element from.
there is a very good chance that this is quite possible, because you can gift units, update units, promote units and capture units... all of which changes the current unit into something else. and with settlers, the captured unit is a worker. so for certain you can change a unit into something else, just that the condition is changed.
also with the elements like <Pillage> when set to true it allows a unit to pillage an improved tile. where is the script that is activated when this happens? if i can find where this is located then i can add a new element and create a script for it in similar fashion.
so my question is where are the codes for all these elements? i hope it's not hardcode into the game, cause then this is probably undoable... but if you have any ideas, let me know. thanks
