• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Unit Check in Region

Level 9
Joined
Mar 26, 2020
Messages
202
Most threads are region check and unit type, mine is just how many units inside.
What im trying to achieve is like... (for AI purpose since i don't know how to make a script for AI, im using GUI/trigger instead just for the unit check then attack)
-is like when there are 5 units in specific region, the units will then attack to another specified region, i want it loops like every 100 seconds, unit checking then if condition is met, trigger the attack or something like that
 
EDIT: How do you do the order building to train units? i mean where it will auto recruit like the auto-battler maps did (every 10 sec train units/queue stuff)
I recall it is done by issuing the building with the appropriate order instant, the order being that of the unit type you want to train. There may be a GUI action to help with this.

A trigger every 10 seconds would pick all such buildings and issue them with the training order. You can then have another trigger which fires when a unit finishes training and order that unit to a rally point.
 
A trigger every 10 seconds would pick all such buildings and issue them with the training order. You can then have another trigger which fires when a unit finishes training and order that unit to a rally point.
i just did that, but for some reason it's not doing the thing...
  • Clovis Prep
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
    • Actions
      • Unit - Order Barracks 0270 <gen> to train/upgrade to a Footman
or do i do unit type comp instead of player comp?
 
i just did that, but for some reason it's not doing the thing...
  • Clovis Prep
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
    • Actions
      • Unit - Order Barracks 0270 <gen> to train/upgrade to a Footman
or do i do unit type comp instead of player comp?
There is no (Triggering unit) in that context. As such it is testing if Owner of null/nil, is equal to Player(6) which is probably never going to be true/pass.

You need a unique group that you add all Barracks into. You then pick all units in that unit group and then order it to train a Footman. The trigger has no condition (always fires) but should be turned off if there are no Barracks (optimisation, saves a trigger execution when there are no barracks).
 
There is no (Triggering unit) in that context. As such it is testing if Owner of null/nil, is equal to Player(6) which is probably never going to be true/pass.

You need a unique group that you add all Barracks into. You then pick all units in that unit group and then order it to train a Footman. The trigger has no condition (always fires) but should be turned off if there are no Barracks (optimisation, saves a trigger execution when there are no barracks).
oh, your right, i just tested it with unit group and removed the condition (i really thought it needs to be conditioned) it's working now, big thanks Dr Super Good
 
EDIT2: Last thing
  • Clovis Attack
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
      • (Number of units in (Units in Clovis Attack <gen>)) Equal to 10
    • Actions
      • Unit Group - Order (Units in Clovis Attack <gen>) to Attack-Move To (Center of Battlefield <gen>)
What did go wrong?
---
EDIT3: nvm i added specific players next to number of units, its now working
 
Last edited:
There is no Triggering unit in this context at all. The Triggering unit is a reference when you use an Event including a unit.
For example "A Unit Starts the effect of an ability". The unit using the ability would then be "Triggering Unit".
There is a large tutorial here on hive which explains all the basic and mandatory things. There are other good guides too
on the tutorial section here in Hive. Things You Should Know When Using Triggers / GUI

You only need to check if there are 10 units, since your other condition is not doing anything on your trigger. And then do an If/Then/Else
Pick units in Clovis Attack Gen, if units are owned by player 6 then action order attack-move to Center of Battlefield.
 
There is no Triggering unit in this context at all. The Triggering unit is a reference when you use an Event including a unit.
For example "A Unit Starts the effect of an ability". The unit using the ability would then be "Triggering Unit".
You only need to check if there are 10 units, since your other condition is not doing anything on your trigger. And then do an If/Then/Else
Pick units in Clovis Attack Gen, if units are owned by player 6 then action order attack-move to Center of Battlefield.
what i did was this, tho there is still a bit leak where 2-3 units will stay on said region, somewhat working but not what i hoped for
  • Clovis Attack
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
      • (Number of units in (Units in Clovis Attack <gen>)) Greater than or equal to 10
    • Actions
      • Unit Group - Order (Units owned by Player 6 (Orange)) to Attack-Move To (Center of Battlefield <gen>)
so i just need to change into if/else then...got it~ thank you
There is a large tutorial here on hive which explains all the basic and mandatory things.
There are other good guides too

on the tutorial section here in Hive. Things You Should Know When Using Triggers / GUI
ohh, so there are thread for this, i didn't know that and now im kinda embarrassed with spams of asking last few weeks lol
Thank you very much DoomBlade this will definitely help me made more proper triggers in the future
 
Back
Top