beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
178 stars 95 forks source link

Allow dynamic modification of weapon avoidance properties #1554

Open springraaar opened 2 weeks ago

springraaar commented 2 weeks ago

engine : any, including 105.1.1-2511-g747f18b BAR105

consider these situations: A unit builds a wall (neutral) or dragons teeth (feature)....

A way to improve this would be to let the controller toggle whether the units try to shoot through neutrals/features or not to hit enemies.

The engine should let the avoidance properties (avoidFriendly, avoidFeature, avoidNeutral, avoidGround, avoidCloaked) be dynamically modified through SetUnitWeaponState or SetUnitWeaponDamages the same way these other properties are:

https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#states https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#damages

springraaar commented 2 weeks ago

then i could make a gadget that adds a 3 state button to unit UI to control avoidance states:

sprunk commented 2 weeks ago

Spring.SetUnitWeaponState(unitID, weaponNum, "avoidFlags", 123) exists

springraaar commented 1 week ago

Thanks, i'll test these soon and likely close this issue.

Doc still needs to be updated, though.

sprunk commented 1 week ago

If it works fine according to your purposes then please rename to "add docs" instead of closing