| 12-17-2006, 07:47 AM | #1 |
i am working on a random add skill system. hereis what i have hero1 Events Unit - A unit enters lvzone1 <gen> Conditions And - All (Conditions) are true Conditions ((Triggering unit) is in hero1) Not equal to True (Owner of (Triggering unit)) Equal to Player 1 (Red) (Hero level of (Triggering unit)) Greater than or equal to 10 Actions Game - Display to Player Group - Player 1 (Red) the text: This unit is now yo... Unit Group - Pick every unit in hero1 and do (Unit - Remove (Picked unit) from the game) Unit Group - Add (Triggering unit) to hero1 Set randomskill1 = (Random integer number between 1 and 2) For each (Integer randomskill1) from 1 to 1, do (Game - Display to (All players) the text: yes) For each (Integer randomskill1) from 2 to 2, do (Game - Display to (All players) the text: no) the result i espect is that when a unit with lv 10 or higher who is not in unit group hero 1 enter the zone, it will add the unit to group 1 and remove the exisiting unit in group 1. This part works, but then the ranom system part doesnt. I expect it to randomly choose 1 of the 2 options, but instead it activates both of them. which display the test yes and no. I am all stuck after spending hours trying to fix it, plz help |
| 12-17-2006, 08:08 AM | #2 |
Just replace this: Trigger: ![]() For each (Integer randomskill1) from 1 to 1, do (Game - Display to (All players) the text: yes)
![]() For each (Integer randomskill1) from 2 to 2, do (Game - Display to (All players) the text: no)With this: Trigger: If (randomskill1 is equal to 1) then do (Game - Display to (All players) the text: Yes) else do (Game - Display to (All players) the text: No)It should work fine, but please use the [trigger] tags next time. |
