HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Check

06-29-2006, 05:18 AM#1
Kevin
This trigger was awarding everyone a victory in the duel.

Please tell me what is wrong with this.

This trigger is the end of my dueling section. It is supposed to detect who is left alive inside a region. If allies of player 1 are alive then everyone in player 1 wins.

If anyone else from another team is in the dueling region the trigger is supposed to just cycle back and recheck.

There are about 50 million ways to go for me to try and solve it through trial and error, but I'm tired and I want my map to be up and operational at least by the weekend.

Please tell me what is wrong with this trigger tyvm :D

I believe everything else concerning my duel structure works perfectly.

Trigger:
Duel End
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units in Duel Arena <gen>) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) belongs to an ally of Player 1 (Red)) Equal to False
((Picked unit) belongs to an ally of Player 2 (Blue)) Equal to True
((Picked unit) belongs to an ally of Player 3 (Teal)) Equal to False
Collapse Then - Actions
Trigger - Run Enable Disable <gen> (checking conditions)
Player - Add 300 to (Owner of (Picked unit)) Current lumber
Hero - Modify Strength of (Picked unit): Add 2
Hero - Modify Agility of (Picked unit): Add 2
Hero - Modify Intelligence of (Picked unit): Add 2
Game - Display to (All players) for 20.00 seconds the text: The Ego has Conquer...
Unit - Move (Picked unit) instantly to (Random point in Last Chance <gen>)
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 2.00 seconds
Trigger - Turn off Duel End <gen>
Trigger - Run Enable Control <gen> (checking conditions)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) belongs to an ally of Player 1 (Red)) Equal to False
((Picked unit) belongs to an ally of Player 2 (Blue)) Equal to False
((Picked unit) belongs to an ally of Player 3 (Teal)) Equal to True
Collapse Then - Actions
Trigger - Run Enable Disable <gen> (checking conditions)
Player - Add 300 to (Owner of (Picked unit)) Current lumber
Hero - Modify Strength of (Picked unit): Add 2
Hero - Modify Agility of (Picked unit): Add 2
Hero - Modify Intelligence of (Picked unit): Add 2
Game - Display to (All players) for 20.00 seconds the text: The Super Ego has C...
Unit - Move (Picked unit) instantly to (Random point in Last Chance <gen>)
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 2.00 seconds
Trigger - Turn off Duel End <gen>
Trigger - Run Enable Control <gen> (checking conditions)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True
((Picked unit) belongs to an ally of Player 2 (Blue)) Equal to False
((Picked unit) belongs to an ally of Player 3 (Teal)) Equal to False
Collapse Then - Actions
Trigger - Run Enable Disable <gen> (checking conditions)
Player - Add 300 to (Owner of (Picked unit)) Current lumber
Hero - Modify Strength of (Picked unit): Add 2
Hero - Modify Agility of (Picked unit): Add 2
Hero - Modify Intelligence of (Picked unit): Add 2
Game - Display to (All players) for 20.00 seconds the text: The ID has Conquere...
Unit - Move (Picked unit) instantly to (Random point in Last Chance <gen>)
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 2.00 seconds
Trigger - Turn off Duel End <gen>
Trigger - Run Enable Control <gen> (checking conditions)
Collapse Else - Actions
Do nothing
Wait 5.00 seconds
Trigger - Run (This trigger) (checking conditions)
06-29-2006, 05:21 AM#2
harshateja
I'm too tired to look through it completely but just a side note, Pick Every Unit will pick up recently dead (I think decaying) units too. You're gonna want to run a check whether its dead. I'm just too tired to think of the constant right now...
06-29-2006, 05:34 AM#3
Kevin
I have another trigger which resurrects units killed in the dueling arena in a safe zone before disabling the controlling player's controls.

The problem with this trigger is that when it runs after 5 seconds it declares everyone as a winner.

I need to somehow check for units in the region, if the only units in the region belong to an ally of Player 1 then all allies of player 1 win, if they are player 2, then all allies of player 2 wins, same for player 3
06-29-2006, 05:54 AM#4
Alevice
First off, you don't really need the last two actions. That's what your event is for, it does the check every 5 seconds for you!

I would use a boolean array, each index representing a player slot.

Something like
Trigger:
Trigger
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 0 to 11, do (Actions)
Collapse Loop - Actions
Set PlayerLost[(Integer A)] = True
Collapse Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Collapse Loop - Actions
Collapse For each (Integer A) from 0 to 11, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Picked unit)) Equal to (Player(((Integer A) + 1)))
Collapse Then - Actions
Set PlayerLost[(Integer A)] = False
Collapse Else - Actions
Do nothing
06-29-2006, 06:13 AM#5
Rising_Dusk
I think you should just try it without the last two actions.
As you have it, you're creating hundreds of threads per minute, which will cause massive problems in the long run (And make it extremely leaky/laggy).

