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

abilities to: retreat, advance and follow

Status
Not open for further replies.
Level 3
Joined
Jun 16, 2018
Messages
21
I started a new project, for my second map ill make "War Chasers", so conceited from my self...
Any ways, it begins in a war, a huge one and i need that when a hero cast one of the mentioned in the title abilities it picks, or some like, every unit for player 9 only in a range of the triggering unit and make the picked, or whatever, to move to certain region or to follow the hero. My last atempt was the one in the picture.
I also need to make some upgrades once a hero enters a region.
Sorry for the spanish and hope you can understand it...
 

Attachments

  • ab.png
    ab.png
    41.7 KB · Views: 137
Level 9
Joined
Apr 23, 2011
Messages
527
Use [trigger][/trigger] instead when posting GUI triggers.

When you use "Pick every unit in unit group matching condition", for the condition, you use (Picked unit), when you should use (Matching unit) instead. This should make it work.

However, the way you made the trigger seems a bit inefficient, what you should probably do is set the unit group to a variable firsthand then do the nested if checks and using the variable instead.

You should also read up on Memory Leaks as you leak points and unit groups. There are many good tutorials about it here on the Hive.
 
Level 3
Joined
Jun 16, 2018
Messages
21
Use [trigger][/trigger] instead when posting GUI triggers.

When you use "Pick every unit in unit group matching condition", for the condition, you use (Picked unit), when you should use (Matching unit) instead. This should make it work.

However, the way you made the trigger seems a bit inefficient, what you should probably do is set the unit group to a variable firsthand then do the nested if checks and using the variable instead.

You should also read up on Memory Leaks as you leak points and unit groups. There are many good tutorials about it here on the Hive.
i changed the action to matching unit but didnt render any result; actually i dont know what else to try...
 
Level 9
Joined
Apr 23, 2011
Messages
527
Like so:
  • Actions
    • Unit Group - Pick every unit...
      • Actions
        • Unit - Make...
        • If (All Conditions are True) then (Do Actions) else do (Else Actions)
          • If - Conditions
            • condition
          • Then - Actions
            • action
          • Else - Actions
            • If (All Conditions are True) then (Do Actions) else do (Else Actions)
              • If - Conditions
                • condition
              • Then - Actions
                • action
              • Else - Actions
                • etc.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You literally just need to make sure each If block is inside the Then - Actions of the next previous If. Not hard. You can Ctrl+C and Ctrl+V to move them around. Light showed you what it should look like!

Ignoring that it's not likely anyone will want to look through all of your map's triggers when you won't even try to solve this with the suggestions people have given and questions they've asked (fixing your problems for you just leads you to coming back here with no problems and no intent to solve them yourself)... nobody can check out your map if you don't post it.
 
Last edited:
Level 3
Joined
Jun 16, 2018
Messages
21
You literally just need to make sure each If block is inside the Then - Actions of the next previous If. Not hard. You can Ctrl+C and Ctrl+V to move them around. Light showed you what it should look like!

Ignoring that it's not likely anyone will want to look through all of your map's triggers when you won't even try to solve this with the suggestions people have given and questions they've asked (fixing your problems for you just leads you to coming back here with no problems and no intent to solve them yourself)... nobody can check out your map if you don't post it.
I tried with a similar triger. I picked every unit in range, and with (if owner of picked unit = player 9 issue picked unit to move to the destination) but it didnt work at all. I didnt get the lights point with that trigger, why would i want 2 ifs? there is only one owner of units that matters, 9 player. Also he said in his first commentary that using the matching unit function would be enough but then came with that trigger. Im pretty sure that its a simple request is just that is my %$&/ second map and i never tried with any ralated to programing before so i dont know how to do it.
 
Level 3
Joined
Jun 16, 2018
Messages
21
The trigger to attack is the same as the one to recede.


