| 12-31-2003, 04:10 PM | #1 |
See, in my map i have an trigger taht works corretly for player 1 but i'm trying to put that trigger to all players, but i need save an value in a variable for the player that triggered the event. I can't post triggers here because i have Spanish version of World Edit and you wont undersand. The problem is that i made that variable an array, i want to store the value in a array for each player that triggered it and i dont want it to be an shared value. So, i want if player 5 cast a spell make variable "x = [array(make that array = player 5 because he's casting spell]". |
| 12-31-2003, 04:57 PM | #2 |
simple. Variable[Playernumber(triggering player)] When your setting the array number, just chose "Player Number" in the dropdown box. |
| 12-31-2003, 04:59 PM | #3 |
Doesn't work Here goes my actual trigger: Fireball Damage Events Unit - A unit orders a unit with a pont as objetive Conditions (Unit-type of (Ordered unit)) Igual to Sorceress Actions Set FireballDamage[(Player number of (Owner of (Ordered unit)))] = (15 x (Integer((Real((Level of Fire Explotion for Hero[(Player number of (Owner of (Ordered unit)))])))))) Set FireballSYnergy[(Player number of (Owner of (Ordered unit)))] = (1.00 + ((Real((Level of Fire Strike for Hero[(Player number of (Owner of (Ordered unit)))]))) x 0.15)) Wait 0.10 seconds Set FireballParcial[(Player number of (Owner of (Ordered unit)))] = (FireballSYnergy[(Player number of (Owner of (Ordered unit)))] x (Real(FireballDamage[(Player number of (Owner of (Ordered unit)))]))) Set FireballTotal[(Player number of (Owner of (Ordered unit)))] = ((Integer(FireballParcial[(Player number of (Owner of (Ordered unit)))])) + 1) Doesn't work. |
| 12-31-2003, 05:25 PM | #4 |
Should work. Looks fine to me. And I know " [(Player number of (Owner of (Ordered unit)))] " works because I have used it in my triggers before. Debug time.... Put 'Game - Text message to player group All Players' after each step, and reference the step. So after "Set FireballDamage[(Player number of (Owner of (Ordered unit)))] = (15 x (Integer((Real((Level of Fire Explotion for Hero[(Player number of (Owner of (Ordered unit)))]))))))" put: Game - Text message to player group All Players converge strings "Set Fireballdamage = " + FireballDamage[(Player number of (Owner of (Ordered unit)))] and then test the map and see what shows up. |
| 12-31-2003, 05:44 PM | #5 |
Still doesn't work. There are tree trigger, can somoene see if find any errors?: -------------Trigger 1---------- Fireball Damage Events Unit - A unit is orderer to target a unit as objetive Conditions (Unit-type of (Ordered unit)) Igual a Sorceress Actions Set FireballDamage[(Player number of (Owner of (Ordered unit)))] = (15 x (Integer((Real((Level of Fire Explotion for Hero[(Player number of (Owner of (Ordered unit)))])))))) Set FireballSYnergy[(Player number of (Owner of (Ordered unit)))] = (1.00 + ((Real((Level of Fire Strike for Hero[(Player number of (Owner of (Ordered unit)))]))) x 0.15)) Wait 0.10 seconds Set FireballParcial[(Player number of (Owner of (Ordered unit)))] = (FireballSYnergy[(Player number of (Owner of (Ordered unit)))] x (Real(FireballDamage[(Player number of (Owner of (Ordered unit)))]))) Set FireballTotal[(Player number of (Owner of (Ordered unit)))] = ((Integer(FireballParcial[(Player number of (Owner of (Ordered unit)))])) + 1) ----------Trigger 2---------- Fireball Cast Events Unidad - A unit Finaliza el lanzamiento de una habilidad Conditions (Ability being cast) Igual a Fire Explotion Actions Wait 0.50 game-time seconds Region - Center FireExplotionRadius <gen> on (Position of (Target unit of ability being cast)) Unit Group - Pick every unit in (Units in FireExplotionRadius <gen> matching (((Owner of (Matching unit)) is an ally of (Owner of (Casting unit))) Igual a False)) and do (Actions) Bucle: Acciones Unit - Set life of (Picked unit) to ((Vida of (Picked unit)) - (Real(FireballTotal[(Player number of (Owner of (Casting unit)))]))) Floating Text - Create floating text that reads ((String(FireballTotal[(Player number of (Owner of (Casting unit)))])) + Damage!) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency Texto flotante - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees Wait 2.00 seconds Unit Group - Pick every unit in (Units in FireExplotionRadius <gen> matching (((Owner of (Matching unit)) is an ally of (Owner of (Casting unit))) Igual a False)) and do (Actions) Bucle: Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) Si: Condiciones ((Picked unit) is dead) Igual a True Entonces: Acciones Unit group- Pick every unit in (Units in (Playable map area) matching (((Owner of (Matching unit)) is an ally of (Owner of (Casting unit))) Igual a True)) and do (Actions) Bucle: Acciones Hero - Add 7 experience to (Picked unit), Mostrar level-up graphics Otros: Acciones Do nothing Texto flotante - Destroy (Last created floating text) |
