HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Doesn't go to next player's turn..

09-03-2007, 09:31 PM#1
aznstrike
I made a mini game, but it doesn't go to the next player's turn. Anyone know why? Here's the code:

The Mini Game starts off like this.
Trigger:
LVLo1 x Begin
Events
Conditions
Collapse Actions
-------- --------
Game - Display to (All players) for 30.00 seconds the text: |cffffcc00Itachi's ...
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Camera - Pan camera for (Picked player) to (Center of LVLo1area <gen>) over 0.00 seconds
Camera - Set the camera bounds for (Picked player) to LVLo1area <gen>
Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across LVLo1area <gen>
Set Game_Vision[(Player number of (Picked player))] = (Last created visibility modifier)
-------- --------
Hero - Create Shadow Clone and give it to Uchiha Itachi (Dummy) 0013 <gen>
Hero - Create Explosion Clone and give it to Uchiha Itachi (Dummy) 0013 <gen>
Set Temp_Int = (Random integer number between 1 and LVLo1_Total)
-------- --------
Hero - Order Uchiha Itachi (Dummy) 0013 <gen> to use (Item carried by Uchiha Itachi (Dummy) 0013 <gen> of type Explosion Clone) on Uchiha Itachi (Dummy) 0013 <gen>
Set Temp_Unit_Group = (Units within 200.00 of (Position of Uchiha Itachi (Dummy) 0013 <gen>) matching (((Matching unit) is an illusion) Equal to True))
Collapse Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
Collapse Loop - Actions
Unit - Move (Picked unit) instantly to LVLo1_Point[Temp_Int]
Unit - Set the custom value of (Picked unit) to 1
Custom script: call DestroyGroup(udg_Temp_Unit_Group)
-------- --------
Collapse For each (Integer A) from 1 to (Temp_Int - 1), do (Actions)
Collapse Loop - Actions
Hero - Order Uchiha Itachi (Dummy) 0013 <gen> to use (Item carried by Uchiha Itachi (Dummy) 0013 <gen> of type Shadow Clone) on Uchiha Itachi (Dummy) 0013 <gen>
Set Temp_Unit_Group = (Units within 200.00 of (Position of Uchiha Itachi (Dummy) 0013 <gen>) matching (((Matching unit) is an illusion) Equal to True))
Collapse Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
Collapse Loop - Actions
Unit - Move (Picked unit) instantly to LVLo1_Point[(Integer A)]
Unit - Set the custom value of (Picked unit) to 0
Custom script: call DestroyGroup(udg_Temp_Unit_Group)
Collapse For each (Integer A) from (Temp_Int + 1) to 12, do (Actions)
Collapse Loop - Actions
Hero - Order Uchiha Itachi (Dummy) 0013 <gen> to use (Item carried by Uchiha Itachi (Dummy) 0013 <gen> of type Shadow Clone) on Uchiha Itachi (Dummy) 0013 <gen>
Set Temp_Unit_Group = (Units within 200.00 of (Position of Uchiha Itachi (Dummy) 0013 <gen>) matching (((Matching unit) is an illusion) Equal to True))
Collapse Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
Collapse Loop - Actions
Unit - Move (Picked unit) instantly to LVLo1_Point[(Integer A)]
Unit - Set the custom value of (Picked unit) to 0
Custom script: call DestroyGroup(udg_Temp_Unit_Group)
-------- --------
Set LVLo1_PlayerList = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
Collapse Player Group - Pick every player in LVLo1_PlayerList and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Gekkou Hayate for (Picked player) at (Random point in LVLo1spawn <gen>) facing Default building facing (270.0) degrees
Set LVLo1_UnitList[(Player number of (Picked player))] = (Last created unit)
Unit - Pause (Last created unit)
-------- --------
Collapse Player Group - Pick every player in LVLo1_PlayerList and do (Actions)
Collapse Loop - Actions
Set LVLo1_CurrentUnit = LVLo1_UnitList[(Player number of (Picked player))]
Unit - Unpause LVLo1_UnitList[(Player number of (Picked player))]
Set LVLo1_OldList = LVLo1_PlayerList
Player Group - Remove all players from LVLo1_PlayerList
-------- --------
Set LVLo1_PlayerList = LVLo1_OldList

This is how it works, your Hero has to either attack a Safe Unit, or a Bomb. If they kill the Safe Unit the trigger below happens:

And everytime it should pause ur unit after one of those units are killed, going to the next player's turn. (But the same player gets to go again)

Trigger:
LVLo1 x Shadow
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Uchiha Itachi (Dummy)
(Custom value of (Dying unit)) Equal to 0
Collapse Actions
-------- --------
Unit - Move (Killing unit) instantly to (Center of LVLo1spawn <gen>)
Unit - Pause (Killing unit)
Player Group - Remove (Owner of (Killing unit)) from LVLo1_PlayerList
-------- --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of players in LVLo1_PlayerList) Equal to 0
Collapse Then - Actions
Set LVLo1_PlayerList = (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) controller) Equal to User) and ((LVLo1_UnitList[(Player number of (Matching player))] is alive) Equal to True))))
Collapse Else - Actions
Do nothing
-------- --------
Collapse Player Group - Pick every player in LVLo1_PlayerList and do (Actions)
Collapse Loop - Actions
Set LVLo1_CurrentUnit = LVLo1_UnitList[(Player number of (Picked player))]
Unit - Unpause LVLo1_UnitList[(Player number of (Picked player))]
Set LVLo1_OldList = LVLo1_PlayerList
Player Group - Remove all players from LVLo1_PlayerList
-------- --------
Set LVLo1_PlayerList = LVLo1_OldList

Now this is the Bomb Unit. It kills the unit that attacks it.. It actually goes to the next player's turn but for some reason the above code makes it so you don't..

Trigger:
LVLo1 x Explosion
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Uchiha Itachi (Dummy)
(Custom value of (Dying unit)) Equal to 1
Collapse Actions
-------- --------
Set LVLo1_UnitList[(Player number of (Owner of (Killing unit)))] = No unit
Unit - Kill (Killing unit)
Player Group - Remove (Owner of (Killing unit)) from LVLo1_PlayerList
-------- --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of players in LVLo1_PlayerList) Equal to 0
Collapse Then - Actions
Set LVLo1_PlayerList = (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) controller) Equal to User) and ((LVLo1_UnitList[(Player number of (Matching player))] is alive) Equal to True))))
Collapse Else - Actions
Do nothing
-------- --------
Collapse Player Group - Pick every player in LVLo1_PlayerList and do (Actions)
Collapse Loop - Actions
Set LVLo1_CurrentUnit = LVLo1_UnitList[(Player number of (Picked player))]
Unit - Unpause LVLo1_UnitList[(Player number of (Picked player))]
Set LVLo1_OldList = LVLo1_PlayerList
Player Group - Remove all players from LVLo1_PlayerList
-------- --------
Set LVLo1_PlayerList = LVLo1_OldList
09-04-2007, 04:28 AM#2
Ammorth
remove your "Group Remove all Players" from the player loop, and stick it directly after.
09-04-2007, 11:22 PM#3
aznstrike
doesn't work and shouldnt work. thx for tryingtho...
09-05-2007, 02:51 AM#4
aznstrike
bump
09-06-2007, 01:12 AM#5
aznstrike
help