• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] IS there a way to make one of your units uncontrollable?

Status
Not open for further replies.
Level 14
Joined
Jun 27, 2008
Messages
1,325
You can add the Locust ability to the unit. As a result its not targetable, not selectable etc.

call UnitAddAbility(u, 'Aloc')

(You cannot directly add Aloc via GUI Trigger, you have to do it with a customscript)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Trigger

  • Remove Locusr Copy 2
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set u = (Random unit from (Units currently selected by Player 1 (Red)))
      • Custom script: call UnitAddAbility(udg_u, 'Aloc')
      • Custom script: call UnitRemoveAbility(udg_u, 'Aloc')
      • Unit - Add Bear Form to u
      • Unit - Order u to Night Elf Druid Of The Claw - Bear Form
      • Unit - Remove Bear Form from u
      • Wait 5.00 seconds
      • Unit - Hide u
      • Unit - Unhide u
The locust and bear form things make it unselectable and players can not target it. It can be damaged and auto attacked. Hiding/unhiding restores it back to normal. Use Metamorphosis for heroes.
 
Trigger

  • Remove Locusr Copy 2
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set u = (Random unit from (Units currently selected by Player 1 (Red)))
      • Custom script: call UnitAddAbility(udg_u, 'Aloc')
      • Custom script: call UnitRemoveAbility(udg_u, 'Aloc')
      • Unit - Add Bear Form to u
      • Unit - Order u to Night Elf Druid Of The Claw - Bear Form
      • Unit - Remove Bear Form from u
      • Wait 5.00 seconds
      • Unit - Hide u
      • Unit - Unhide u
The locust and bear form things make it unselectable and players can not target it. It can be damaged and auto attacked. Hiding/unhiding restores it back to normal. Use Metamorphosis for heroes.

If I put player selection event, when clicked on the unit there is 0.50 or sort of pause before the deselection trigger so I can order him to go anywhere, isn't this right?
 
Level 2
Joined
Jan 23, 2014
Messages
14
i had same problem like you, this worked for me i hope do for you too

[
  • Events
  • DisablePlayers
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Ordered unit)) equal Your_unit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Not equal to 1
        • Then - Actions
          • Unit - Set the custom value of (Triggering unit) to 1
          • Unit - Order (Triggering unit) to What_Ever_You_Want_Maybe_Donothing
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Set the custom value of (Triggering unit) to 0
        • Else - Actions
i used the Custom value so i avoid infinite loops , but i think they are not necessary, not sure
 
Level 2
Joined
Jan 16, 2014
Messages
11
1. Add Locust ability
2. Pause the unit
3. Set movement speed to 0
4. Make unit Neutral Passive

Those are some ways I would use to make your unit uncontrollable.

//EDIT: Actually I think just pausing the unit is the best way to go.
 
Status
Not open for further replies.
Top