I was making a trigger for whenever a certain unit kills a hero a random player of the killing units team gets a reward by throwing a dice.
However if the highest throw equals the other highest thrower, the trigger wont rethrow(restart) its the first part in the actions, why doesnt it work?
thx
PylonKillTeam1EventsUnit-AnyUnitdiesLocalVariablesDice1=(Randomintegerbetween1and6)<Integer>Dice2=(Randomintegerbetween1and6)<Integer>Dice3=(Randomintegerbetween1and6)<Integer>Conditions(Unittypeof(Killingunit))==DefensiveCannonCopy2ActionsUI-Display((Nameofplayer(Player1from(Playersonteam1)))+(" Throws: "+(Text(Dice1))))for(Allplayers)toSubtitleareaUI-Display((Nameofplayer(Player2from(Playersonteam1)))+(" Throws: "+(Text(Dice2))))for(Allplayers)toSubtitleareaUI-Display((Nameofplayer(Player3from(Playersonteam1)))+(" Throws: "+(Text(Dice3))))for(Allplayers)toSubtitleareaGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfDice1==Dice2AndConditionsDice3<Dice1OrConditionsDice1==Dice3AndConditionsDice2<Dice1OrConditionsDice3==Dice2AndConditionsDice1<Dice2ThenUI-Display"Rethrow!"for(Allplayers)toSubtitleareaGeneral-Wait2.0GameTimesecondsTrigger-RunPylonKillTeam1(IgnoreConditions,Don't Wait until it finishes)General-If(Conditions)thendo(Actions)elsedo(Actions)IfDice1>Dice2AndConditionsDice1>Dice3ThenPlayer-Modifyplayer(Player1from(Playersonteam1))Vespene:Add1UI-Display((Nameofplayer(Player1from(Playersonteam1)))+": Wins!")for(Allplayers)toSubtitleareaGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfDice2>Dice1AndConditionsDice2>Dice3ThenPlayer-Modifyplayer(Player2from(Playersonteam1))Vespene:Add1UI-Display((Nameofplayer(Player2from(Playersonteam1)))+": Wins!")for(Allplayers)toSubtitleareaGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfDice3>Dice2AndConditionsDice3>Dice1ThenPlayer-Modifyplayer(Player3from(Playersonteam1))Vespene:Add1UI-Display((Nameofplayer(Player3from(Playersonteam1)))+": Wins!")for(Allplayers)toSubtitlearea
I not sure if this is entirely the direct way that you would like to fix it but should you find no solution, another way of looking at it would be to have it as a loop that breaks only if the dice rolls aren't equal
ah man, i did like you showed in the example and it worked, but the i started adding "or's" and ive been totally messing up for a while now, ive been trying what seemed logic to me but.... could you pls show me the example with 2x the "or and" statement in there?
Hey ppl.
I was making a trigger for whenever a certain unit kills a hero a random player of the killing units team gets a reward by throwing a dice. However if the highest throw equals the other highest thrower, the trigger wont rethrow(restart) its the first part in the actions, why doesnt it work?
thx
I not sure if this is entirely the direct way that you would like to fix it but should you find no solution, another way of looking at it would be to have it as a loop that breaks only if the dice rolls aren't equal
Because the And, Or are working in another way. Everything you specify under them is used with this logical comparison.
For example:
Will return true, only if Dice3 < Dice1 AND Dice1 == Dice2. The same for Or. Restructorize your conditions, then it'll work :)
@o3210: Go
ah man, i did like you showed in the example and it worked, but the i started adding "or's" and ive been totally messing up for a while now, ive been trying what seemed logic to me but.... could you pls show me the example with 2x the "or and" statement in there?
i tried it like:
and like this:
i tried more ways.....
Okay, let me do this in a second :D
Should work :) If atleast 1 AND returns TRUE, then it will execute everything written in THEN, if everything is FALSE, it will execute the else part.
@o3210: Go
OMG like the only thing i didnt try :p
cheers man it works fine now! :D