Ok I'm a noob at this and I'm just starting out, if anyone could look at my triggers and just tell me what I'm doing wrong, basically what I want it to do is to check player 1's kills if he has 100 his marines will be upgraded.
So far I've created triggers to find out player one's kill count and then if it is 10, it ends the game for him (i did this just to test it was working)
Hi I'm having trouble with the conditions, I cannot find the second value triggering unit, but I could find triggering player.
Also I'm having problems with the actions, I can find' set variable' and then choose the variable as 'PlayerKills' but I can't add an '=' or '+' All it says is
Set Variable
Variable:PlayerKills
Index 1:0
Value: PlayerKills
Index 1:0
My brother went through. Its kinda hard to explain without actually being there to point out to you. Simply, in your trigger, you should have
Event - Any unit dies. (simple enough)
For the condition, when you add a condition, it displays: "And", "Comparison", "Not", "Or", "Text has been set", "Within Bounds". Select "Comparison" and hit "OK". By default, it should be set to "(Owner of (triggering unit) == 1". Keep it highlighted, and in the bottom window you should see:
"Comparison"
+ "value 1: Owner of Unit"
-"Unit: triggering unit"
-"Operator = ="
-"Value 2: 1"
Translates into: Its will compare the first value (Player that owns the triggering unit) to see if its = to the second value (player number 1).
Double click where it says "Unit: triggering unit" to change it. Look under functions for "killing unit" (unless you have the right event, the one that i used, this will show up gray). Select it, hit "ok". Now double click on "Operator ==" and Change it to "!=". Lastly, go to "Value 2: 1", double click it, switch to "Function" (the first bullet), and look for "Owner of Unit". Hit "ok". Another "Unit: Triggering Unit" should appear beneath it. it is set to Triggering Unit by default, which is what you need so leave it.
Now it translates into: Take first value (Player that owns the killing unit) and see if it is NOT EQUAL to the second value (player that owns the Triggering/dieing unit).
Basically, thats how you change the comparison parameters to whatever your needs may be. You should check the functions another time to see whats available and to get used to it.
and your win trigger is missing an event. it simply never starts. add something like periodic event every 0.5 seconds.
but this is a pretty bad solution you should add the reaction directly after increasing the counter even if it is just "start trigger (winchecktrigger)"
use arrays! you need just one trigger for all players. SouLCarveRR explained the kill trigger:
ffs I'm clearly not good at this, it's frustrating, I just don't understand all this new stuff like if mod etc, I'm completely lost, I still can't even get my brackets the same way the second poster told me to.
How do I copy and paste my code like that? So I can show.
mod( 6 / 4) = 2 it returns the remainder of a division.
the trigger now declares victory on every multiply of 10. if you start with 12 kills and kill 8 units your are at 20. 20 / 10 = 2 without remainder. mod ( 20 / 10 ) = 0 you win
the value "triggering player" is under the functions list you have to pick it outta there
What I posted isnt literal code .... I dont use Raw GE i use their tool for adding events condition and actions.
The [] brackets indicate an array do you know how to use arrays?
Pm me and Ill explain exactly what you dont understand
I did make an adjustment to my example at the top .... In the example I was giving the kill score to the owner of the dying unit... take a look now and tell me if you actually understand what my example is doing......
The logic im using to track the score is extremely usefull for doing lots of other things and i really think you should try and grasp the concept
Ok I'm a noob at this and I'm just starting out, if anyone could look at my triggers and just tell me what I'm doing wrong, basically what I want it to do is to check player 1's kills if he has 100 his marines will be upgraded.
So far I've created triggers to find out player one's kill count and then if it is 10, it ends the game for him (i did this just to test it was working)
Anyway it doesn't work and I don't know why.
try this *MAKING AN EDIT I FOUND A PROBLEM WITH MY EXAMPLE HERE*
First Create Global var call "PlayerKills" make it an integer type and then set it to be an array with max of 15
Second Create a Trigger called "Kill Tracker"
Events - Any Unit dies
Conditions - Owner of (killing Unit) != Owner of (Triggering Unit)
Actions - Set Variable (PlayerKills[Owner of (killing unit)] = (PlayerKills[Owner of (killing unit)] + 1))
Then you can just use the players number to get his kill value out of that array
@SouLCarveRR: Go
Hi I'm having trouble with the conditions, I cannot find the second value triggering unit, but I could find triggering player.
Also I'm having problems with the actions, I can find' set variable' and then choose the variable as 'PlayerKills' but I can't add an '=' or '+' All it says is
Set Variable Variable:PlayerKills Index 1:0 Value: PlayerKills Index 1:0
My brother went through. Its kinda hard to explain without actually being there to point out to you. Simply, in your trigger, you should have Event - Any unit dies. (simple enough)
For the condition, when you add a condition, it displays: "And", "Comparison", "Not", "Or", "Text has been set", "Within Bounds". Select "Comparison" and hit "OK". By default, it should be set to "(Owner of (triggering unit) == 1". Keep it highlighted, and in the bottom window you should see:
"Comparison"
+ "value 1: Owner of Unit"
-"Unit: triggering unit"
-"Operator = ="
-"Value 2: 1"
Translates into: Its will compare the first value (Player that owns the triggering unit) to see if its = to the second value (player number 1). Double click where it says "Unit: triggering unit" to change it. Look under functions for "killing unit" (unless you have the right event, the one that i used, this will show up gray). Select it, hit "ok". Now double click on "Operator ==" and Change it to "!=". Lastly, go to "Value 2: 1", double click it, switch to "Function" (the first bullet), and look for "Owner of Unit". Hit "ok". Another "Unit: Triggering Unit" should appear beneath it. it is set to Triggering Unit by default, which is what you need so leave it.
Now it translates into: Take first value (Player that owns the killing unit) and see if it is NOT EQUAL to the second value (player that owns the Triggering/dieing unit). Basically, thats how you change the comparison parameters to whatever your needs may be. You should check the functions another time to see whats available and to get used to it.
Thank for help guys but when I followed it the brackets were not the same as yours, I just don't know how to get them like the way you've done it.
@Nogert: Go
your Abs(x) is useless
and your win trigger is missing an event. it simply never starts. add something like periodic event every 0.5 seconds.
but this is a pretty bad solution you should add the reaction directly after increasing the counter even if it is just "start trigger (winchecktrigger)"
use arrays! you need just one trigger for all players. SouLCarveRR explained the kill trigger:
you can add any action after the 'then' even a start trigger (SuperLargeTriggerWithOnlyActionsAndNoEvents)
this keeps your code clean.
@b0ne123: Go
ffs I'm clearly not good at this, it's frustrating, I just don't understand all this new stuff like if mod etc, I'm completely lost, I still can't even get my brackets the same way the second poster told me to.
How do I copy and paste my code like that? So I can show.
@Nogert: Go
I wish I know how to copy code out of the GE.
mod() http://en.wikipedia.org/wiki/Modular_arithmetic
6 / 4 = 1,5
mod( 6 / 4) = 2 it returns the remainder of a division.
the trigger now declares victory on every multiply of 10. if you start with 12 kills and kill 8 units your are at 20. 20 / 10 = 2 without remainder. mod ( 20 / 10 ) = 0 you win
@b0ne123: Go
Sorry mate, you'd have a better chance of explaining this to a wall. Thanks for the help though, I think I'll just stick to bashing spoons on my head.
@Nogert: Go
the trigger I've posted should work. simply use it ;)
just replace the upgrade marines with whatever you wanted to do
the value "triggering player" is under the functions list you have to pick it outta there
What I posted isnt literal code .... I dont use Raw GE i use their tool for adding events condition and actions.
The [] brackets indicate an array do you know how to use arrays?
Pm me and Ill explain exactly what you dont understand
I did make an adjustment to my example at the top .... In the example I was giving the kill score to the owner of the dying unit... take a look now and tell me if you actually understand what my example is doing......
The logic im using to track the score is extremely usefull for doing lots of other things and i really think you should try and grasp the concept