Hello, I am in the making of a Small PVP Arena type map. I have started on making an -ar (All Random) mode where ofcourse the players are randomed their hero. Now I have done most of the trigger, well pretty much all of it and I have tested it a few times and to me it doesn't seem to be working, whether it's my trigger or just bad luck but I don't know.
Well here's the thing, my map plays out like this;
-Game loads
-Players pick whether they are Good or Evil
-Host picks modes (-arffa (All random free for all))
-Players screens are sent to a small room where all the heros are.
-One by one the players heros are randomed so there are no duplicate heros to screw up spell triggers.
-Once heros are picked the game starts.
Now, it screws up when the Players are given their heros because when I tested it, as I said it may have been bad luck but I kept randoming the Ancient Crypt Fiend (See the code).
Well enough of my babbling here is my trigger (There is no event because the action is initated from another trigger):
Sorry about the long code, but I actually did chop about 4x that off because it is just repeated for each player. Now the error occures around here:
Because what I think is happening is that the last hero being removed is being given to the player.
But I dunno.
Thanks in advance to who ever helps me, I will credit them on the map.
By the way if this takes awhile to figure out it's all cool I can just make the spells and items while we figure it out.
Thanks!
Well here's the thing, my map plays out like this;
-Game loads
-Players pick whether they are Good or Evil
-Host picks modes (-arffa (All random free for all))
-Players screens are sent to a small room where all the heros are.
-One by one the players heros are randomed so there are no duplicate heros to screw up spell triggers.
-Once heros are picked the game starts.
Now, it screws up when the Players are given their heros because when I tested it, as I said it may have been bad luck but I kept randoming the Ancient Crypt Fiend (See the code).
Well enough of my babbling here is my trigger (There is no event because the action is initated from another trigger):
Trigger:
- Dispurse Heros
- Events
- Conditions
- Actions
- Unit Group - Pick every unit in (Units in Heros Good <gen>) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is A Hero) Equal to True
- Then - Actions
- Unit Group - Add (Picked unit) to HerosGood
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in (Units in Heros Evil <gen>) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is A Hero) Equal to True
- Then - Actions
- Unit Group - Add (Picked unit) to HerosEvil
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Picking Area <gen>
- Camera - Set the camera bounds for (Picked player) to Picking <gen>
- Loop - Actions
- Game - Display to (All players) the text: (|cffffcc00Game:|r + Now randoming the heros.)
- Wait 2.00 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 1 (Red) controller) Equal to User
- (Player 1 (Red) slot status) Equal to Is playing
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- PlayerAlliance[1] Equal to True
- Then - Actions
- Unit - Create 1 (Unit-type of (Random unit from HerosGood)) for Player 1 (Red) at (Center of PlayerStart[1]) facing Default building facing degrees
- Unit Group - Remove (Picked unit) from HerosGood
- Game - Display to (All players) the text: (|cffffcc00Game:|r + ((Name of (Triggering player)) + ( has been randomed + ((Name of (Last created unit)) + !))))
- Unit Group - Pick every unit in (Units in Heros Good <gen>) and do (Actions)
- Loop - Actions
- Unit - Change color of (Picked unit) to Red
- Loop - Actions
- Else - Actions
- <b>Unit Group - Pick every unit in (Units in Heros Evil <gen>) and do (Actions)
- Loop - Actions
- Unit - Change color of (Picked unit) to Red
- Loop - Actions
- Unit - Create 1 (Unit-type of (Random unit from HerosEvil)) for Player 1 (Red) at (Center of PlayerStart[1]) facing Default building facing degrees
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Sacred Chieftain
- Then - Actions
- Unit Group - Remove Sacred Chieftain 0014 <gen> from HerosEvil
- Unit - Kill Sacred Chieftain 0014 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Voodoo Troll
- Then - Actions
- Unit Group - Remove Voodoo Troll 0015 <gen> from HerosEvil
- Unit - Kill Voodoo Troll 0015 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Vampire
- Then - Actions
- Unit Group - Remove Vampire 0016 <gen> from HerosEvil
- Unit - Kill Vampire 0016 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Ancient Cryptfiend
- Then - Actions
- Unit Group - Remove Ancient Cryptfiend 0017 <gen> from HerosEvil
- Unit - Kill Ancient Cryptfiend 0017 <gen>
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Game - Display to (All players) the text: (|cffffcc00Game:|r + ((Name of (Owner of (Last created unit))) + ( has been randomed + ((Name of (Last created unit)) + !))))
- <b>Unit Group - Pick every unit in (Units in Heros Evil <gen>) and do (Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Game - Display to (All players) the text: (|cffffcc00Game:|r + ((Name of Player 1 (Red)) + is not playing.))</b>
- If - Conditions
- Unit Group - Pick every unit in (Units in Heros Good <gen>) and do (Actions)
Sorry about the long code, but I actually did chop about 4x that off because it is just repeated for each player. Now the error occures around here:
Trigger:
- Else - Actions
- <b>Unit Group - Pick every unit in (Units in Heros Evil <gen>) and do (Actions)
- Loop - Actions
- Unit - Change color of (Picked unit) to Red
- Loop - Actions
- Unit - Create 1 (Unit-type of (Random unit from HerosEvil)) for Player 1 (Red) at (Center of PlayerStart[1]) facing Default building facing degrees
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Sacred Chieftain
- Then - Actions
- Unit Group - Remove Sacred Chieftain 0014 <gen> from HerosEvil
- Unit - Kill Sacred Chieftain 0014 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Voodoo Troll
- Then - Actions
- Unit Group - Remove Voodoo Troll 0015 <gen> from HerosEvil
- Unit - Kill Voodoo Troll 0015 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Vampire
- Then - Actions
- Unit Group - Remove Vampire 0016 <gen> from HerosEvil
- Unit - Kill Vampire 0016 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to Ancient Cryptfiend
- Then - Actions
- Unit Group - Remove Ancient Cryptfiend 0017 <gen> from HerosEvil
- Unit - Kill Ancient Cryptfiend 0017 <gen>
- Else - Actions
- Do nothing</b>
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- <b>Unit Group - Pick every unit in (Units in Heros Evil <gen>) and do (Actions)
Because what I think is happening is that the last hero being removed is being given to the player.
But I dunno.
Thanks in advance to who ever helps me, I will credit them on the map.
By the way if this takes awhile to figure out it's all cool I can just make the spells and items while we figure it out.
Thanks!