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

Free for all fight Trigger

Status
Not open for further replies.
Level 2
Joined
Aug 5, 2008
Messages
24
I have made a trigger that creates a mini game at one part of the map. Once someone types -mini game it brings up a bunch of text and gives you the option to type -yes.
If you type (-yes) you are given a unit, the unit is in an area by a bunch of shops, some vendors contain suits for them and item buffs. The unit is to use its own strategy to kill the others who join this game (people who typed -yes). The trigger I am trying to create is one which awards the last survivor 10,000 gold, and then remove all the items in the mini game area.
The trigger only seems to remove all units after only one unit has been killed, and it doesn't show the Text or give the gold to the winning player.
This is what I have down so far.

Game Over
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Member
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Members) Equal to 1
Then - Actions
Player - Add 10000 to (Owner of (Picked unit)) Current gold
Else - Actions
Game - Display to (All players) the text: Game Over, the fina...
Unit Group - Pick every unit in (Units in Region 197 <gen>) and do (Unit - Remove (Picked unit) from the game)
Trigger - Turn on Mini Game Start <gen>

I am still very inexperienced with triggers, help would be appreciated <3
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
First of all,when posting triggers,put the trigger text into
  • trigger text here[/trigge r] (no space)
  • And for your problem,you need to change it to this:
  • [TRIGGER]Game Over
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Member
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in Members) Equal to 1
    • Then - Actions
      • Player - Add 10000 to (Owner of (Picked unit)) Current gold
      • Game - Display to (All players) the text: Game Over, the fina...
      • Custom script: call set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in Region 197 <gen>) and do (Unit - Remove (Picked unit) from the game)
      • Trigger - Turn on Mini Game Start <gen>
    • Else - Actions
...because functions bellow 'Else' are executed if the condition is false.
Also i've put the
  • Custom script: call set bj_wantDestroyGroup = true
function above unit group enumeration to prevent leak.
 
Last edited:
Level 2
Joined
Aug 5, 2008
Messages
24
Thanks, didn't notice the else part, thought they were both regular action markers for some reason...
Problems i'm still having though are:
The custom script I copied exactly and pasted it, when I tried to test the map though it had a ton of lag and said there was an error with the trigger that I posted it in.
Second problem... the mini game still will not end even with the last man standing. Perhaps its because I give the option for units to wear suits (suits have bear form ability that transforms them into the suit unit)?



Here is what I have now:
  • Game Over
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Crew Member
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Members) Equal to 1
          • (Point-value of Member) Equal to 1
        • Then - Actions
          • Player - Add 10000 to (Owner of (Picked unit)) Current gold
          • Game - Display to (All players) the text: Game Over, the fina...
          • Unit Group - Pick every unit in (Units in Region 197 <gen>) and do (Unit - Remove (Picked unit) from the game)
          • Trigger - Turn on Mini Game Start <gen>
          • Trigger - Turn off Anti Bug <gen>
          • Trigger - Turn off Anti Bug 2 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (All players) the text: A member has b...
 
Level 9
Joined
Jun 7, 2008
Messages
440
Another couple things:

1)What is with the point-value of member = 1

2)The winning player will not receive gold.

3)What editor are you using (I had this problem when I had WEU)?
 
Level 2
Joined
Aug 5, 2008
Messages
24
Another couple things:

1)What is with the point-value of member = 1

2)The winning player will not receive gold.

3)What editor are you using (I had this problem when I had WEU)?

1. Well I hope the point-value=number of members alive

2. ?

3. Using the standard warcraft world editor
 
Level 2
Joined
Aug 5, 2008
Messages
24
P.s. still not working >_<
No change in the game...
Only solution I have so far is a trigger that creates a timer at the start of every game which ends in 20 minutes. When the timer expires it resets everything Lol. Would prefer to have the game over trigger working though.
 