Attack
Acontecimientos
Unidad - A unit Comienza a lanzar una habilidad (begins to cast a spell)
Condiciones
(Ability being cast) Igual a Avanzar Comando
Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
(Triggering unit) Igual a Hero1
PosH1 Mayor que 0
PosH1 Menor que o igual a 176
Entonces: Acciones
Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
Bucle: Acciones
Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH1 + 32)])
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
(Triggering unit) Igual a Hero2
PosH2 Mayor que 0
PosH2 Menor que o igual a 176
Entonces: Acciones
Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
Bucle: Acciones
Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH2 + 32)])
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
(Triggering unit) Igual a Hero3
PosH3 Mayor que 0
PosH3 Menor que o igual a 176
Entonces: Acciones
Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
Bucle: Acciones
Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH3 + 32)])
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
(Triggering unit) Igual a Hero4
PosH4 Mayor que 0
PosH4 Menor que o igual a 176
Entonces: Acciones
Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
Bucle: Acciones
Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH4 + 32)])
Otros: Acciones




Follow
Acontecimientos
Unidad - A unit Comienza a canalizar una habilidad (begins to cast a spell)
Condiciones
(Ability being cast) Igual a Seguir Comando
Acciones
Grupo de unidad - Pick every unit in (Units within 1200.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
Bucle: Acciones
Unidad - Order (Matching unit) to Seguir (Triggering unit) (seguir = follow)
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
your trigger stuff
Please paste your trigger between [trigger][/trigger] tags next time, it's much easier to read. Unfortunately this site doesn't parse triggers in other languages so the icons don't appear properly, but it is better formatted with actual spaces.

  • Attack
    • Acontecimientos
      • Unidad - A unit Comienza a lanzar una habilidad (begins to cast a spell)
    • Condiciones
      • (Ability being cast) Igual a Avanzar Comando
    • Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Triggering unit) Igual a Hero1
          • PosH1 Mayor que 0
          • PosH1 Menor que o igual a 176
        • Entonces: Acciones
          • Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
            • Bucle: Acciones
              • Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH1 + 32)])
        • Otros: Acciones
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • (Triggering unit) Igual a Hero2
              • PosH2 Mayor que 0
              • PosH2 Menor que o igual a 176
            • Entonces: Acciones
              • Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
                • Bucle: Acciones
                  • Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH2 + 32)])
            • Otros: Acciones
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • (Triggering unit) Igual a Hero3
                  • PosH3 Mayor que 0
                  • PosH3 Menor que o igual a 176
                • Entonces: Acciones
                  • Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
                    • Bucle: Acciones
                      • Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH3 + 32)])
                • Otros: Acciones
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si: Condiciones
                      • (Triggering unit) Igual a Hero4
                      • PosH4 Mayor que 0
                      • PosH4 Menor que o igual a 176
                    • Entonces: Acciones
                      • Grupo de unidad - Pick every unit in (Units within 900.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
                        • Bucle: Acciones
                          • Unidad - Order (Matching unit) to Mover a (Random point in Regions[(PosH4 + 32)])
                    • Otros: Acciones
  • Follow
    • Acontecimientos
      • Unidad - A unit Comienza a canalizar una habilidad (begins to cast a spell)
    • Condiciones
      • (Ability being cast) Igual a Seguir Comando
    • Acciones
      • Grupo de unidad - Pick every unit in (Units within 1200.00 of (Position of (Triggering unit)) matching ((Owner of (Picked unit)) Igual a Jugador 9 (Gris))) and do (Actions)
        • Bucle: Acciones
          • Unidad - Order (Matching unit) to Seguir (Triggering unit) (seguir = follow)
Much more readable.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
As Light said back in the first reply in this thread... you are using Picked Unit where you should be using Matching Unit, and you're using Matching Unit where you should be using Picked Unit. I think all of them in both triggers are backwards. In general use this to remember:
  • Unit Group - Pick every unit in (blah blah blah MATCHING (use matching unit in here equal to true) and do (Actions)
    • Loop - Actions
      • -------- all of the units that matched above will be picked to do the stuff here, so you use Picked Unit here --------
 
Status
Not open for further replies.
Top