I'm trying to use the same key for selecting and removing the Battle group target.

From code, it looks like all the keys are handled in a huge if block:


// SelectedTargetsSettings.cs
...
else if(this.nearestKey.GetButton(user.InputID))
{
selectedTargets[index] = ORK.Game.Combatants.GetNearest(user, true,
this.onlyInBattleRange ? Battle.BattleRange : this.range,
this.selectEnemies, this.selectDead, this.GetConsiderBattle(), this.CheckTarget);
this.raycastRemoveBlocked = this.raycastTargetingRemoveBlockedByInput;
this.lastRaycastTarget = null;
}
else if(!this.autoSelect && this.removeKey.GetButton(user.InputID))
{
selectedTargets[index] = null;
this.lastRaycastTarget = null;
}
...


It'd be nice if we can add a special case to check if the removeKey button is pressed AND that there is a valid target, then clear that target instead of selecting.

What would be the best way to do this in the meantime though, without changing the source code?
  • edited October 3
    I'll look into it.

    Meanwhile, you can also use schematics to change selected targets, see the Change Selected Target node.

    Edit: Next update will change the behaviour, using the same key for remove and any of the other target selection keys will work. If a target is selected, it'll be removed, otherwise select a new one.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • You are awesome! I'll come back to this :3
Sign In or Register to comment.