| 07-14-2003, 08:01 PM | #1 |
I have 2 triggers, each governing defeat or victory for the time when players can be either in the settler stage (no buildings) or economic stage (buildings). When everyone is in the economic stage, another trigger that works switches over the conditions to Melee Game ones. What happens with the two non-working triggers is that they won't respond when I believe they should until no one on the map has any units at all. Then, it keeps doing "Victory! Defeat! Victory! Defeat! Victory! Defeat!" due to the periodic event. Here's the two triggers that don't work- First one. Condition: GameRunning equal to True (it's set to true after 50 seconds) Code:
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Set playerallyarray[(Integer A)] = (All allies of (Player((Integer A))))
Unit Group - Add all units of (Units owned by (Player((Integer A))) matching ((((Matching unit) is A structure) Equal to True) or (((Unit-type of (Matching unit)) Equal to Civilian Construction Worker) or ((Unit-type of (Matching unit)) Equal to Settler)))) to LOSSFriendlyUnitsAlive
Set LOSSPlayersInAllyGroupNum = (Number of players in playerallyarray[(Integer A)])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
LOSSPlayersInAllyGroupNum Not equal to 0
Then - Actions
For each (Integer B) from 1 to LOSSPlayersInAllyGroupNum, do (Actions)
Loop - Actions
Set LOSSRandomAlly = (Random player from playerallyarray[(Integer A)])
Unit Group - Add all units of (Units owned by LOSSRandomAlly matching ((((Matching unit) is A structure) Equal to True) or (((Unit-type of (Matching unit)) Equal to Civilian Construction Worker) or ((Unit-type of (Matching unit)) Equal to Settler)))) to LOSSFriendlyUnitsAlive
Player Group - Remove LOSSRandomAlly from playerallyarray[(Integer A)]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in LOSSFriendlyUnitsAlive) Equal to 0
Then - Actions
Game - Defeat (Player((Integer A))) with the message: Defeat!
Else - Actions
Else - ActionsSecond one. Same condition. Code:
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Set playerenemiesarray[(Integer A)] = (All enemies of (Player((Integer A))))
Set WINplayersInAllyGroupNum = (Number of players in playerenemiesarray[(Integer A)])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WINplayersInAllyGroupNum Not equal to 0
Then - Actions
For each (Integer B) from 1 to WINplayersInAllyGroupNum, do (Actions)
Loop - Actions
Set WINrandomenemy = (Random player from playerenemiesarray[(Integer A)])
Unit Group - Add all units of (Units owned by WINrandomenemy matching ((((Matching unit) is A structure) Equal to True) or (((Unit-type of (Matching unit)) Equal to Civilian Construction Worker) or ((Unit-type of (Matching unit)) Equal to Settler)))) to WINEnemyUnitsAlive
Player Group - Remove WINrandomenemy from playerenemiesarray[(Integer A)]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in WINEnemyUnitsAlive) Equal to 0
Then - Actions
Game - Victory (Player((Integer A))) (Show dialogs, Show scores)
Else - Actions
Else - Actions |
| 07-15-2003, 01:23 AM | #2 |
Bah, nevermind- I forgot to clear the groups before re-running the trigger- thus, if you/your enemies EVER had buildings, you can't lose/win. Fixed up. Thanks to anyone that thought about responding..? |
| 07-15-2003, 01:57 PM | #3 |
Guest | maybe you wait that people actually get a chance to respond, even if they do NOT camp the forum 24/7 my advise is to add TEXT actions after EVERY single step (including values of any random number and other stuff). and maybe some WAIT actions to get actually a clue whats working when u play helps me most of the time to find bugs in triggers. |
| 07-15-2003, 04:56 PM | #4 |
Bloodlust, it wasn't my intention to appear hostile, I just didn't want anyone to waste time on responding. -- And I do outputs a lot. |
