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

Easy Trigger Request

Status
Not open for further replies.
Level 3
Joined
Jun 1, 2013
Messages
47
Easy Trigger Request - @ all professionals: PLZ HELP !!

Hello, I just have 2 little trigger requests. Id be very thankful if anyone can take some time to build them together and upload an empty map with them.

Map Info: There are 2 teams à 3 players (Player 1-3 and Player 4-6)

1) I want when any of them leaves, his gold is devided among the other allys

// only the ones still in game
// when a player leaves his buildings and units remain in game (set up by me)


This is my trigger for what happens when a player leaves (in case this is not necessary for you, just ignore it)

  • Spieler 1 leaves
    • Ereignisse
      • Spieler - Spieler 1 (Rot) leaves the game
    • Bedingungen
      • PlayerAlive[1] Gleich True
    • Aktionen
      • Spiel - Display to (All players) the text: ((Name of (Triggering player)) + hat das Spiel verlassen!)
      • Set PlayerLeft[1] = True
      • Spielergruppe - Pick every player in (All allies of (Triggering player)) and do (Actions)
        • Schleifen - Aktionen
          • Spieler - For (Triggering player), turn Gemeinsame Einheiten Ein toward (Picked player)
          • Spieler - For (Triggering player), turn Komplett gemeinsame Einheiten Ein toward (Picked player)
      • Auslöser - Run SiegNiederlage <gen> (checking conditions)
2) When any HQ gets destroyed (no matter if that player already left or not), the other remaining allys get his income / sec added (standard is 2g / sec, so if one player leaves, the other 2 would get in total 3g / sec)

This is what happens when a HQ is destroyed
  • Spieler 1 HQ vernichtet
    • Ereignisse
      • Einheit - |cFF008080Rebels Keep |r 0016 <gen> Stirbt
    • Bedingungen
    • Aktionen
      • Set PlayerAlive[1] = False
      • Einheitengruppe - Pick every unit in (Units in Rot <gen>) and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Explode (Picked unit)
      • Einheitengruppe - Pick every unit in (Units in Rot2 <gen>) and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Explode (Picked unit)
      • Einheitengruppe - Pick every unit in (Units in (Playable map area) owned by Spieler 1 (Rot)) and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Remove (Picked unit) from the game
      • Spiel - Defeat Spieler 1 (Rot) with the message: Niederlage!
      • Spiel - Display to (All players) the text: ((Name of Spieler 1 (Rot)) + wurde besiegt!)
      • Auslöser - Run SiegNiederlage <gen> (checking conditions)

