HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Critical error?

07-31-2007, 06:23 AM#1
botanic
I am trying to set up a duel thing just 2 problems

1 all players are put on one team

2 it critical errors if they kill each other ~.~

Trigger:
Timer
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(D_Time_M Equal to 0) and (D_Time_S Equal to 1)
Collapse Then - Actions
Set D_Time_M = 10
Set D_Time_S = 0
Trigger - Turn on Begin <gen>
Trigger - Turn on Hero Dies <gen>
Trigger - Turn off Revive <gen>
Trigger - Turn off (This trigger)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
D_Time_S Equal to 0
Collapse Then - Actions
Set D_Time_S = 59
Set D_Time_M = (D_Time_M - 1)
Collapse Else - Actions
Set D_Time_S = (D_Time_S - 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
D_Time_S Less than 10
Collapse Then - Actions
Set Time_S = (0 + (String(D_Time_S)))
Collapse Else - Actions
Set Time_S = (String(D_Time_S))
Multiboard - Change the title of (Last created multiboard) to (Duel in + ((String(D_Time_M)) + (: + Time_S)))


Trigger:
Begin
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
Set tempintiger3 = 0
Collapse Player Group - Pick every player in All_Players and do (Actions)
Collapse Loop - Actions
Player Group - Add (Picked player) to Temp_P_Group
Collapse Player Group - Pick every player in Temp_P_Group and do (Actions)
Collapse Loop - Actions
Set tempintiger = 0
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Kills[(Integer A)] Greater than or equal to tempintiger
Collapse Then - Actions
Set tempintiger2 = (Integer A)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Integer A) Equal to 12
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
tempintiger3 Equal to 0
Collapse Then - Actions
Player Group - Add (Player(tempintiger2)) to Team_A
Set tempintiger3 = 1
Collapse Else - Actions
Player Group - Add (Player(tempintiger2)) to Team_B
Set tempintiger3 = 0
Player Group - Remove (Player(tempintiger2)) from Temp_P_Group
Else - Actions
Player Group - Make Team_A treat Team_B as an Enemy with shared vision
Player Group - Make Team_B treat Team_A as an Enemy with shared vision
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse Unit Group - Pick every unit in (Units in (Playable map area) owned by (Player((Integer A)))) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Not equal to Hero Soul
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) is in Team_A) Equal to True
Collapse Then - Actions
Region - Center Duel_Region[(Integer A)] on (Position of (Picked unit))
Set Duel_Hp[(Integer A)] = (Integer((Life of (Picked unit))))
Set Duel_Mp[(Integer A)] = (Integer((Mana of (Picked unit))))
Camera - Pan camera for (Owner of (Picked unit)) to (Center of dueler 1 <gen>) over 0.00 seconds
Unit - Move (Picked unit) instantly to (Center of dueler 1 <gen>)
Unit - Set life of (Picked unit) to 100.00%
Unit - Set mana of (Picked unit) to 100.00%
Collapse Else - Actions
Region - Center Duel_Region[(Integer A)] on (Position of (Picked unit))
Set Duel_Hp[(Integer A)] = (Integer((Life of (Picked unit))))
Set Duel_Mp[(Integer A)] = (Integer((Mana of (Picked unit))))
Camera - Pan camera for (Owner of (Picked unit)) to (Center of dueler 2 <gen>) over 0.00 seconds
Unit - Move (Picked unit) instantly to (Center of dueler 2 <gen>)
Unit - Set life of (Picked unit) to 100.00%
Unit - Set mana of (Picked unit) to 100.00%
Collapse Else - Actions
Unit - Pause (Picked unit)
Leaderboard - Create a leaderboard for (All players) titled Score
Leaderboard - Show (Last created leaderboard)
Set Team_A_S = 0
Set Team_B_S = 0
Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Team A and value 0
Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label Team B and value 0
Trigger - Turn off (This trigger)

