• 🏆 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!

[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,240
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