Is it possible to set a flag for a specific player unit (not UnitDef nor feature), that would mark that unit invulnerable - i.e. completely immune to any kind of damage or negative effect, targeted or otherwise.
Again, much like the 'infinite resource' request, this would allow for unit AI to avoid shooting as such units, and it's much easier to work with other negative effects (such as slow), rather than having to do your own custom checks.
An example of how it would be set is
Code: Select all
Spring.SetUnitInvulnerable(number unitId, boolean invulnerable)
Rationale: It would be useful in custom games - you don't want the player to be able to attack certain structures, or you want to force the player to kill stuff in the right order. It may also be useful in skirmish games if you can imagine creating some sort of missiles/turrets/bombs that can only be hit at certain times, or "event units" such as bombers that you don't want people to be able to shoot down f.e, or just not at all times.