I'm trying to adapt
this script to my needs.
What I want to do:When using
skillUseUnit hook, I check for enemy units in a certain radius around the soldier that triggered the hook. Then I need to set a certain tag for all found enemy units and change some values of their characteristics.
Problem:The
Tile.getUnit function returns a pointer to a read-only unit:
Name: Tile.getUnit Args: [ptr Tile] [var ptr BattleUnit]
But to change the tag for that unit, the
BattleUnit.setTag function needs a pointer to a unit that is writable:
Name: BattleUnit.setTag Args: [ptre BattleUnit] [BattleUnit.Tag] [int] Desc: Set tag of BattleUnit
How can I convert a readable unit (
ptr) to a writable unit (
ptre)? Or is there some other solution to my problem?