• 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.

Uncontrollable Units

Status
Not open for further replies.
Level 3
Joined
Jun 29, 2014
Messages
28
Is there someone can help me? I just want to make a maps like Castle Fight. I need some help to make a building that just i build can always train the units.( it means after one finish it train one again and happened always) Also after units have been trained, we can't controll it. But it belongs to me.:vw_wtf: Sorry for bad english (indonesian people)
 
Level 13
Joined
Mar 21, 2014
Messages
893
Or
  • Untitled Trigger 001
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Barracks) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to train/upgrade to a Footman
      • Selection - Clear selection for Player 1(Red)
Idk if i was wrong
 
Or
  • Untitled Trigger 001
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Barracks) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to train/upgrade to a Footman
      • Selection - Clear selection for Player 1(Red)
Idk if i was wrong

  • Selection - Clear selection for Player 1(Red)
Then the player will be unable to select any unit. You need to check when a unit is selected, check the type of unit in Conditions and if the Owner of (Triggering unit) Equal to Triggering player, remove triggering unit from Triggering player's selection.
 
Option 1:

To make a unit uncontrollable you can add classification to it ex: "Tauren", in the Advanced > Game Interface boxes you can change the name of "Tauren" classification to something like: "Uncontrollable Unit". Then a new trigger:

Event: Every 0.01 Seconds
Action: Pick Every Player in All Players, Pick All Units of Classification Type: "Tauren" and de-select it for the picked player, Else Do Nothing. Else Do Nothing.

Every unit that has this classification will be auto deselected every 0.01 seconds. It will be impossible to select it.
 
Option 1:

To make a unit uncontrollable you can add classification to it ex: "Tauren", in the Advanced > Game Interface boxes you can change the name of "Tauren" classification to something like: "Uncontrollable Unit". Then a new trigger:

Event: Every 0.01 Seconds
Action: Pick Every Player in All Players, Pick All Units of Classification Type: "Tauren" and de-select it for the picked player, Else Do Nothing. Else Do Nothing.

Every unit that has this classification will be auto deselected every 0.01 seconds. It will be impossible to select it.
Just a note for warning. Using 0.01 interval for periodic events is not recommended, especialy when working with UnitGroups in GUI. It's too costly.
Working with 0.03 is the common way.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Uncontrollable units.
Two ways:
  1. Intercepting and redirecting orders. Use this trigger:
    • Redirect
      • Events
        • Unit - A unit Is issued an order targeting an object
        • Unit - A unit Is issued an order targeting a point
        • Unit - A unit Is issued an order with no target
      • Conditions
      • Actions
        • Set tempLoc = (Center of Castle <gen>)
        • Unit - Order (Triggering unit) to Attack-Move To tempLoc
        • Custom script: call RemoveLocation(udg_tempLoc)
  2. There's a way of making units unselectable but still targetable by adding and removing locust a certain way. I think Vexorian at Wc3c.net did it with a summons system or similar.
    1. Add locust ability to unit
    2. Add Chaos ability to unit to morph it to another unit
    3. Remove locust ability from unit
    4. Add a different Chaos ability to unit to morph it back to its previous form (after a delay)

    Here's my trigger:
    • Summon
      • Events
        • Unit - A unit enters (Playable map area)
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Water Elemental (Level 1)
      • Actions
        • Custom script: local unit udg_TempUnit
        • Set TempUnit = (Triggering unit)
        • Custom script: call UnitAddAbilityBJ( 'Aloc', udg_TempUnit )
        • Unit - Add Chaos Blank to TempUnit
        • Custom script: call UnitRemoveAbilityBJ( 'Aloc', udg_TempUnit )
        • Wait 0.00 seconds
        • Trigger - Turn off (This trigger)
        • Unit - Add Chaos Water Elemental to TempUnit
        • Trigger - Turn on (This trigger)
    Both Chaos abilities are copied from the siege tank's chaos ability, with the tech requirement removed. The first one transforms the unit into another unit type, and the second one transforms it back.

    This makes the unit UNSELECTABLE, but still TARGETABLE. The health bar is removed.

Automatic training
Simple trigger:
  • Retrain
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to train/upgrade to a (Unit-type of (Trained unit))
Note:
When the barracks is spawned, you'll have to order it to train the soldier-type twice.
 
Last edited:
Status
Not open for further replies.
Top