Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I want to create an ability that when activated makes all units that were previously attacking it stop, and as long as it is active the user can only be attacked via direct command and not through auto attack or attack move. is that possible?
I tried playing around with this concept but I don't think it will work in my map BC I want this to be an ability for a tavern hero on an altered melee map. so even when I gave the unit to neutral passive (a different one then critters and buildings so as not to give free scouting) and shared control with the original owner, If multiple players had this hero and used this ability at the same time it would cause chaos....
How can i turn off auto attack?
they suggested 2 solutions:
Reduce aquisition range (this will probably also disable attack move and only enable manual attacks)
Classify as worker (this will change how unit behaves in many ways, including disabling auto attack; and will also make icon apear)
How can i turn off auto attack?
they suggested 2 solutions:
Reduce aquisition range (this will probably also disable attack move and only enable manual attacks)
Classify as worker (this will change how unit behaves in many ways, including disabling auto attack; and will also make icon apear)
aha i missread you title for attack instead of attacked sry
anyway what about this:
Event01
Unit is issued order targetting another unit
conditions:
target is EnderWiggins
Or - any condition is true
issued order is right click
issued order is attack command
Actions
Add trigger unit to PermitAttackUnitGroup
Event02
unit is attacked
Conditions
attacked unit is EnderWiggins
triggering unit is not within PermitAttackUnitGroup
Actions:
order triggering unit to stop!
Event03
unit is issued an order targeting a point
unit is issued an order targeting a unit
unit is issued an order with no target
unit is issued any other order
Conditions
Unit is wihtin PermitAttackUnitGroup
Target is not equal to EnderWiggins
Actions
Remove triggering unit from Units within PermitAttackUnitGroup
but that wouldnt be MUI afaik
also im not sure the condition "Target is not equal to EnderWiggins" works if the event has no target.
I have been trying to play around with this but it seems that auto attack activates attack command. so by allowing or blocking one, I am doing the same to the other one.
I did this:
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) has buff leavemebe) Equal to True
(Issued order) Not equal to (Order(attack command))
(Issued order) Not equal to (Order(right click))
Actions
Unit - Order (Attacking unit) to Stop
and this way it had no effect. when i moved the unit close to the hero who was using the ability, they auto attacked him - so I guess auto attack works via attack command. and when i set the conditions the opposite way (order equal to attack ground) it couldn't attack him at all. so this looked promising, but not sure if possible this way.
There should be a way to do it by manipulating mechanical critter (the only unit with exactly the desired "attackability"), but th only way I found to manipulate it is by setting the desired unit as the only type of critter - which I don't want to do as this is for an altered melee, and I don't want to give a free hero to whoever uses a mechanical critter....
I may have thought of a way around this: make unit invisible & with no (is that possible?) or nearly invisible model file. than create a neutral passive dummy with the model you want that is always where the unit is. when your unit looses whatever status this is, make the dummy die and your unit return to its previous form.
Here's a trick : Create a dummy unit which is the same type as the unit you don't want to be auto-attacked and change its Combat - Targeted as to something which cannot be targeted, after that make the normal unit morph into this dummy unit when shes casts the spell.
Now if you want to attack command the unit in question, simply morph the dummy unit back to its normal form.
Here's a trick : Create a dummy unit which is the same type as the unit you don't want to be auto-attacked and change its Combat - Targeted as to something which cannot be targeted, after that make the normal unit morph into this dummy unit when shes casts the spell.
Now if you want to attack command the unit in question, simply morph the dummy unit back to its normal form.
You could so something like this, although it's not perfect:
Direct Attack
Events
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order with no target
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
LeaveMeBe[(Custom value of (Target unit of issued order))] Equal to True
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(attack))
(Issued order) Equal to (Order(smart))
Then - Actions
Set VariableSet AttackTarget[(Custom value of (Ordered unit))] = (Target unit of issued order)
Else - Actions
Set VariableSet AttackTarget[(Custom value of (Ordered unit))] = No unit
Cancel Attack
Events
Unit - A unit Is attacked
Conditions
LeaveMeBe[(Custom value of (Attacked unit))] Equal to True
AttackTarget[(Custom value of (Attacking unit))] Not equal to (Attacked unit)
Actions
Unit - Order (Attacking unit) to Stop.
Turn On Leave Me Be
Events
Player - Player 1 (Red) skips a cinematic sequence <--- This runs when you press ESCAPE
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
LeaveMeBe[(Custom value of Paladin 0000 <gen>)] Equal to False
Then - Actions
Set VariableSet LeaveMeBe[(Custom value of Paladin 0000 <gen>)] = True
Game - Display to (All players) for 30.00 seconds the text: Leave Me Be = ON
Special Effect - Create a special effect attached to the origin of Paladin 0000 <gen> using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
Else - Actions
Set VariableSet LeaveMeBe[(Custom value of Paladin 0000 <gen>)] = False
Game - Display to (All players) for 30.00 seconds the text: Leave Me Be = OFF
Special Effect - Destroy (Last created special effect)
It takes advantage of that Unit Indexer system I used in your other spell.
How it works:
1) When a unit is attacked, if LeaveMeBe = True for the attacked unit, then order the attacker to "stop".
2) When you order a unit to directly attack a target, this target is saved as the AttackTarget for the ordered unit.
3) If LeaveMeBe = True BUT the attacked unit happens to be the attacking unit's AttackTarget, then allow the attack to go through.
4) When a unit issues any order other than a Direct Attack (aka any order other than "smart" targeting a unit or "attack") then set it's AttackTarget to No Unit.
besides that - I triggered the activation basically exactly as you wrote (but appropriately and minimally altered to fit the ability and not a test) but being as its an ability based on immolation just wanted to show you the deactivation and ask if everything looks right- anything missing? :
turn off leavemebe
Events
Unit - A unit Is issued an order with no target
Conditions
(Issued order) Equal to (Order(unimmolation))
(Unit-type of (Triggering unit)) Equal to Master of Illusions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
LeaveMeBe[(Custom value of (Triggering unit))] Equal to True
Then - Actions
Set LeaveMeBe[(Custom value of (Triggering unit))] = False
Else - Actions
Set LeaveMeBe[(Custom value of (Triggering unit))] = False
Yes, those are the correct variable types.
Boolean = True/False, Unit = Some specific pre-placed unit like Paladin 001 or a unit from an Event response like (Triggering/Casting/Dying unit).
You can always figure out a Variable type by it's value.
Anyway, since you're toggling LeaveMeBe with Immolation, you know for certain that "unimmolation" is ALWAYS turning OFF LeaveMeBe, and you know that "immolation" is ALWAYS turning it ON.
What you should do to simplify these triggers:
Delete the If Then Else, and keep only the single Set LeaveMeBe[custom value] = False in the Actions.
And do the same thing for your Turn On Immolation trigger, but set LeaveMeBe[custom value] = True instead.
So your 2 LeaveMeBe triggers will look something like:
A unit is issued an order, order = immolation, set LeaveMeBe = True.
A unit is issued an order, order = unimmolation, set LeaveMeBe = False.
Also, the Else in your current If Then Else works but it doesn't make any sense.
If LeaveMeBe = True
Set LeaveMeBe = False
ELSE (So if LeaveMeBe = False)
Set LeaveMeBe = False
^Your Else is only running if LeaveMeBe is already False, so it's redundant. You're setting LeaveMeBe = False if it's already False... lol.
But I point this out only to help you understand better as in this case the If Then Else isn't even needed in the first place.
I just found two small bugs -
1. when the hero gets stunned while using the ability - if I disable it while stunned - the ability itself stays active, while the "leavemebe" status ends.
2. while in leavemebe - the hero using the ability inconsistantly also doesn't auto attack or ground attack some enemies. this did not happen against enemy units(even a magic immune one) or against low level creeps, only against a granite golem. don't know what that's about.
3 - not a bug, but a setback - this ability stops creeps from attacking the user. what is the best way around that? specifically triggering creeps to focus the caster?
haven't changed according to your last post yet though...
I thought so, but I don't understand the way the whole thing (using the indexer) works enough to feel comfortable messing around with it yet... the guides I found use a bunch of terminology I'm not familiar with yet....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.