This is the income trigger
  • Gold pro Sekunde
    • Ereignisse
      • Zeit - Every 1.00 seconds of game time
    • Bedingungen
    • Aktionen
      • Spieler - Add 2 to Spieler 1 (Rot) Aktuelles Gold
      • Spieler - Add 2 to Spieler 3 (Blaugrau) Aktuelles Gold
      • Spieler - Add 2 to Spieler 4 (Lila) Aktuelles Gold
      • Spieler - Add 2 to Spieler 5 (Gelb) Aktuelles Gold
      • Spieler - Add 2 to Spieler 2 (Blau) Aktuelles Gold
      • Spieler - Add 2 to Spieler 6 (Orange) Aktuelles Gold
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
Your 2nd request is a little confusing, but I think this is how I would do the first one... I literally wrote it out in this little box, so I'm not sure if it will work :D
  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set playerColor[1] = |c00FF0303
      • Set playerColor[2] = |c000042FF
      • Set playerColor[3] = |c001CE6B9
      • Set playerColor[4] = |c00540081
      • Set playerColor[5] = |c00FFFC01
      • Set playerColor[6] = |c00FEBA0E
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Set tempInt = (Player number of leavingPlayer)
          • Set playerName[tempInt] = (Name of tempPlayer)
  • Player Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
    • Conditions
    • Actions
      • Set leavingPlayer = (Triggering player)
      • Set tempInt = (Player number of leavingPlayer)
      • Game - Display to (All players) the text: (playerName[tempInt] + has left the game!)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer is an ally of leavingPlayer) Equal to True
              • (tempPlayer slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add tempPlayer to tempPlayerGroup
              • Set numberOfAlly = (numberOfAlly + 1)
            • Else - Actions
      • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
      • Player Group - Pick every player in tempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Player - Add tempInt to tempPlayer Current gold
          • Player Group - Remove tempPlayer from tempPlayerGroup
          • Set numberOfAlly = (numberOfAlly - 1)
 
Level 3
Joined
Jun 1, 2013
Messages
47
Your 2nd request is a little confusing, but I think this is how I would do the first one... I literally wrote it out in this little box, so I'm not sure if it will work :D
  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set playerColor[1] = |c00FF0303
      • Set playerColor[2] = |c000042FF
      • Set playerColor[3] = |c001CE6B9
      • Set playerColor[4] = |c00540081
      • Set playerColor[5] = |c00FFFC01
      • Set playerColor[6] = |c00FEBA0E
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Set tempInt = (Player number of leavingPlayer)
          • Set playerName[tempInt] = (Name of tempPlayer)
  • Player Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
    • Conditions
    • Actions
      • Set leavingPlayer = (Triggering player)
      • Set tempInt = (Player number of leavingPlayer)
      • Game - Display to (All players) the text: (playerName[tempInt] + has left the game!)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer is an ally of leavingPlayer) Equal to True
              • (tempPlayer slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add tempPlayer to tempPlayerGroup
              • Set numberOfAlly = (numberOfAlly + 1)
            • Else - Actions
      • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
      • Player Group - Pick every player in tempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Player - Add tempInt to tempPlayer Current gold
          • Player Group - Remove tempPlayer from tempPlayerGroup
          • Set numberOfAlly = (numberOfAlly - 1)

I dont think this trigger does anything close to what I need. The gold needs to be divided amont the other allys. You neither defined the teams nor the gold divide, have you?

Could you plz correct that or maybe anyone else who could help me with this? This aint a very hard request is it? :D
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
I dont think this trigger does anything close to what I need. The gold needs to be divided amont the other allys. You neither defined the teams nor the gold divide, have you?

Could you plz correct that or maybe anyone else who could help me with this? This aint a very hard request is it? :D

Uhmm...?

  • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
  • Player Group - Pick every player in tempPlayerGroup and do (Actions)
    • Loop - Actions
      • Set tempPlayer = (Picked player)
      • Player - Add tempInt to tempPlayer Current gold
      • Player Group - Remove tempPlayer from tempPlayerGroup
      • Set numberOfAlly = (numberOfAlly - 1)
 
Level 3
Joined
Jun 1, 2013
Messages
47
Uhmm...?

  • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
  • Player Group - Pick every player in tempPlayerGroup and do (Actions)
    • Loop - Actions
      • Set tempPlayer = (Picked player)
      • Player - Add tempInt to tempPlayer Current gold
      • Player Group - Remove tempPlayer from tempPlayerGroup
      • Set numberOfAlly = (numberOfAlly - 1)

Im not professional. A few sentences with an explanation how the trigger you created works would be appreciated. Im very confused by the first one you created and I cant see how it is supposed to work: Why do you assign colors?? Where do you define the teams and why do you put all players into the first trigger? Where did you put the gold divison?
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Im not professional. A few sentences with an explanation how the trigger you created works would be appreciated. Im very confused by the first one you created and I cant see how it is supposed to work: Why do you assign colors?? Where do you define the teams and why do you put all players into the first trigger? Where did you put the gold divison?

Well, instead of having the confidence of saying that "...this trigger does anything close to what I need," or "...This aint a very hard request is it? :D," you could have just asked for an explanation.

Here are the triggers with the explanation. I can probably do the second one for you if you word it a little better and or translate the triggers to english for me?

  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- these are the hex codes that will change the color of the player's name to their corresponding player color --------
      • Set playerColor[1] = |c00FF0303
      • Set playerColor[2] = |c000042FF
      • Set playerColor[3] = |c001CE6B9
      • Set playerColor[4] = |c00540081
      • Set playerColor[5] = |c00FFFC01
      • Set playerColor[6] = |c00FEBA0E
      • -------- saving the name of the player to a variable --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Set tempInt = (Player number of leavingPlayer)
          • Set playerName[tempInt] = (Name of tempPlayer)
  • Player Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
    • Conditions
    • Actions
      • Set leavingPlayer = (Triggering player)
      • Set tempInt = (Player number of leavingPlayer)
      • Game - Display to (All players) the text: (playerName[tempInt] + has left the game!)
      • -------- checking how many teammates the leaving player has --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer is an ally of leavingPlayer) Equal to True
              • (tempPlayer slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add tempPlayer to tempPlayerGroup
              • Set numberOfAlly = (numberOfAlly + 1)
            • Else - Actions
      • -------- taking the amount of gold the leaving player had and distrubiting it among between all the teammates --------
      • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
      • Player Group - Pick every player in tempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Player - Add tempInt to tempPlayer Current gold
          • Player Group - Remove tempPlayer from tempPlayerGroup
          • Set numberOfAlly = (numberOfAlly - 1)
 
Level 3
Joined
Jun 1, 2013
Messages
47
Well, instead of having the confidence of saying that "...this trigger does anything close to what I need," or "...This aint a very hard request is it? :D," you could have just asked for an explanation.

Here are the triggers with the explanation. I can probably do the second one for you if you word it a little better and or translate the triggers to english for me?

  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- these are the hex codes that will change the color of the player's name to their corresponding player color --------
      • Set playerColor[1] = |c00FF0303
      • Set playerColor[2] = |c000042FF
      • Set playerColor[3] = |c001CE6B9
      • Set playerColor[4] = |c00540081
      • Set playerColor[5] = |c00FFFC01
      • Set playerColor[6] = |c00FEBA0E
      • -------- saving the name of the player to a variable --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Set tempInt = (Player number of leavingPlayer)
          • Set playerName[tempInt] = (Name of tempPlayer)
  • Player Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
    • Conditions
    • Actions
      • Set leavingPlayer = (Triggering player)
      • Set tempInt = (Player number of leavingPlayer)
      • Game - Display to (All players) the text: (playerName[tempInt] + has left the game!)
      • -------- checking how many teammates the leaving player has --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer is an ally of leavingPlayer) Equal to True
              • (tempPlayer slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add tempPlayer to tempPlayerGroup
              • Set numberOfAlly = (numberOfAlly + 1)
            • Else - Actions
      • -------- taking the amount of gold the leaving player had and distrubiting it among between all the teammates --------
      • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
      • Player Group - Pick every player in tempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Player - Add tempInt to tempPlayer Current gold
          • Player Group - Remove tempPlayer from tempPlayerGroup
          • Set numberOfAlly = (numberOfAlly - 1)

Thanks :D
Could you plz upload the trigger with the map? I dont think I can copy it from the forum, can I?
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Thanks :D
Could you plz upload the trigger with the map? I dont think I can copy it from the forum, can I?

Well I actually didn't make this in a map. Like I said above, I wrote it all out in a little box. It's really easy to make though, it shouldn't take more than 5 minutes considering it's all layed out for you. Here are the variables I used:
  • playerColor - String array
  • tempPlayer - Player variable
  • tempInt - Integer
  • playerName - String array
  • leavingPlayer - Player variable
  • numberOfAllies - Integer
  • tempPlayerGroup - Player group variable
 
Level 3
Joined
Jun 1, 2013
Messages
47
Well I actually didn't make this in a map. Like I said above, I wrote it all out in a little box. It's really easy to make though, it shouldn't take more than 5 minutes considering it's all layed out for you. Here are the variables I used:
  • playerColor - String array
  • tempPlayer - Player variable
  • tempInt - Integer
  • playerName - String array
  • leavingPlayer - Player variable
  • numberOfAllies - Integer
  • tempPlayerGroup - Player group variable

Ehmm "String array" you mean:
Variable type: String
plus: Array (Size= 1??)
 
Level 3
Joined
Jun 1, 2013
Messages
47
Im searching for half an hour but I cant even find the first action you used: "set [variable name]" there are so many different set, none of them lets me select the created variable.......
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Ehmm "String array" you mean:
Variable type: String
plus: Array (Size= 1??)

Variable type: string with the Array box ticked. Don't do anything to the value.

Im searching for half an hour but I cant even find the first action you used: "set [variable name]" there are so many different set, none of them lets me select the created variable.......

The Set variable function is literally the 8th from the top lol in the Actions list. Are you sure you have been looking?

Try not to double-post! Use the edit button.
 
Level 3
Joined
Jun 1, 2013
Messages
47
The Set variable function is literally the 8th from the top lol in the Actions list. Are you sure you have been looking?

Try not to double-post! Use the edit button.

I dont have the english version, it's only part in english. And there are over 15 functions with "set" in it. Could you tell me what kind of action it is, which action type (Like player, unit etc) ?

Edit: Found it, it's set variable.... wouldve never guessed. I was trying unit-set functions all the time lol
 
Status
Not open for further replies.
Top