Unclickable players.

Question

New Member
Reaction score
0
How do you make player units unclickable except the one that you are controlling(and also not invunerable)
 

FoxWizzy

New Member
Reaction score
3
player() selects a unit
if/then/else ->triggering unit is an ally of Player()
then -> do nothing
else -> selection - remove triggering unit from selection


NOT TESTED
 

Lord Regno

Active Member
Reaction score
19
Well you can't, but you can do as fast someone select your unit it will be unselected.

Trigger:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
    • Conditions
    • Actions
      • Set Temp_Group = (Units currently selected by (Triggering player))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Picked unit)) Equal to (Triggering player)
                  • (Level of Invulnerable (Neutral) for (Picked unit)) Equal to 1
            • Then - Actions
            • Else - Actions
              • Selection - Remove (Picked unit) from selection for (Triggering player)
        • Custom script: call DestroyGroup(udg_Temp_Group)
 

Lord Regno

Active Member
Reaction score
19
temp_grope are a variable, click on ctrl + b and then the button +X then name it to temp_group then look after unit group. click on ok.

Then search for if/then/ells multiple actions. The first the condition you find in boolean comparison and the second one is in integer.

And my trigger leaks...
Put this under pick every in unit group, see above I edit it also.

Trigger:
  • Custom script: call DestroyGroup(udg_Temp_Group)


Edit here is more about leaks: http://www.thehelper.net/forums/showthread.php?t=27219&highlight=memory+leak
 

GenDeath

New Member
Reaction score
6
Actually its really easy to make a unit unselectable, w/o triggers you add an ability to them called locust.
(I believe they become excluded in triggers ie pick all units . . .)
 

canons200

New Member
Reaction score
50
yup, locust unit can't be found in "range" or in"region" trigger, but yet you can still using the action, pick every unit (unit owned by player matching condtion) to pick up the locust unit.
 

Shura

New Member
Reaction score
45
Locust would make them untargetable, so units wouldn't be able to attack them. They can still be hit by AoE abilities. Also, locust would make it so that even the owner of the unit couldn't click it.
 

Azlier

Old World Ghost
Reaction score
461
There's really no easy way to do it. You can have two units, one invisible to enemies but selectable. The other has Locust and is only visible to enemies. You have to keep the units on top of eachother at all times, doing the same animations. You don't have to sync stand animations or anything, though. Lots of work to pull off.
 

Question

New Member
Reaction score
0
but i saw in a map that u can do it.it was the escape maps by kill3rbeast in hive

the selection circle is always on you
 

Lord Regno

Active Member
Reaction score
19
Explain better next time:

Trigger:
  • Select
    • Events
      • Player - Player 1 (Red) Deselects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to "Unit"
    • Actions
      • Selection - Clear selection
      • Selection - Select (Triggering unit)


This will almost have the circel on you all the time
 

Azlier

Old World Ghost
Reaction score
461
Better to periodically deselect all units that are not the specified unit. That event has some delay, especially online.
 

Lord Regno

Active Member
Reaction score
19
right...

Trigger:
  • Select periodic time
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units of type "Unit")
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is selected by (Owner of (Picked unit))) Equal to True
            • Then - Actions
            • Else - Actions
              • Selection - Clear selection for (Owner of (Picked unit))
              • Selection - Select (Picked unit)
      • Custom script: call DestroyGroup (udg_Temp_Group)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top