- Joined
- Dec 26, 2021
- Messages
- 47
Hello, is there any way to detect if ancient is rooted / uprooted (not movementspeed related)?
easy than you and also thanks uncle for the work!BlzGetUnitBooleanField(unit, UNIT_BF_IS_A_BUILDING) returns true when ancient is rooted.
The Root Orders trigger will remove the Unit from the Unit Group if it issues an order other than root/unroot:I've tried to do this once before and I'm surprised the building check worked because apparently I ended up checking the armor type instead of whether it was a building.
I think there may be a flaw in Uncle's trigger because if I order a unit to root, it will continue to have that order until it roots. If I then tell that unit to move or cancel before it has actually rooted, it will be considered as rooted per the condition, so you'll have to check Iceman's condition once the meet the condition of not having the root order.
So
if order not equal to root AND unit is a structure then...
If the structure but doesn't work try checking the armor type, for some reason I thought that both counted as a structure, rooted or unrooted. I'll look at my system when I got home, it was GUI and very similar to Uncle's trigger
You're mistaken, it works fine. A Unit can only ever be in Root_Group if it has the 'root' order. This will always be the case when it's trying to Root somewhere. The moment you change it's Orders to something else it is removed from Root_Group via the Root Orders trigger. A Unit that isn't inside of Root_Group cannot display the 'Rooted' message, that's simply not possible.That should work now, but I'm not sure if you understood my point, unless I'm completely mistaken, but I don't think I was.
If the unit was in root group and didn't have the root order it would be removed, and then so long as it was alive it would display the 'Rooted' message.
But it's water under the bridge because that building check would cover it.
Your updated trigger does work 100%, the original one doesn't.You're mistaken, it works 100% fine. A Unit can only ever be in Root_Group IF it has the Root order which will always be the case when it's trying to Root somewhere. The moment you change it's Orders it is removed from Root_Group via the Root Orders trigger. A Unit that isn't inside of Root_Group CANNOT display the 'Rooted' message, that's simply not possible since it need to be in the group to do so. Root Orders always happens before Root Loop which is the important thing to understand.
A Unit enters Root_Group when it is issued the order to Root, not when it Unroots. We're tracking whether or not it's still trying to Root.Your updated trigger does work 100%, the original one doesn't.
A unit enters root group when it unroots. When the order ceases to be root, which may well be because they were given a move or attack order, they were removed from the group.
But if the order was given to attack, or move or something else, they would have been removed and yet not rooted.
Here's what was done:
All root ordered units added to root group.
Every second pick root group unit.
If picked unit no longer has root order, for example if it was cancelled as well as if it was actually rooted, then it would check if it was alive and then if it was alive it would give the message "Rooted".
It's still up there in your post if you want to look.
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)If - Conditions
- Root_Order Equal to (Order(unroot))
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Root_Order Equal to (Order(root))
- Else - Actions
- -------- It issued a different order so it's no longer trying to Root. --------
- Unit Group - Remove Root_Unit from Root_Group.
No worries, I just had to defend my trigger's honorI removed everything but the part I wasn't noticing. Sorry about that and sorry I've made an ass of myself.
Anyway, good work, for what it's worth coming for me after all that...