unit trigger help

Gamewolf3000

Member
Reaction score
1
i want my unit to after they spawn attack-move to a destignated place without me being able to give them orders. i tried using the locust ability but then they won't attack the enemy units.

i would be really grateful for any help
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
just dont select them.

What he means is, make a trigger that has for an event - Player selects a unit. It can be a unit type if you don't have too many (don't know what the map is about). In any case, when this even occurs clear the selection of the player. That's about it.
 

TomTTT

New Member
Reaction score
44
Make a region where they spawn, and then
Trigger:
  • Unit - A unit enters REGION <gen>

Then choose the action Issue order targeting a point, and move (triggering unit) to another region you'll make. :)
Trigger:
  • Unit - Order (Triggering unit) to Attack-Move To REGION 2 <gen>

For not selecting,
If Locust is causing trouble, which i don't think it should, you can do a trigger like
Trigger:
  • Player - Player 1 (Red) Select UNIT

And the check the Actions, Selection tab.
 

Gamewolf3000

Member
Reaction score
1
ok it works now, thanks. but i found a new problem. It works for my units but when i select an opponents unit the trigger activates on it too. Is there any way to prevent this from happening, like a condition which makes the trigger apply only to units owned by me???

just one more thing. when i select an unit the trigger activates and deselects it but there is a small delay delay. even if it is very little you could use it to your own advantage. is there any way to remove the delay.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
that delay is in the event, impossible to avoid. but there are several other methods.

one would be to periodically check all units currently selected by the player, if any unit in the selection should not be able to be selected unselect it at once. you can set the periodic event to be up to 0.01 which would give the best results for functionality, a delay so short its hardly noticeable or abuseable.
drawback might be the performance. though this is the most inefficient way it still means creating many temporary unit groups periodically, iterating through them, comparing unit types, doing this for all players, etc etc, alot of work for the computer.

the other possibility might be like they did in maps like castlefight and CO. instead of unselecting the units they gave them the "ward" classification thus hiding all command buttons. then they made a trigger like this:
(Example in Pseudo-Code)
Code:
Event
 unit is issued an order
Condition
 order == "smart"
Action
 order unit to do something
the idea is that units with the classification "ward" can only be ordered to "smart" by the player (smart is the order given when you right-click something), and if this is done they instantly give the unit a new order.
this only works, however, for maps with an easy concept like castlefight and such. where the only order the creeps need to do is attack-move to the enemies base.
 

TomTTT

New Member
Reaction score
44
If you don't want to be able to select at ALL
you can do something like:
Trigger:
  • Clear Selection
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Selection - Clear selection for (Picked player))

Only delay you'll see will be the 0.05 seconds, which i don't think is noticeable.
Helped?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top