I'm trying to figure out why this trigger isn't working...
My goal with this trigger setup is to be able to use this event(Triggering Region). In the GE it says returns triggering region. With this i planned to create about 5 regions for instances we will say Aplha, beta, bravo. I would than create If / Than / Else statements like the ones below to spawn units for the regions.
Events
Unit - Any Unit Enters (Triggering region)
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering region) == summonreaper
Then
Unit - Create 8 Reaper for player 1 at (Center of GiveRed) facing 270.0 degrees (No Options)
Else
Game - End game in Victory for player 1 (Show dialogs, Show score screen)
Any feedback on this would be great, show me what i'm doing wrong or point me in the directions. Thanks!
I just looked to make sure and yes there is a function - Triggering Region- "Runs a Trigger when a unit enters or leaves a Region(Parameter) returns the triggering region."
So From What I get from that is that it saves the triggering region, and should compare within the If / than / else
well first off any time a unit enter any region the trigger runs. if the region is summon reaper it summons reapers. currently If any unit enters any region and that region isn't summonreaper then player 1 wins. i believe what you want to do is ditch your if then else and put the summon reapers conditional into the normal conditional statement so the trigger only runs if the triggering region is summonreaper.
Edit: and yes use the triggering region event not the triggering unit event.
I just tested it out by having a trigger that would send me a message whenever a unit entered "triggering region". Despite many units entering a number of different regions it was never triggered. This is because until the event is fired, there is no triggering region.
You will want to change your event to:
Unit - Any Unit Enters summonreaper
Then move the unit spawning out of the if statement into the regular action. Then create a seperate trigger for each of the other regions. Alternatively you could have multiple events in one trigger and then use the if statement to select the action to take, but each event entry will need to reference a specific region.
Is there a particular reason you want it all in a single trigger? I think it would be better to put each in its own trigger, then you don't need to worry about if statements. The triggers would be quite simple actually:
Events
Unit - Any Unit Enters reapers
Local Variables
Conditions
Actions
Unit - Create 8 Reaper for player 1 at (Random point in reapers) facing 270.0 degrees (No Options)
Create one for each spawn location, and then put them into a folder for organization.
I'm trying to figure out why this trigger isn't working...
My goal with this trigger setup is to be able to use this event(Triggering Region). In the GE it says returns triggering region. With this i planned to create about 5 regions for instances we will say Aplha, beta, bravo. I would than create If / Than / Else statements like the ones below to spawn units for the regions.
Events
Unit - Any Unit Enters (Triggering region)
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering region) == summonreaper
Then
Unit - Create 8 Reaper for player 1 at (Center of GiveRed) facing 270.0 degrees (No Options)
Else
Game - End game in Victory for player 1 (Show dialogs, Show score screen)
Any feedback on this would be great, show me what i'm doing wrong or point me in the directions. Thanks!
Are you sure you have the Event right? "Unit - Any Unit Enters (Triggering region)" at that point, I do not believe there is a triggering region.
I just looked to make sure and yes there is a function - Triggering Region- "Runs a Trigger when a unit enters or leaves a Region(Parameter) returns the triggering region."
So From What I get from that is that it saves the triggering region, and should compare within the If / than / else
well first off any time a unit enter any region the trigger runs. if the region is summon reaper it summons reapers. currently If any unit enters any region and that region isn't summonreaper then player 1 wins. i believe what you want to do is ditch your if then else and put the summon reapers conditional into the normal conditional statement so the trigger only runs if the triggering region is summonreaper.
Edit: and yes use the triggering region event not the triggering unit event.
Well, i realize that i could do it that way, I was trying to put all the Information for all 5 Regions into one trigger may not be possible.
oh well if you do that then yes do the if then else but get rid of the win function in the else statement.
Hehe Of course, was seeing it would work just picked something and thru it into the else statement for a quick test :D
I just tested it out by having a trigger that would send me a message whenever a unit entered "triggering region". Despite many units entering a number of different regions it was never triggered. This is because until the event is fired, there is no triggering region.
You will want to change your event to: Unit - Any Unit Enters summonreaper
Then move the unit spawning out of the if statement into the regular action. Then create a seperate trigger for each of the other regions. Alternatively you could have multiple events in one trigger and then use the if statement to select the action to take, but each event entry will need to reference a specific region.
Alright, well than my If /than /else wont work cause wanted to use triggering region and...
If
Triggering region == reapers
than
Create 8 blah
Else
If
Triggering region == blah
Creat 8 blah
so on
Is there a particular reason you want it all in a single trigger? I think it would be better to put each in its own trigger, then you don't need to worry about if statements. The triggers would be quite simple actually:
Events
Unit - Any Unit Enters reapers
Local Variables
Conditions
Actions
Unit - Create 8 Reaper for player 1 at (Random point in reapers) facing 270.0 degrees (No Options)
Create one for each spawn location, and then put them into a folder for organization.
Didn't realize there were folder's, I'll do that instead.