Level 2
Joined
Aug 5, 2008
Messages
24
To add more insight into this trigger.. i'll show the other triggers connected to the game over trigger. First off the Mini game start trigger:
  • Mini Game Start
    • Events
      • Player - Player 1 (Red) types a chat message containing -Mini Game as An exact match
      • Player - Player 2 (Blue) types a chat message containing -Mini Game as An exact match
      • Player - Player 3 (Teal) types a chat message containing -Mini Game as An exact match
      • Player - Player 4 (Purple) types a chat message containing -Mini Game as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -Mini Game as An exact match
      • Player - Player 6 (Orange) types a chat message containing -Mini Game as An exact match
      • Player - Player 7 (Green) types a chat message containing -Mini Game as An exact match
      • Player - Player 8 (Pink) types a chat message containing -Mini Game as An exact match
      • Player - Player 9 (Gray) types a chat message containing -Mini Game as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -Mini Game as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -Mini Game as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) the text: The Mini Game has b...
      • Countdown Timer - Create a timer window for Mini_game_Countdown with title Mini Game Starts in...
      • Countdown Timer - Start Mini_game_Countdown as a One-shot timer that will expire in 10.00 seconds
      • Trigger - Turn on Red Yes <gen>
      • Trigger - Turn on Blue Yes <gen>
      • Trigger - Turn on Teal Yes <gen>
      • Trigger - Turn on Purple Yes <gen>
      • Trigger - Turn on Yellow Yes <gen>
      • Trigger - Turn on Orange Yes <gen>
      • Trigger - Turn on Green Yes <gen>
      • Trigger - Turn on Pink Yes <gen>
      • Trigger - Turn on Gray Yes <gen>
      • Trigger - Turn on Light Blue YEs <gen>
      • Trigger - Turn on Dark Green Yes <gen>
      • Set Members = (Units in Region 197 <gen>)
      • Set Members = (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False))
      • Set NumberOfMembers = (Number of units in (Units in Region 197 <gen>))
      • Set NumberOfMembers = (Number of units in (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False)))
      • Trigger - Turn on Game Over <gen>
      • Trigger - Turn on Anti Bug 3 <gen>
      • Trigger - Turn on Anti Bug <gen>
      • Trigger - Turn off (This trigger)
and the (color) yes trigger consists of:
  • Red Yes
    • Events
      • Time - Mini_game_Countdown expires
    • Conditions
    • Actions
      • Unit - Create 1 Member for Player 1 (Red) at (Center of Region 186 <gen>) facing Default building facing degrees
      • Set Member = (Last created unit)
      • Game - Display to Player Group - Player 1 (Red) the text: Kill everyone in th...
      • Wait 120.00 seconds
      • Trigger - Turn off (This trigger)
and the anti bug triggers are set for now because I dont know any other way to turn off the trigger without someone being able to abuse the system. So the games will have a 20 minute timer until they end.
 
Level 9
Joined
Jun 7, 2008
Messages
440
First off. You dont need two constricting Variables. Just calling them once will be sufficient.
  • Actions
    • Set Members = (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False))
    • Set NumberOfMembers = (Number of units in (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False)))
Another thing. You dont need to turn off the trigger.
Add a boolean to make the mini-game available/unavailable.
For instance: Use your trigger you have, add the condition:

  • Conditions
    • [YOUR VARIABLE] equal to false
In your actions set it to true. That way it cannot be abused
until the minigame is over and is once again set to false.
You can also use this for your other trigger and condense it into one.

For instance:


  • Events
    • Player 1 (red) types -yes as an exact match
    • Player 2 (blue) types -yes as an exact match
    • Player 3 (teal) types -yes as an exact match
    • // etc etc. for however many players.
  • Conditions
    • [YOUR VARIABLE] equal to true
  • Actions
    • Unit - Create 1 Member for (Triggering Player) at (Center of Region 186 <gen>) facing Default building facing degrees // (This leaks a location by the way. I swapped Player 1 (red) for Triggering player as you have more players)
    • Game - Display to (Player Group(Triggering Player)) the text: Kill everyone in th... // (This also leaks)
    • Wait 120.00 seconds
Im assuming you havent posted the entire trigger, as the variable 'member' is useless in this part.

Now, to what your looking for -

You need to have a condition checking if theirs a number of players left in unit group less than 2.
MAKE SURE - you set the group back to 0 at the end of each mini - game.

  • Events
    • Unit - A unit Dies
  • Conditions
    • (dying unit) is in Members equal to True (and to further pinpoint the dying units incase you use this variable over:)
    • (Region 186) contains (triggering unit)
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in Members) Less than 2
      • (Point-value of Member) Equal to 1 (This isnt needed)
    • Then - Actions
      • Player - Add 10000 to (Owner of (Picked unit)) Current gold (Change owner of picked unit to - (Owner of(Triggering Unit))
      • Game - Display to (All players) the text: Game Over, the fina...
      • Unit Group - Pick every unit in (Units in Region 197 <gen>) and do (Unit - Remove (Picked unit) from the game)
      • Trigger - Turn on Mini Game Start <gen> (swap this and make it
      • Set [YOUR VARIABLE] = false)
      • Trigger - Turn off Anti Bug <gen>
      • Trigger - Turn off Anti Bug 2 <gen>
      • Trigger - Turn off (This trigger) (shouldn't need to turn this off, unless that particular region contains more than one event)
    • Else - Actions
      • Game - Display to (All players) the text: A member has b...
I think I have helped you as much as needed. If not, you can pm me and we can go over it further, Sorry, I have to go :goblin_boom:
 
Status
Not open for further replies.
Top