Try it without the last two and give us an update.
Also, you never specified WHICH PART of the trigger wasn't working, so we have no idea what to look for in checking over it.
That might help us out a bit. :P
06-29-2006, 07:56 AM#6
Kevin
The muses are with me tonight.

Somehow the problem was picking the units.

I was stupid and thinking forward, I forget, computers have to think backward in order to compare.

this is what I wound up having to do in order to create a test for who's left alive in the region.

And just so you know I clear the variables (euqal them out to 0) during the duel initialization. I thought I'd share the working end trigger so you guys understood what I was on about.

btw tyvm. :D I'll be play testing my map now on Lordaeron server. Look for my name (morticom)

I'll be signed on each night in order to play my map and distribute it yay!:D

Trigger:
Duel End
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Set duel_idwins = (((((duel_8dead + duel_6dead) + duel_3dead) + duel_2dead) + duel_7dead) + duel_9dead)
Set duel_egowins = (((((duel_8dead + duel_6dead) + duel_3dead) + duel_5dead) + duel_4dead) + duel_1dead)
Set duel_superegowins = (((((duel_5dead + duel_4dead) + duel_1dead) + duel_2dead) + duel_7dead) + duel_9dead)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 9 (Gray))) Equal to 0
Collapse Then - Actions
Set duel_9dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 8 (Pink))) Equal to 0
Collapse Then - Actions
Set duel_8dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 7 (Green))) Equal to 0
Collapse Then - Actions
Set duel_7dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 6 (Orange))) Equal to 0
Collapse Then - Actions
Set duel_6dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 5 (Yellow))) Equal to 0
Collapse Then - Actions
Set duel_5dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 4 (Purple))) Equal to 0
Collapse Then - Actions
Set duel_4dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 3 (Teal))) Equal to 0
Collapse Then - Actions
Set duel_3dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 2 (Blue))) Equal to 0
Collapse Then - Actions
Set duel_2dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in Duel Arena <gen> owned by Player 1 (Red))) Equal to 0
Collapse Then - Actions
Set duel_1dead = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
duel_idwins Equal to 6
Collapse Then - Actions
Collapse Unit Group - Pick every unit in (Units in Duel Arena <gen>) and do (Actions)
Collapse Loop - Actions
Trigger - Run Enable Disable <gen> (checking conditions)
Player - Add 300 to (Owner of (Picked unit)) Current lumber
Hero - Modify Strength of (Picked unit): Add 2
Hero - Modify Agility of (Picked unit): Add 2
Hero - Modify Intelligence of (Picked unit): Add 2
Game - Display to (All players) for 20.00 seconds the text: The ID has Conquere...
Unit - Move (Picked unit) instantly to (Random point in Last Chance <gen>)
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 2.00 seconds
Trigger - Turn off Duel End <gen>
Trigger - Run Enable Control <gen> (checking conditions)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
duel_egowins Equal to 6
Collapse Then - Actions
Collapse Unit Group - Pick every unit in (Units in Duel Arena <gen>) and do (Actions)
Collapse Loop - Actions
Trigger - Run Enable Disable <gen> (checking conditions)
Player - Add 300 to (Owner of (Picked unit)) Current lumber
Hero - Modify Strength of (Picked unit): Add 2
Hero - Modify Agility of (Picked unit): Add 2
Hero - Modify Intelligence of (Picked unit): Add 2
Game - Display to (All players) for 20.00 seconds the text: The Ego has Conquer...
Unit - Move (Picked unit) instantly to (Random point in Last Chance <gen>)
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 2.00 seconds
Trigger - Turn off Duel End <gen>
Trigger - Run Enable Control <gen> (checking conditions)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
duel_superegowins Equal to 6
Collapse Then - Actions
Collapse Unit Group - Pick every unit in (Units in Duel Arena <gen>) and do (Actions)
Collapse Loop - Actions
Trigger - Run Enable Disable <gen> (checking conditions)
Player - Add 300 to (Owner of (Picked unit)) Current lumber
Hero - Modify Strength of (Picked unit): Add 2
Hero - Modify Agility of (Picked unit): Add 2
Hero - Modify Intelligence of (Picked unit): Add 2
Game - Display to (All players) for 20.00 seconds the text: The Super Ego has C...
Unit - Move (Picked unit) instantly to (Random point in Last Chance <gen>)
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 2.00 seconds
Trigger - Turn off Duel End <gen>
Trigger - Run Enable Control <gen> (checking conditions)
Collapse Else - Actions
Do nothing