• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Turning off auto attack and movement of a unit

Status
Not open for further replies.
Level 1
Joined
Nov 4, 2008
Messages
3
Hello all.

Now, I know this has been asked a lot on the forums, and I've done a search and did all of the mentioned solutions, but it just doesn't work for me.

To shortly explain what I am trying to do, here is a description of the map I am making.

There are 5 heroes per player (its only a 2 player map) and the game is won when all heroes of one side die.

So, here is the gameplay mechanics.
All units should be idle (not chase, auto attack, flee, whatever), unless they are selected by their corresponding owner/player.
However they can be attacked while in idle state (but must not respond to the initiated attack).

What I tried to do is this:

On Map Init:
Pick all units on the map and make them static/idle/passive

When a player selects a unit from his group, that unit can be moved, can attack, cast spells etc., but once the player selects the other unit the previous one goes into idle.

So I did:

Player picks a unit
A unit is owned by that player
Make all units passive
Make triggering unit active.

If a unit is attacked
Issue triggering unit to STOP.

And that's basically it. I have NO idea why things don't work, and I am totally dumbed as to why is it so difficult to achieve.

Before you give me your opinions and suggestions here is a list of what I tried and why it doesn't work.

1 - Made the units PAUSED - however this also pauses their buffs, CD-s, regen etc

2 - Peon/building/sapper type classification - doesn't work (all my units are heroes)

3 - Make the units hold/stop - this also doesn't work I don't know why.

4 - Shadow Meld/Drunken Haze is tricky, as one of my heroes has a purge, and that could remove the buffs.


Please, if anyone has any solution I would really appreciate it. Or if someone else did a similar thing if they can show me an example map or point me to it.

Thanks a lot for your help.
 
Level 6
Joined
Sep 5, 2007
Messages
264
Unit's that are "paused" will not return fire, but can still be selected... Do a "unit get selected" trigger that pauses ALL unit then unpauses the selected unit. That sounds like what you're after... Also, pausing unit DOESN'T affect buffs/regen/etc.

Hope this helped... :thumbs_up:
 
Level 1
Joined
Nov 4, 2008
Messages
3
Lord Bones: that's exactly what I did.

this is the trigger

Player Selects a Unit Owned by Played Red

Pause all units owned by Player Red
Unpause triggering unit.

Yes, that works fine, but...I am pretty sure the paused units do NOT regenerate health, mana, buffs/debuffs are stopped, etc.

I mean, I can try it again, but I am almost positive that is true.

--- 10 mins later ---
yup, mana and health regen most definately don't work while the unit is paused.
 
Level 6
Joined
Sep 5, 2007
Messages
264
Sh*t man! That's news to me.
HP/MANA regen DO stop when paused....
Hmmm. Now, I'm beginning to understand your problem.

You could try adding the "Cargo Hold" ability to the idle units. "Cargo Hold" makes a unit unable to attack. Then you just set movement & turning speed to 0.

If that doesn't work, you could try what Restor said... Create a duplicate of your heroes, give them no attack, no movement speed, no turning speed. Then just swap between the two, making sure that abilities, health, mana, etc. are all transferred aswell...

I hope that I have been my usual helpful self. :thumbs_up:
 
Level 2
Joined
Jun 15, 2007
Messages
12
In a custom script put:
call UnitRemoveAbility(GetTriggerUnit(), 'Amov')
call UnitRemoveAbility(GetTriggerUnit(), 'Abun')


First line removes move (patrol, and stop, too), and the 2nd removes attack. Change 'remove' to 'add' and it'll add the abilities again
 
Level 6
Joined
Oct 19, 2008
Messages
168
wow all you have to do is go to the units aquistion range in object editor and set it to 0 or something lol. You dont really need triggers for that.
What aqustion range is the range that a unit will aquire(autoattack) an enemy unit
 
Status
Not open for further replies.
Top