Hi,
I still did not find an way to reduce the hp (or any attribute) of an specific unit via Lua script. Is there any?
Reduce Hitpoints in Lua script
Re: Reduce Hitpoints in Lua script
I don't see anything in the wikia entry, you might be able to hack something together by killing and creating a new unit in it's place edit.create_unit_full(). I'm not sure if this would have any unintended effects (dropping new units into locations, adding units to cities, transports, increment counters, just changing the unit's ID), but you could also capture some events by catching the unit_built signal and returning true to stop the bubbling to other event handlers to avoid some of these things.
Something built into the API would obviously be simpler, but that requires a change in the source. It is at least completely backwards compatible.
Something built into the API would obviously be simpler, but that requires a change in the source. It is at least completely backwards compatible.