This script is an easy method of displaying a notification for each player when they reach a specified variable(in this case, kills).
In simple terms. I can create a message for as many players as the game allows depending on how many kills they have all in a few lines of script. (without having to create a separate script for each player).
This is especially good for marine arena type maps where there would normally be a lot of duplication for each player.
This tutorial takes into account that you already have a playergroup setup. It is simple to make a playergroup you create a variable, make it "playergroup" then click array and add the number of players. Then create a few action in your initialization trigger placing the players in the playgroup variable.
Now we begin by creating another variable which will be an integer, I called this variable "unit messages", check the array box and place the number of players in your player group next to it. In this case 9. You will also need to create a kill counter variable. Again easy and Google will help.
Now create a new trigger and copy this script.
<<code>>
Actions
General - Repeat (Actions) forever
Actions
General - Wait 0.5 Game Time seconds
Player Group - Pick each player in Main playergroup and do (Actions)
Actions
General - While (Conditions) are true, do (Actions)
Conditions
Player Kill Counter[(Picked player)] > 100
Unit message [(Picked player)] == 0
Actions
UI - Display "100 kills = Razorback Zergling" for (Player group((Picked player))) to Objective area
Variable - Modify Unit message [(Picked player)]: + 1
General - While (Conditions) are true, do (Actions)
Conditions
Player Kill Counter[(Picked player)] > 200
Unit message [(Picked player)] == 1
Actions
UI - Display "200 kills = Scythe Zealot" for (Player group((Picked player))) to Objective area
Variable - Modify Unit message [(Picked player)]: + 1
General - While (Conditions) are true, do (Actions)
Conditions
Player Kill Counter[(Picked player)] > 300
Unit message [(Picked player)] == 2
Actions
UI - Display "300 kills = Cougher Roach" for (Player group((Picked player))) to Objective area
Variable - Modify Unit message [(Picked player)]: + 1
<</code>>
This script triggers every 0.5 game seconds. It will pick a player from our player group and then run the script with that player. It will check their kills(as stored in kill counter variable) and check if the "unit message" variable = X. Once the first set of conditions are met it will run the actions which are to display "100 kills = Razorback Zergling" and increase the variable in "user messages" by 1.
The next set of conditions require that the user message variable must = 1. The reason for this is that the script checks every 0.5 seconds. If the condition was set to look for =100 kills rather than >100 kills then there is a possibility it will not be "true" and display as the next time it checks the script the player may have 101 kills. This is why the conditions are greater than X kills and it checks if the previous condition is met(the user message variable).
The great thing about this script is that you only have to create it once since it will pick each player from the playergroup. This could 24 players or more. It will check each player without you having to create 24 scripts for each player.
This script is an easy method of displaying a notification for each player when they reach a specified variable(in this case, kills).
In simple terms. I can create a message for as many players as the game allows depending on how many kills they have all in a few lines of script. (without having to create a separate script for each player).
This is especially good for marine arena type maps where there would normally be a lot of duplication for each player.
This tutorial takes into account that you already have a playergroup setup. It is simple to make a playergroup you create a variable, make it "playergroup" then click array and add the number of players. Then create a few action in your initialization trigger placing the players in the playgroup variable.
Now we begin by creating another variable which will be an integer, I called this variable "unit messages", check the array box and place the number of players in your player group next to it. In this case 9. You will also need to create a kill counter variable. Again easy and Google will help.
Now create a new trigger and copy this script.
<<code>>
Actions
General - Repeat (Actions) forever
Actions
General - Wait 0.5 Game Time seconds
Player Group - Pick each player in Main playergroup and do (Actions)
Actions
General - While (Conditions) are true, do (Actions)
Conditions
Player Kill Counter[(Picked player)] > 100
Unit message [(Picked player)] == 0
Actions
UI - Display "100 kills = Razorback Zergling" for (Player group((Picked player))) to Objective area
Variable - Modify Unit message [(Picked player)]: + 1
General - While (Conditions) are true, do (Actions)
Conditions
Player Kill Counter[(Picked player)] > 200
Unit message [(Picked player)] == 1
Actions
UI - Display "200 kills = Scythe Zealot" for (Player group((Picked player))) to Objective area
Variable - Modify Unit message [(Picked player)]: + 1
General - While (Conditions) are true, do (Actions)
Conditions
Player Kill Counter[(Picked player)] > 300
Unit message [(Picked player)] == 2
Actions
UI - Display "300 kills = Cougher Roach" for (Player group((Picked player))) to Objective area
Variable - Modify Unit message [(Picked player)]: + 1
<</code>>
This script triggers every 0.5 game seconds. It will pick a player from our player group and then run the script with that player. It will check their kills(as stored in kill counter variable) and check if the "unit message" variable = X. Once the first set of conditions are met it will run the actions which are to display "100 kills = Razorback Zergling" and increase the variable in "user messages" by 1.
The next set of conditions require that the user message variable must = 1. The reason for this is that the script checks every 0.5 seconds. If the condition was set to look for =100 kills rather than >100 kills then there is a possibility it will not be "true" and display as the next time it checks the script the player may have 101 kills. This is why the conditions are greater than X kills and it checks if the previous condition is met(the user message variable).
The great thing about this script is that you only have to create it once since it will pick each player from the playergroup. This could 24 players or more. It will check each player without you having to create 24 scripts for each player.
Hope this helps some people.