HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Allrandom Not Working

09-12-2006, 07:03 PM#1
Siphonized
The problem here is, this trigger only gives player 1 a hero, and skips the rest.

EDIT: The trigger has worked perfectly before.

Remove Allrandom: Turns off Allrandom and another trigger called Pan Camera Allrandom which basically just moves the camera to the place where the Hero spawns.

Trigger:
Allrandom
Collapse Events
Player - Player 1 (Red) types a chat message containing -ar as An exact match
Player - Player 1 (Red) types a chat message containing -allrandom as An exact match
Conditions
Collapse Actions
Trigger - Turn off Remove Allrandom <gen>
Collapse Unit Group - Pick every unit in (Units in PickerSpawn <gen>) and do (Actions)
Collapse Loop - Actions
Unit - Remove (Picked unit) from the game
Collapse For each (Integer A) from 1 to 6, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Collapse Then - Actions
Set RandomHero = (Random integer number between 1 and RandomCount)
Unit - Create 1 HeroArray[RandomData[RandomHero]] for (Player((Integer A))) at PointArray[(Integer A)] facing 270.00 degrees
If ((Integer A) Equal to 1) then do (Set Player1 = (Last created unit)) else do (Do nothing)
If ((Integer A) Equal to 2) then do (Set Player2 = (Last created unit)) else do (Do nothing)
If ((Integer A) Equal to 3) then do (Set Player3 = (Last created unit)) else do (Do nothing)
If ((Integer A) Equal to 4) then do (Set Player4 = (Last created unit)) else do (Do nothing)
If ((Integer A) Equal to 5) then do (Set Player5 = (Last created unit)) else do (Do nothing)
If ((Integer A) Equal to 6) then do (Set Player6 = (Last created unit)) else do (Do nothing)
Hero - Create |cff996633Boar Meat|r and give it to (Last created unit)
Selection - Select (Last created unit) for (Owner of (Last created unit))
Game - Display to (All players) the text: (A player has randomed + (Name of (Last created unit)))
Player - Set (Player((Integer A))) Current gold to 125
Set RandomData[RandomHero] = RandomCount
Set RandomCount = (RandomCount - 1)
Wait 0.50 seconds
Collapse Else - Actions
Game - Display to (All players) the text: Condition not match...
Trigger - Turn off (This trigger)
Trigger - Turn off Pan Cam Allrandom <gen>
09-12-2006, 07:22 PM#2
King Klear
You say it worked before, what exactly did you do before it stopped working? Have you changed anything in the trigger itself?
09-12-2006, 07:25 PM#3
Siphonized
I haven't changed anything except adding the two "trigger off's" at the end.
09-12-2006, 07:55 PM#4
Vexorian
and are you turning the trigger on somewhere else?
09-12-2006, 08:11 PM#5
Siphonized
All triggers are on from the start.

Remove Allrandom turns off Allrandom and Pan Cam Allrandom after 10 seconds, since there's a 10 second wait until you can buy heroes.

Pan Cam Allrandom and Allrandom starts when someone types -ar or -allrandom.

Pan Cam Allrandom ONLY moves the camera for each player.
09-12-2006, 08:14 PM#6
Siphonized
The problem is that the for-loop only executes once... I tried adding "Display message to all" to Else, but it never showed.

So.. What the hell is wrong with the for-loop?
09-12-2006, 08:26 PM#7
Anitarf
Your wait might be screwing up the loop, Integer A is global.
09-13-2006, 12:30 AM#8
Siphonized
Myea... I actually made a new integer and made the loop with that and it works.

So I guess somewhere I have a "for each Integer A from 1 to X" running that screws it up if you run -ar at some point while the other Integer A loop is executing.

So thanks!
09-13-2006, 12:26 PM#9
zeroXD
You might use an integer variable instead of integer A in the loop, then it will work fine, i hope. I never use integer A or B if i have to use waits in them, something allways ends completely screwed up.
09-13-2006, 05:36 PM#10
Alevice
That's what he just did.