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
613
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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top