Nope. Must either make "combine" variables manually that check the target's unit type (gets messy if you have upgrades that increase range since you need to add in some "or" combines there too), alternatively give each unit a behavior that corresponds to their weapon range. Say, "Weapon Range 6", and use a validator to check which behavior the target has. This causes more lag (not much, but depends on how many units you're using), but is cleaner when it comes to upgrades as you can just disable certain behaviors and enable new ones using your upgrade.
TL;DR not without workarounds, since weapons aren't strictly part of a unit's base stats.
After checking, you can also use a useless field in a unit's stats (say, "Add On Offset X") to be equal to a unit's weapon range. You can then use the "Unit Compare Field" validator to compare ranges.
Yea, it was literally what I though: ok, adding behaviors could cause additional lag, so let's go checking unit types under Combine validator.
But your second idea with Unit Compare Field looked fun, because it would require only one validator, and also a little preparation step - a trigger, that would once run on init and put weapon range in units' field, luckily, I have an array of all unit types. Though, "AddOnOffsetX" wasn't accessible with a catalog change, so I used another one.
Though, it was only for test, becasue at the moment I read your messages, I already implemented the Combine behavior way and was lazy to redo.
Thanks for the ideas.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Just want to cast an abil only on units whose weapon range is greater than x, is it possible? (no triggers)
Nope. Must either make "combine" variables manually that check the target's unit type (gets messy if you have upgrades that increase range since you need to add in some "or" combines there too), alternatively give each unit a behavior that corresponds to their weapon range. Say, "Weapon Range 6", and use a validator to check which behavior the target has. This causes more lag (not much, but depends on how many units you're using), but is cleaner when it comes to upgrades as you can just disable certain behaviors and enable new ones using your upgrade.
TL;DR not without workarounds, since weapons aren't strictly part of a unit's base stats.
After checking, you can also use a useless field in a unit's stats (say, "Add On Offset X") to be equal to a unit's weapon range. You can then use the "Unit Compare Field" validator to compare ranges.
@TyaArcade: Go
Yea, it was literally what I though: ok, adding behaviors could cause additional lag, so let's go checking unit types under Combine validator.
But your second idea with Unit Compare Field looked fun, because it would require only one validator, and also a little preparation step - a trigger, that would once run on init and put weapon range in units' field, luckily, I have an array of all unit types. Though, "AddOnOffsetX" wasn't accessible with a catalog change, so I used another one.
Though, it was only for test, becasue at the moment I read your messages, I already implemented the Combine behavior way and was lazy to redo.
Thanks for the ideas.