• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger does not turn on

Status
Not open for further replies.
Level 2
Joined
Jul 19, 2009
Messages
15
As i say, i have a problem with a trigger...both triggers does not turn on (enemy wave 1 and order wave to atack). Why? I have other triggers like this one and some of them works, some doesn't, and if i put trigger - run trigger checking/ignoring conditions it works.
  • Events
    • Time - Elapsed game time is 1.00 seconds
  • Conditions
  • Actions
    • For each (Integer A) from 1 to (nr_hero - 1), do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (labirint <gen> contains hero[(Integer A)]) Equal to True
          • Then - Actions
            • Unit Group - Add hero[(Integer A)] to grup_regiune[1]
            • Set alege_regiune[alege_regiune_integer] = (alege_regiune[alege_regiune_integer] + 1)
          • Else - Actions
    • Set alege_regiune_integer = (alege_regiune_integer + 1)
    • For each (Integer A) from 1 to (nr_hero - 1), do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (pod <gen> contains hero[(Integer A)]) Equal to True
          • Then - Actions
            • Unit Group - Add hero[(Integer A)] to grup_regiune[2]
            • Set alege_regiune[alege_regiune_integer] = (alege_regiune[alege_regiune_integer] + 1)
          • Else - Actions
    • Set alege_regiune_integer = (alege_regiune_integer + 1)
    • For each (Integer A) from 1 to (nr_hero - 1), do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (sant cu apa <gen> contains hero[(Integer A)]) Equal to True
          • Then - Actions
            • Unit Group - Add hero[(Integer A)] to grup_regiune[3]
            • Set alege_regiune[alege_regiune_integer] = (alege_regiune[alege_regiune_integer] + 1)
          • Else - Actions
    • Set alege_regiune_integer = (alege_regiune_integer + 1)
    • For each (Integer A) from 1 to (nr_hero - 1), do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (sant fara apa <gen> contains hero[(Integer A)]) Equal to True
          • Then - Actions
            • Unit Group - Add hero[(Integer A)] to grup_regiune[4]
            • Set alege_regiune[alege_regiune_integer] = (alege_regiune[alege_regiune_integer] + 1)
          • Else - Actions
    • Set alege_regiune_integer = (alege_regiune_integer + 1)
    • For each (Integer A) from 1 to (nr_hero - 1), do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (deasuprea sant fara apa <gen> contains hero[(Integer A)]) Equal to True
          • Then - Actions
            • Unit Group - Add hero[(Integer A)] to grup_regiune[5]
            • Set alege_regiune[alege_regiune_integer] = (alege_regiune[alege_regiune_integer] + 1)
          • Else - Actions
    • Set alege_regiune_integer = (Max(alege_regiune[1], (Max(alege_regiune[2], (Max(alege_regiune[3], (Max(alege_regiune[4], alege_regiune[5]))))))))
    • Trigger - Turn on enemy wave 1 <gen>
    • Wait 2.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • alege_regiune_integer Equal to 1
      • Then - Actions
        • Set unit_atack = (Random unit from grup_regiune[1])
        • Set position_x_unit_to_atack = (Position of unit_atack)
        • Set grup_regiune_integer = 1
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • alege_regiune_integer Equal to 2
      • Then - Actions
        • Set unit_atack = (Random unit from grup_regiune[2])
        • Set position_x_unit_to_atack = (Position of unit_atack)
        • Set grup_regiune_integer = 2
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • alege_regiune_integer Equal to 3
      • Then - Actions
        • Set unit_atack = (Random unit from grup_regiune[3])
        • Set position_x_unit_to_atack = (Position of unit_atack)
        • Set grup_regiune_integer = 3
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • alege_regiune_integer Equal to 4
      • Then - Actions
        • Set unit_atack = (Random unit from grup_regiune[4])
        • Set position_x_unit_to_atack = (Position of unit_atack)
        • Set grup_regiune_integer = 4
      • Else - Actions
    • Trigger - Turn on order wave to atack <gen>
 
Last edited:

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Why do you use event response - picked unit, if its a response for Action - Pick every unit in group and do actions.
I also don't see how you want to call given unit, either use variable or use action i mentioned above about picking units in unit group to get right responce in Unit Group - Add (Picked unit) to grup_regiune[1] place.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • alege_regiune_integer Equal to 1
    • Then - Actions
      • Set unit_atack = (Random unit from grup_regiune[4])
      • Set position_x_unit_to_atack = (Position of unit_atack)
      • Set grup_regiune_integer = 4
    • Else - Actions
I don't get why condition on last if/then/else is alege_regiune_integer Equal to 1. Shouldnt that be 4 instead?
 
Level 2
Joined
Jul 19, 2009
Messages
15
Spinnaker you are right about what you said. I didn't finish the trigger because lines with
trigger - turn on trigger does not work. I will edit the thread :D
Should i change picked unit with triggering unit?
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
You cant reffer to Triggering unit, because as i said you dont have proper Event, right now its Time event.
Only events that are about units enables you to refer to given unit via eg. triggering unit.
I would recomend setting units you want to add to those groups as variables, and then use actions Add variable_your_unit to your_unit_group.
 
Level 2
Joined
Jul 19, 2009
Messages
15
done with unit group..now i still haven't got an answer for the problems with TRIGGER - TURN ON TRIGGER (why it doesn't work)
 
Level 2
Joined
Jul 19, 2009
Messages
15
Enemy wave 1
  • Events
    • Time - Elapsed game time is 1.00 seconds
  • Conditions
  • Actions
    • For each (Integer A) from 1 to (nr_hero - 1), do (Actions)
      • Loop - Actions
        • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Region 056 <gen>) facing Default building facing degrees
        • Unit Group - Add (Last created unit) to wave
        • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Region 056 <gen>) facing Default building facing degrees
        • Unit Group - Add (Last created unit) to wave
        • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Region 056 <gen>) facing Default building facing degrees
        • Unit Group - Add (Last created unit) to wave
        • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Region 056 <gen>) facing Default building facing degrees
        • Unit Group - Add (Last created unit) to wave
        • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Region 056 <gen>) facing Default building facing degrees
        • Unit Group - Add (Last created unit) to wave
    • Multiboard - Set the text for multiboard[1] item in column 5, row 2 to (String(((nr_hero - 1) x 5)))
    • Set creeps = ((nr_hero - 1) x 5)

variable "nr_hero" is number of heroes, it is set by default 1 (i need it somewhere else so i set it 1), and if a player pick a hero it will become 2

Order wave to atack

  • Events
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in wave and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack-Move To position_x_unit_to_atack
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (unit_atack is dead) Equal to True
      • Then - Actions
        • Trigger - Run regiune de atacat <gen> (checking conditions)
      • Else - Actions
Trigger "regiune de atacat" is the first trigger that i post (the one with problems)
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Order wave to atack

  • Events
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in wave and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack-Move To position_x_unit_to_atack
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (unit_atack is dead) Equal to True
      • Then - Actions
        • Trigger - Run regiune de atacat <gen> (checking conditions)
      • Else - Actions
Trigger "regiune de atacat" is the first trigger that i post (the one with problems)

position_x_unit_to_atack is not set, or i missed it in other trigger. Run all triggers without checking conditions.
You got a lot of leaks.
Use: [Custom Script set bj_wantDestroyGroup = true] before each case with creating unit groups.
Use: [Custom Script call RemoveLocation (udg_Your_location)] after using created point.
 
Status
Not open for further replies.
Top