• 🏆 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!

Hi , what's wrong with my Trigger

Status
Not open for further replies.
Level 6
Joined
Mar 9, 2009
Messages
175
There you Go my triggers :

  • Game
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map) owned by Player 4 (Purple)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Picked unit) is dead) Equal to True
            • Then - Actions
              • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
              • Game - Defeat Player 4 (Purple) with the message: Defeat!
            • Else - Actions
              • Do nothing


I wan all footman die then win , why become a footman die equal to win?
help me please

Thanks !
~:grin:
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Try this:

  • Trigger
    • Events
      • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set Count = 0
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 4 (Purple) of type Footman) and do (Actions)
        • Loop - Actions
          • Set Count = (Count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count Equal to 0
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
        • Else - Actions
The Count variable is an integer.
 
Level 7
Joined
Apr 30, 2011
Messages
359
for more complex use, use these 3 . .
it will calculate newly created units as well . . .
note that this only applied to Player 4's units . . .
if you want one that applies to all players just ask ^_^

  • Trigger1
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 4 (Purple)) and do (Actions)
        • Loop - Actions
          • Set MaxUnit = (MaxUnit + 1)
  • Trigger2
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Owner of (Entering Unit)) Equal to Player 4 (Purple)
    • Actions
      • Set MaxUnit = (MaxUnit + 1)
  • Trigger3
    • Events
      • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
    • Actions
      • Set Count = (Count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count Equal to MaxUnit
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
        • Else - Actions
 
Last edited:
Level 4
Joined
Oct 20, 2011
Messages
129
Another choice:

  • Events
    • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to Player 4 (Purple)) and (((Unit-type of (Matching unit)) Equal to Footman) and (((Matching unit) is alive) Equal to True))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 0
        • Then - Actions
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Level 7
Joined
Apr 30, 2011
Messages
359
@Dragon:
better ~.~
i didn't think that xD

and i didn't know that MrBean's trigger just do the same . . . .
stupid me~
but MrBean's are better than Dragon's
 
Level 6
Joined
Mar 9, 2009
Messages
175
oh I see , haha its okay .

Hey guys , if I would like to add one more type of unit can ?


Edited **
Why Mr Bean trigger doesn't work @@??
 
Level 4
Joined
Oct 20, 2011
Messages
129
  • Unit Group - Pick every unit in ((Units owned by Player 4 (Purple) of type Footman) and ((Matching unit) is alive) Equal to True)) and do (Actions)
    • Loop - Actions
      • Set Count = (Count + 1)
Edit: If you want to make one more, you can duplicate the trigger. But if you want to have a lot more, create a unit type-array-variable then set at the start game:
  • Set UnitType[1] = Footman
  • Set UnitType[2] = Sorcerer
Then
  • For each Integer A from 1 to x do
    • Loop - Action
      • Set Count = 0
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in ((Units owned by Player 4 (Purple) of type UnitType[Integer A]) and ((Matching unit) is alive) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set Count = (Count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count Equal to 0
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
        • Else - Actions
 
Level 6
Joined
Mar 9, 2009
Messages
175
why I cannot get your trigger = =??
  • Unit Group - Pick every unit in ((Units owned by Player 4 (Purple) of type Footman) and ((Matching unit) is alive) Equal to True)) and do (Actions)
    • Loop - Actions
      • Set Count = (Count + 1)
 
Level 7
Joined
Apr 30, 2011
Messages
359
if it's still do nothing, then . . . .
(i guess) the unit that dies still considered as an 'alive' unit . . .
so, my trigger will work . . . .

it's only a guess . . . .
 
Level 4
Joined
Oct 20, 2011
Messages
129
if it's still do nothing, then . . . .
(i guess) the unit that dies still considered as an 'alive' unit . . .
so, my trigger will work . . . .

it's only a guess . . . .

  • Unit Group - Pick every unit in (Units owned by Player 4 (Purple) of type Footman) and do (Actions)
Dead Footman still picked by this trigger.
 
Level 6
Joined
Mar 9, 2009
Messages
175
@overlord : you sure your trigger will work ??
@dragon : your Unit Group - Pick every unit in ((Units owned by Player 4 (Purple) of type Footman) and ((Matching unit) is alive) Equal to True)) and do (Actions) i cannot even found .
 
Level 7
Joined
Apr 30, 2011
Messages
359
lol~
i'm really stupid . . . . . .
that's why MrBean's trigger doesn't work

my trigger will work, but not that effective -.-
but there's pros with it . . . .
there will be no bugs with it . . .

but you should use MrBean's (with Dragon's edit)

note:
i'm OVERCOLD_ice
 
Level 4
Joined
Oct 20, 2011
Messages
129
@overlord : you sure your trigger will work ??
@dragon : your Unit Group - Pick every unit in ((Units owned by Player 4 (Purple) of type Footman) and ((Matching unit) is alive) Equal to True)) and do (Actions) i cannot even found .

Oh sorry. I typed it without open world editor.

  • Unit Group - Pick every unit in (Units owned by Player 4 (Purple) matching (((Unit-type of (Matching unit)) Equal to Footman) and (((Matching unit) is alive) Equal to True))) and do (Actions)
    • Loop - Actions
