Hi,
i have this trigger which activates when a unit enters a certain area, there are multiple areas actually under the events, so a unit enters any of these areas, and it should start the actoins. But the game just crashes instead. It doesn't even get to the first action, which i set to disaplay a text message. The trigger has two local variables, and one condition (owner of triggering unit != 15). I thought maybe its because i have multiple areas but i also have another trigger which is defined exactly the same way, just the action are a little different, and that works fine. Any ideas?
I'm not good with crashes (can't hurt to have a look though), but you really have to give more information about the problem for people to be able to help (assuming it's not a widely known bug in the editor or something)
Copy the trigger (rightclick, copy as text) and maybe include a screenshot of the triggering areas. Anything relating to the trigger helps.
Multiple events are no problem, they are basically treated as separate triggers. One of the events occur, trigger fires.
Events
Unit - (Triggering unit) Enters West:EnemyInc1
Unit - (Triggering unit) Enters West:EnemyInc2
Unit - (Triggering unit) Enters West:EnemyInc3
Unit - (Triggering unit) Enters West:EnemyInc4
Unit - (Triggering unit) Enters West:EnemyInc5
Unit - (Triggering unit) Enters West:EnemyInc6
Unit - (Triggering unit) Enters temp
Local Variables
current region = No Region <Region>
indexSpawn = 0 <Integer>
Conditions
(Owner of (Triggering unit)) != 15
Actions
UI - Display "thor 1" for (All players) to Subtitle area
Variable - Set current region = (Triggering region)
UI - Display "thor 2" for (All players) to Subtitle area
General - For each integer indexSpawn from 0 to 6 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
West:EnemyIncRegion[indexSpawn] == current region
Then
General - Break
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
West:SpawnActivated[indexSpawn] == false
Then
Variable - Set West:SpawnActivated[indexSpawn] = true
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
current region == temp
Then
UI - Display "got to 2 " for (All players) to Subtitle area
West:SpawnThor(indexSpawn)
General - Else if (Conditions) then do (Actions)
Else If
current region == West:EnemyInc6
Then
West:SpawnTank(indexSpawn)
General - Else if (Conditions) then do (Actions)
Else If
current region == West:EnemyInc5
Then
West:SpawnThorGhost(indexSpawn)
General - Else if (Conditions) then do (Actions)
Else If
current region == West:EnemyInc1
Then
West:SpawnTankMarauder(indexSpawn)
General - Else if (Conditions) then do (Actions)
Else If
Or
Conditions
current region == West:EnemyInc2
current region == West:EnemyInc3
Then
West:SpawnHelion(indexSpawn)
General - Else if (Conditions) then do (Actions)
Else If
current region == East:EnemyInc4
Then
West:SpawnMarauder(indexSpawn)
Else
Hopefully its readable, and the picture is attached, 'temp' is the problem region.
You can't use "Triggering Unit" in an event, because it is not defined there. You have to use "Any Unit enters" instead. This event defines the "Triggering Unit", so you can refer to it in the "Conditions" and "Actions" sections.
Triggering unit works in events? By definition, the trigger has not triggered yet, so there should be no triggering unit to recall. Could it be using an old trigger's triggering unit? I guess the triggering unit could be already defined since something has entered the region. But you should really use "Any Unit" or something else.
Other than that, I can't find anything that should crash the game. Usually you'll just get an error message (red text on the left side of the screen)
If you paste your triggers and other things in [ code] [ /code] tags (without the spaces), it's a bit easier to read. But either way works.
im an idiot.... in one of the functions that gets called purpose is to spawn unit periodically, i forgot a wait statement at the end, and it was trying to spawn infinite amount of units at the same time...sorry to bother u guys
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi, i have this trigger which activates when a unit enters a certain area, there are multiple areas actually under the events, so a unit enters any of these areas, and it should start the actoins. But the game just crashes instead. It doesn't even get to the first action, which i set to disaplay a text message. The trigger has two local variables, and one condition (owner of triggering unit != 15). I thought maybe its because i have multiple areas but i also have another trigger which is defined exactly the same way, just the action are a little different, and that works fine. Any ideas?
I'm not good with crashes (can't hurt to have a look though), but you really have to give more information about the problem for people to be able to help (assuming it's not a widely known bug in the editor or something)
Copy the trigger (rightclick, copy as text) and maybe include a screenshot of the triggering areas. Anything relating to the trigger helps.
Multiple events are no problem, they are basically treated as separate triggers. One of the events occur, trigger fires.
You can't use "Triggering Unit" in an event, because it is not defined there. You have to use "Any Unit enters" instead. This event defines the "Triggering Unit", so you can refer to it in the "Conditions" and "Actions" sections.
Nope that didn't work, and btw triggering unit does work though. I've used it for all my other events and they work.
Triggering unit works in events? By definition, the trigger has not triggered yet, so there should be no triggering unit to recall. Could it be using an old trigger's triggering unit? I guess the triggering unit could be already defined since something has entered the region. But you should really use "Any Unit" or something else.
Other than that, I can't find anything that should crash the game. Usually you'll just get an error message (red text on the left side of the screen)
If you paste your triggers and other things in [ code] [ /code] tags (without the spaces), it's a bit easier to read. But either way works.
sigh.. alright thanks for the input
im an idiot.... in one of the functions that gets called purpose is to spawn unit periodically, i forgot a wait statement at the end, and it was trying to spawn infinite amount of units at the same time...sorry to bother u guys