I will preface this FR by saying this is really just a brainstorming thread examining a method by which to achieve the goal... I am really just wanting to cultivate dicussion about what would be cleanest... most versatile and (above all else) reasonably achievable.
So I have been beating my head against a wall trying to help another map maker to develop a way of creating a way to gain "experience" based on combat (destruction of units) for both attacker and defender.
To that end I started to look at some of the "unit attachments"... one that jumps out at me is the following...
whenCapturedChangesInto values: allows a unit to change into a different unit when captured from a specific player to a specific player. "fromPlayer:toPlayer:transferAttributes:unitType:numberOfUnits". accepts "any" instead of a player name. allows multiple.
examples: <option name="whenCapturedChangesInto" value="any:any:true:Minor_Factory:1"/> and <option name="whenCapturedChangesInto" value="Russians:Germans:false:gold:3:lumber:1"/>
Now... although it is not explicitly defined... this attachment seems to only be capable of being attached to "is infrastructure"... and if you attach that to all combat units then no one would be capable to attacking since all units would be captured(or destroyed) as soon as they move into an enemy territory. However... in looking at this attachment... it made me wonder...
Would it be even possible to make a similar attachment but specifically for "non=infrastructure" units?
Something like...
whenDestroyedChangesInto values: allows a unit to change into a resource(s) when destroyed in combat from a specific player to a specific player. "fromPlayer:toPlayer:transferAttributes:resourceType:numberOfresource". accepts "any" instead of a player name. allows multiple.
examples: <option name="whenDestroyedChangesInto" value="any:any:true:PU:1"/> and <option name="whenDestroyedChangesInto" value="Russians:Germans:false:experience:1:leadership:1"/>
I have no idea how the engine tracks destroyed units during the course of a battle so I have no clue as to whether an attachment like this is even possible.
Again, just brainstorming.