A little long. I'll upload it for you.
http://www.hiveworkshop.com/forums/attachment.php?attachmentid=110217&stc=1&d=1326972935
 

Attachments

  • asdasd.w3x
    15.6 KB · Views: 70
Level 6
Joined
Mar 9, 2009
Messages
175
  • Game
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
    • Actions
      • Set Count = 0
      • Set Unit[4] = Villager1
      • Set Unit[5] = Villager2
      • Set Unit[6] = Villager3
      • Set Unit[7] = Villager4
      • Set Unit[8] = Villager5
      • Set Unit[9] = Villager6
      • Set Unit[10] = Villager7
      • Set Unit[11] = Villager8
      • Set Unit[12] = Villager9
      • Set Unit[13] = Villager10
      • Set Unit[14] = Villager11
      • Set Unit[15] = Villager12
      • Set Unit[16] = Villager13
      • Set Unit[17] = Villager14
      • Set Unit[18] = Villager15
      • Set Unit[19] = King Of Villager
      • Custom script: set bj_wantDestroyGroup = true
      • For each (Integer A) from 4 to 19, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by Player 2 (Blue) matching (((Unit-type of (Matching unit)) Equal to Unit[(Integer A)]) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Set Count = (Count + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Count Equal to 0
            • Then - Actions
              • Game - Display to (All players) the text: Capella Called Game
              • Wait 2.00 seconds
              • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
              • Game - Defeat Player 4 (Purple) with the message: Defeat!
            • Else - Actions

Oh my god what happen to my trigger , there are some bug I haven't kill all of them I have won already @@ !!

help me !!
 
Level 7
Joined
Apr 30, 2011
Messages
359
please describe your bug more . . .

i guess you have killed all of player blue's units of TYPE VillagerX, or King of Villager

is that right?
 
Level 6
Joined
Mar 9, 2009
Messages
175
The bug happen when i just started the game then I won already .

I wan is kill all VillagerX and King Of Villager then win .

@mr bean : ok I will place the set bj_wantDestroyGroup = true line directly above the Unit Group - Pick all... line.
 
Level 7
Joined
Apr 30, 2011
Messages
359
  • Game
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
    • Actions
      • Set Count = 0
      • Set Unit[4] = Villager1
      • Set Unit[5] = Villager2
      • Set Unit[6] = Villager3
      • Set Unit[7] = Villager4
      • Set Unit[8] = Villager5
      • Set Unit[9] = Villager6
      • Set Unit[10] = Villager7
      • Set Unit[11] = Villager8
      • Set Unit[12] = Villager9
      • Set Unit[13] = Villager10
      • Set Unit[14] = Villager11
      • Set Unit[15] = Villager12
      • Set Unit[16] = Villager13
      • Set Unit[17] = Villager14
      • Set Unit[18] = Villager15
      • Set Unit[19] = King Of Villager
      • Custom script: set bj_wantDestroyGroup = true
      • For each (Integer A) from 4 to 19, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by Player 2 (Blue) matching (((Unit-type of (Matching unit)) Equal to Unit[(Integer A)]) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Set Count = (Count + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Count Equal to 0
            • Then - Actions
              • Game - Display to (All players) the text: Capella Called Game
              • Wait 2.00 seconds
              • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
              • Game - Defeat Player 4 (Purple) with the message: Defeat!
            • Else - Actions

Oh my god what happen to my trigger , there are some bug I haven't kill all of them I have won already @@ !!

help me !!

what you need to fix:
1. your other triggers, especially ones that runs on Map Initialization
2. that trigger should be like this . . .

  • Game
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
    • Actions
      • Set Count = 0
      • Set Unit[4] = Villager1
      • Set Unit[5] = Villager2
      • Set Unit[6] = Villager3
      • Set Unit[7] = Villager4
      • Set Unit[8] = Villager5
      • Set Unit[9] = Villager6
      • Set Unit[10] = Villager7
      • Set Unit[11] = Villager8
      • Set Unit[12] = Villager9
      • Set Unit[13] = Villager10
      • Set Unit[14] = Villager11
      • Set Unit[15] = Villager12
      • Set Unit[16] = Villager13
      • Set Unit[17] = Villager14
      • Set Unit[18] = Villager15
      • Set Unit[19] = King Of Villager
      • For each (Integer A) from 4 to 19, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by Player 2 (Blue) matching (((Unit-type of (Matching unit)) Equal to Unit[(Integer A)]) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Set Count = (Count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: Capella Called Game
          • Wait 2.00 seconds
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
        • Else - Actions
 
Level 6
Joined
Mar 9, 2009
Messages
175
Still have bug , just play 1minute then Victory already - -.
I thought is wait All the villagerX and King Of Villager all die then victory .??
 
Level 6
Joined
Mar 9, 2009
Messages
175
Oh so sorry , i forget see the line :
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Count Equal to 0
Then - Actions
Game - Display to (All players) the text: Capella Called Game
Wait 2.00 seconds
Game - Victory Player 1 (Red) (Show dialogs, Show scores)
Game - Defeat Player 4 (Purple) with the message: Defeat!
Else - Actions
 
Status
Not open for further replies.
Top