Free for all Mini game trigger help.

Murza

New Member
Reaction score
0
I've been trying to make a mini game in a small part of my map. The mini game starts when any player types -mini game.
This will create a timer and when the timer ends, each player will get one crew member at a specific location on the mini game area. It is a free for all and the players will have to kill the other players, using vendors that sells suits and bombs. The winner of the mini game receives 10,000 gold, and then the triggers are supposed to say the game is over and it removes all the created units in the area. Then it will shut off the game over trigger and turn the -mini game trigger back on. Unfortunately I cannot seem to get the game over part to work when there is one surviving unit.
Hopefully by posting my triggers, someone can find some insight into this problem that I lack. I have only been back into map making for a couple of weeks so i'm still a big noob. Help is appreciated thanks.

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 CrewMembers = (Units in Region 197 <gen>)
      • Set CrewMembers = (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False))
      • Set NumberOfCrewMembers = (Number of units in (Units in Region 197 <gen>))
      • Set NumberOfCrewMembers = (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)

---------------------------------------
Trigger:
  • Game Over
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Crew Member
    • Actions
      • Unit Group - Remove (Triggering unit) from CrewMembers
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CrewMembers) Equal to 1
          • (Point-value of Crew 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 crew member has b...

----------------------------------------------------------------
(the anti bug triggers simply make a timer that will reset the game after the amount of time has passed. I made this for now because I cannot solve the game over trigger problem.)
And the (color) yes trigger was originally made to spawn the unit for the player if they typed -yes. But I changed the trigger so it simply made the unit for all players.

Trigger:
  • Red Yes
    • Events
      • Time - Mini_game_Countdown expires
    • Conditions
    • Actions
      • Unit - Create 1 Crew Member for Player 1 (Red) at (Center of Region 186 <gen>) facing Default building facing degrees
      • Countdown Timer - Destroy Mini_game_end
      • Set CrewMember = (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)
 

TheKnight

New Member
Reaction score
1
You could do it so by making an interger variable.
At the start of the mini game, set variable - Interger = [Number of Players in Game]
Then each time a Crew dies you -1 from the variable. Once the Variable reaches 0, the Game Over trigger starts
 

LiveSsenkrad

Member
Reaction score
3
Why did you use '(Point-value of Crew Member) Equal to 1'? Maybe that is the cause of the problem?
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Please put your codes in between
wc3tag.gif
or [noparse]
Trigger:
[/noparse] tags, and do leave the spacings as it is.
 

Murza

New Member
Reaction score
0
You could do it so by making an interger variable.
At the start of the mini game, set variable - Interger = [Number of Players in Game]
Then each time a Crew dies you -1 from the variable. Once the Variable reaches 0, the Game Over trigger starts

Alright I'll try that out, thanks!




Why did you use '(Point-value of Crew Member) Equal to 1'? Maybe that is the cause of the problem?

I assumed it would represent the number of crew members left. Or at least I hoped
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
The function should be under Arithmetic.

Trigger:
  • Set YourIntegerVariable = (YourIntegerVariable - 1)
 

TomTTT

New Member
Reaction score
44
Umm.. at the trigger "Game Over", why is there Add 10,000 gold to owner of picked unit? You don't pick any unit...
 

Ayanami

칼리
Reaction score
288
Trigger:
  • Actions
    • Set CrewMembers = (Units in Region 197 <gen>)
    • Set CrewMembers = (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False))

Is there a purpose in doing this? Really could just be:

Trigger:
  • Actions
    • Set CrewMembers = (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False))


However, there's still a problem here. "Triggering unit" here is basically in existent. It should be "Matching unit".

Trigger:
  • Actions
    • Set NumberOfCrewMembers = (Number of units in (Units in Region 197 <gen>))
    • Set NumberOfCrewMembers = (Number of units in (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False)))

This could also just be:

Trigger:
  • Actions
    • Set NumberOfCrewMembers = (Number of units in (Units in Region 197 <gen> matching (((Triggering unit) is A structure) Equal to False)))


However, there's still a problem here. "Triggering unit" here is basically in existent. It should be "Matching unit".

Trigger:
  • Red Yes
    • Events
      • Time - Mini_game_Countdown expires
    • Conditions
    • Actions
      • Unit - Create 1 Crew Member for Player 1 (Red) at (Center of Region 186 <gen>) facing Default building facing degrees
      • Countdown Timer - Destroy Mini_game_end
      • Set CrewMember = (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)

Leak a point here. Should be:

Trigger:
  • Actions
    • Set TempPoint = (Center of Region 186 <gen>)
    • Unit - Create 1 Crew Member for Player 1 (Red) at TempPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_TempPoint)


And this:

Trigger:
  • Actions
    • Set CrewMember = (Last created unit)

Does this serve any purpose later in the trigger? Doesn't really seem like it does.

Trigger:
  • Game Over
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Crew Member
    • Actions
      • Unit Group - Remove (Triggering unit) from CrewMembers
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CrewMembers) Equal to 1
          • (Point-value of Crew 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 crew member has b...

Trigger:
  • (Point-value of Crew Member) Equal to 1

When is Point-value ever mentioned in any of the triggers? o.o

Trigger:
  • Actions
    • Player - Add 10000 to (Owner of (Picked unit)) Current gold


"Picked unit" is only referred to units in a Unit Group. Should be this:

Trigger:
  • Actions
    • Unit Group - Pick every unit in CrewMembers and do (Actions)
      • Loop - Actions
        • Player - Add 10000 to (Owner of (Picked unit)) Current gold


Trigger:
  • Actions
    • Unit Group - Pick every unit in (Units in Region 197 <gen>) and do (Unit - Remove (Picked unit) from the game)

You leak a group here. Should be:

Trigger:
  • Actions
    • Set TempGroup = (Units in Region 197 <gen>)
    • Unit Group - Pick every unit in TempGroup and do (unit - Remove (Picked unit) from the game)
    • Custom script: call DestroyGroup(udg_TempGroup)


To simplify this whole trigger, basically this:

Trigger:
  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set SpawnRegion[1] = RED_SPAWN_REGION <-- Continue this until SpawnRegion[11], where the array represents the player number
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Mini Game Start <gen> the event (Player - (Picked player) types a chat message containing -Mini Game as An exact match)


Trigger:
  • Mini Game Start
    • Events
    • 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
      • Wait 10.00 seconds
      • Countdown Timer - Destroy Mini_game_end
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Center of SpawnRegion[Integer A])
          • Unit - Create 1 Crew Member for (Player(Integer A)) at TempPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to CrewMembers
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Game - Display to (All players) the text: Kill everyone in th...
      • Trigger - Turn on Game Over <gen>
      • Trigger - Turn on Anti Bug 3 <gen>
      • Trigger - Turn on Anti Bug <gen>
      • Trigger - Turn off (This trigger)


Trigger:
  • Game Over
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Crew Member
    • Actions
      • Unit Group - Remove (Triggering unit) from CrewMembers
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CrewMembers) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in CrewMembers and do (Actions)
            • Loop - Actions
              • Player - Add 10000 to (Owner of (Picked unit)) Current gold
          • Game - Display to (All players) the text: Game Over, the fina...
          • Set TempGroup = (Units in Region 197 <gen>)
          • Unit Group - Pick every unit in TempGroup and do (Unit - Remove (Picked unit) from the game)
          • Custom script: call DestroyGroup(udg_TempGroup)
          • 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 crew member has b...
 

Murza

New Member
Reaction score
0
Awesome! Thank you so much! The only problem I have is small, just all the units spawning in one region but i'm still so glad that the problem is finally fixed. Thanks again for your time!

Edit +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top