Trigger:
Hero Dies
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Triggering unit) is A Hero) Equal to True
((Triggering unit) belongs to an enemy of Player 1 (Red)) Equal to False
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Collapse Then - Actions
Hero - Instantly revive (Triggering unit) at (Center of Duel_Region[(Integer A)]), Show revival graphics
Unit - Set life of (Triggering unit) to (Real(Duel_Hp[(Integer A)]))
Unit - Set mana of (Triggering unit) to (Real(Duel_Mp[(Integer A)]))
Unit - Pause (Triggering unit)
Multiboard - Set the text for Scoreboard item in column 4, row ((Integer A) + 1) to (String(Die[(Integer A)]))
Set Die[(Integer A)] = (Die[(Integer A)] + 1)
Else - Actions
Collapse Player Group - Pick every player in Team_A and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Triggering unit)) Equal to (Picked player)
Collapse Then - Actions
Set Team_B_S = (Team_B_S + 1)
Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Team_B_S
Collapse Else - Actions
Set Team_A_S = (Team_A_S + 1)
Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Team_A_S
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of players in Team_A) Equal to Team_B_S
Collapse Then - Actions
Unit - Unpause all units
Game - Display to (All players) the text: Team B won the duel...
Leaderboard - Destroy (Last created leaderboard)
Trigger - Turn on Timer <gen>
Trigger - Turn on Revive <gen>
Trigger - Turn off Begin <gen>
Trigger - Turn off (This trigger)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of players in Team_B) Equal to Team_A_S
Collapse Then - Actions
Unit - Unpause all units
Game - Display to (All players) the text: Team A won the duel...
Leaderboard - Destroy (Last created leaderboard)
Trigger - Turn on Timer <gen>
Trigger - Turn on Revive <gen>
Trigger - Turn off Begin <gen>
Trigger - Turn off (This trigger)
Else - Actions
07-31-2007, 07:35 AM#2
xombie
Try crossing your fingers.
07-31-2007, 07:56 AM#3
Pyrogasm
Replace everything up until your Loop in which you pick unit groups with this (your way wasn't working):

Trigger:
Collapse For each (Integer A) from 1 to 12 do (Actions)
Collapse Loop - Actions
Set Highest[(Integer A)] = 0
Collapse For each (Integer B) from 1 to 12 do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
Kills[(Integer B)] Greater than or Equal to Highest[(Integer A)]
Collapse Then - Actions
Set Highest[(Integer A)] = Kills[(Integer B)]
Set HighestIndex[(Integer A)] = (Integer B)
Else - Actions
Set Kills[(HighestIndex[(Integer A)])] = -1
Collapse For each (Integer A) from 1 to 12 do (Actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
((Integer A) mod 2) = 1
Collapse Then - Actions
Player Group - Add (Player(HighestIndex[(Integer A)])) to Team_A
Collapse Else - Actions
Player Group - Add (Player(HighestIndex[(Integer A)])) to Team_B
Player Group - Make Team_A treat Team_B as an Enemy with Shared Vision
Player Group - Make Team_B treat Team_B as an Enemy with Shared Vision
Collapse For each (Integer A) from 1 to 12 do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to 12 do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
(Integer A) = HighestIndex[(Integer B)]
Collapse Then - Actions
Set Kills[(Integer A)] = Highest[(Integer B)]
Else - Actions

Edit: and I don't see why that would crash...
07-31-2007, 08:37 AM#4
botanic
the error is in this portion

Trigger:
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Set Highest[(Integer A)] = 0
Collapse For each (Integer B) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Kills[(Integer B)] Greater than or equal to (Integer A)
Collapse Then - Actions
Set Highest[(Integer A)] = Kills[(Integer B)]
Set Highest_Index[(Integer A)] = (Integer B)
Else - Actions
Set Kills[Highest_Index[(Integer A)]] = -1
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Integer A) mod 2) Equal to 1
Collapse Then - Actions
Player Group - Add (Player(Highest_Index[(Integer A)])) to Team_A
Collapse Else - Actions
Player Group - Add (Player(Highest_Index[(Integer A)])) to Team_B
i cut this out and i dont error
Trigger:
For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Integer A) mod 2) Equal to 1
Collapse Then - Actions
Player Group - Add (Player(Highest_Index[(Integer A)])) to Team_A
Collapse Else - Actions
Player Group - Add (Player(Highest_Index[(Integer A)])) to Team_B