Staredit Network

Staredit Network -> UMS Assistance -> Triggers Don't Work
Report, edit, etc...Posted by Zb2k on 2005-06-05 at 00:05:10
I am working on a map right now and I could swear that the triggers are not working they way they should. One could say I am simply doing it wrong but I am 99% sure there is some kind of glitch going on that is causing my triggers to not function properly. What can I do or am I just crazy?
Report, edit, etc...Posted by Screwed on 2005-06-05 at 00:12:53
You're crazy because you didn't try to give information specific to your map or attach it.
At least try to troubleshoot the problem and tell us what wasn't working and the possible factors. Tell us if the trigger fired or not etc.

We can't help if you tell us nothing.

It might possibly be a wait block, but due to not knowing your problem, I don't even know if its a time related problem.
Report, edit, etc...Posted by Zb2k on 2005-06-05 at 00:22:39
QUOTE(Screwed @ Jun 4 2005, 10:12 PM)
You're crazy because you didn't try to give information specific to your map or attach it.
At least try to troubleshoot the problem and tell us what wasn't working and the possible factors. Tell us if the trigger fired or not etc.

We can't help if you tell us nothing.

It might possibly be a wait block, but due to not knowing your problem, I don't even know if its a time related problem.
[right][snapback]226620[/snapback][/right]


Ok man sorry, this is my first post on these forums. Well what I am trying to do is hard to explain. They're many conditions and triggers that follow. It is one of my first serious maps so perhaps I made the triggers overly complicated and confusing.


It is a capture the flag map. Look at the bottom 4 triggers for Player 1. They basically allow that player to go and capture the flag. However, when I copy all those triggers to Player 2(Blue) and change the things that are for player 1 to player 2, like half of the trigger works. It will not alert that that the person captured the flag or stole the flag and maybe a few other things I am forggeting about right now. Take a look at the map if you need to. Thanks a bunch.
Report, edit, etc...Posted by in_a_biskit on 2005-06-05 at 01:50:04
I don't see anything wrong with your 'capture the flag' triggers for players 1 and 2; they should work pretty smoothly.

The problem you get is because of how your triggers for 'All players', 'Top Team', and 'Bottom Team' are designed to show messages for the players.

Note that creating a trigger for 'all players' or for a force is equivalent to creating a trigger that applies to each player in that force, and also equivalent to creating the same trigger for each player in that force.
Note also that triggers are checked player by player, starting from player 1's triggers and going through to player 8.

These two combined mean that in this trigger:
Trigger
Players:
¤ Top Team (P1-3)
Conditions:
¤ 'Red Grab' is set.
Actions:
¤ Display for Current Player: Red has stolen the other team's flag!
¤ Clear 'Red Grab'.
¤ Preserve trigger.

...Player 1 will check this trigger first, will recieve a text message, then clear the switch. Player 2 will check this trigger a short while later, and find that the switch is cleared, so the actions don't run. Player 3 will find the same thing.

This can be fixed by inserting a "Wait for 0 milliseconds" before clearing the switch, to give enough time for players 2 and 3 to check the trigger before the switch is cleared.

In addition, I did notice these things:
  • In -Bottom Team triggers, you have a trigger with condition "Top Stolen is set", and action "set Top stolen". I think it should be "Clear Top Stolen".
  • In player 8's triggers, you have a trigger which turns on shared vision for players 1-6. This will give player 8 the ability to see player 1-6 units, but not the other way round. Is that what you want? Player 8 doesn't seem to play a major role in this map.
  • In player 6's triggers, you have a trigger with two conditions, one of which is "Always". Note that the "Always" condition won't do anything in this case.
  • You have triggers for players 1-3 and 4-6 enabling and disabling invincibility, but you have triggers for -Bottom Team and -Top Team which do exactly the same thing. This isn't a problem, but it is redundant.
  • You have a large number of triggers simply clearing switches at the beginning of the game. Note that switches start off cleared by default. However, if you still want to clear those switches at the beginning of the game by trigger (e.g. to make debugging easier), then it may be easier to combine all of them into one trigger with many switch-clearing actions.
  • There is a trigger for player 4 that turns on shared vision for players 5 and 6, but no corresponding trigger for player 5 or 6. Similarly for players 1-3. Is that supposed to be the case? Note that because the Forces are allied to begin with, the players will start off sharing vision with each other by default.
  • There are triggers for players 1-6 that give anti-camping notices, wait 10 seconds, then kill any units for that player in the flag area. You also clear their 'alive' switches. Note that you're clearing their 'alive' switches regardless of whether their unit has been killed by your trigger or not. You already have separate triggers that clear those switches only if they control no units, so you should remove the switch-clearing actions in the anti-camping triggers.
  • You don't seem to be using any of the 'Player # camp' switches yet.
I hope that helped.
Report, edit, etc...Posted by Zb2k on 2005-06-05 at 02:29:30
QUOTE(in_a_biskit @ Jun 4 2005, 11:50 PM)
I don't see anything wrong with your 'capture the flag' triggers for players 1 and 2; they should work pretty smoothly.

The problem you get is because of how your triggers for 'All players', 'Top Team', and 'Bottom Team' are designed to show messages for the players.

Note that creating a trigger for 'all players' or for a force is equivalent to creating a trigger that applies to each player in that force, and also equivalent to creating the same trigger for each player in that force.
Note also that triggers are checked player by player, starting from player 1's triggers and going through to player 8.

These two combined mean that in this trigger:



Trigger
Players:
¤ Top Team (P1-3)
Conditions:
¤ 'Red Grab' is set.
Actions:
¤ Display for Current Player: Red has stolen the other team's flag!
¤ Clear 'Red Grab'.
¤ Preserve trigger.

...Player 1 will check this trigger first, will recieve a text message, then clear the switch.  Player 2 will check this trigger a short while later, and find that the switch is cleared, so the actions don't run.  Player 3 will find the same thing.

This can be fixed by inserting a "Wait for 0 milliseconds" before clearing the switch, to give enough time for players 2 and 3 to check the trigger before the switch is cleared.

In addition, I did notice these things:

  • In -Bottom Team triggers, you have a trigger with condition "Top Stolen is set", and action "set Top stolen".  I think it should be "Clear Top Stolen".
  • In player 8's triggers, you have a trigger which turns on shared vision for players 1-6.  This will give player 8 the ability to see player 1-6 units, but not the other way round.  Is that what you want?  Player 8 doesn't seem to play a major role in this map.
  • In player 6's triggers, you have a trigger with two conditions, one of which is "Always".  Note that the "Always" condition won't do anything in this case.
  • You have triggers for players 1-3 and 4-6 enabling and disabling invincibility, but you have triggers for -Bottom Team and -Top Team which do exactly the same thing.  This isn't a problem, but it is redundant.
  • You have a large number of triggers simply clearing switches at the beginning of the game.  Note that switches start off cleared by default.  However, if you still want to clear those switches at the beginning of the game by trigger (e.g. to make debugging easier), then it may be easier to combine all of them into one trigger with many switch-clearing actions.
  • There is a trigger for player 4 that turns on shared vision for players 5 and 6, but no corresponding trigger for player 5 or 6.  Similarly for players 1-3.  Is that supposed to be the case?  Note that because the Forces are allied to begin with, the players will start off sharing vision with each other by default.
  • There are triggers for players 1-6 that give anti-camping notices, wait 10 seconds, then kill any units for that player in the flag area.  You also clear their 'alive' switches.  Note that you're clearing their 'alive' switches regardless of whether their unit has been killed by your trigger or not.  You already have separate triggers that clear those switches only if they control no units, so you should remove the switch-clearing actions in the anti-camping triggers.
  • You don't seem to be using any of the 'Player # camp' switches yet.
I hope that helped.
[right][snapback]226728[/snapback][/right]

You don't seem to be using any of the 'Player # camp' switches yet.
I know, I thought I need those to do the anti-camp trigger but then realized that I didn't.
There are triggers for players 1-6 that give anti-camping notices, wait 10 seconds, then kill any units for that player in the flag area. You also clear their 'alive' switches. Note that you're clearing their 'alive' switches regardless of whether their unit has been killed by your trigger or not. You already have separate triggers that clear those switches only if they control no units, so you should remove the switch-clearing actions in the anti-camping triggers.
I think I did for players 1-3 but forgot to do it for 4-6.


Other than that, thank you so much, because I would have never figured out the Wait 0 ms trigger if you didn't tell me. You're a lifesaver wink.gif

Also, maybe I am doing the hyper triggers wrong because the triggers to kill the overlords seems to stall.

Another thing, look at the triggers defining that if a player dies with the flag, the flag respawns in ten seconds, while the player respawns in 15 seconds. The flag always repawns after the player, which shouldn't happen.
Report, edit, etc...Posted by The_Shattered_moose on 2005-06-05 at 14:01:21
The problem with the slowness on the flag respawn could be a wait block (2+ waits running on the same player)
Report, edit, etc...Posted by Zb2k on 2005-06-05 at 15:38:04
Ok biskit, something else is wrong. Even before I posted this thread, it would display "Red has stolen the other team's flag" and it would do the same for blue w/o the Wait 0 ms triggers.

But even with the wait 0 ms triggers it would still not display for teal. In fact, I deleted the "Clear Teal Grab" action altogether, and it still did not work. confused.gif

BTW: Everything else in those triggers works as they are supposed to. I Pm'ed you the map.
Report, edit, etc...Posted by in_a_biskit on 2005-06-06 at 05:16:02
QUOTE(Zb2k @ Jun 5 2005, 04:29 PM)
Also, maybe I am doing the hyper triggers wrong because the triggers to kill the overlords seems to stall.

Another thing, look at the triggers defining that if a player dies with the flag, the flag respawns in ten seconds, while the player respawns in 15 seconds. The flag always repawns after the player, which shouldn't happen.
[right][snapback]226782[/snapback][/right]

Your hypertriggers are fine.

Every trigger you have that creates overlords also kills them immediately in the same trigger. Most of the time you should not see the overlord itself, but it is possible still for you to see maybe a single frame of a live non-exploding overlord; you can't do much to stop this from happening.

You are experiencing what is somtimes called a 'wait block'. Wait actions are blocking actions.
QUOTE(Blizzard Entertainment @ Starcraft Campaign Editor Help)
The wait action is used to delay other actions for the specified number of milliseconds.  Because it is a blocking action, no other actions in the same trigger and no other blocking actions in other triggers will activate until it is done.

Which means that if one wait action is running, then no other wait action is allowed to run for the same player at the same time, until that wait action has finished.

Here's what happens:
1. Your Flag Runner dies.
2. Starcraft checks its trigger list from top to bottom, and finds and runs this trigger:



Trigger
Conditions:
¤ Current player commands at most 0 Flag Runner
Actions:
¤ Clear Player1Alive
¤ Preserve

3. Starcraft continues checking the trigger list, and finds:



Trigger
Conditions:
¤ Player1Alive is cleared.
Actions:
¤ Display text for Current Player
¤ Show minimap ping for current player
¤ Wait for 15000 milliseconds
¤ Create 1 Flag Runner at 'Top respawn' for Current player
¤ Display text for current player
¤ Set Player1Alive
¤ Preserve.

It runs the first two actions, and begins to wait for 15 seconds.
4. Meanwhile, it continues checking the rest of the triggers and finds:



Trigger
Conditions:
¤ Current player commands at most 0 Flag Runner
¤ Player 1 Flag is set
Actions:
¤ Clear Player 1 Flag
¤ Wait for 10000 milliseconds
¤ Create 1 flag for current player at 'bottom flag' for player 8
¤ Set 'Bottom Flag Just Returned'
¤ Set 'Bottom Flag Safe'
¤ Preserve.

It runs the first action and then finds a wait action.
However, it is already running the 15 second wait action from the earlier trigger, so it can't run the second wait action yet.
5. Only when the first 15 second wait action has finished does the second 10 second wait action start. The 15 second wait finishes, so the player respawns.
6. The ten second wait finishes in another ten seconds, and then the flag respawns.

We call this a wait block because the wait actions block each other from running.

To fix this, you might:
  • Put the flag respawn trigger before the player respawn trigger
  • Put the flag respawn and player respawn triggers into one trigger for the player dying with the flag. You need a separate trigger for if the player dies without the flag - this can be the same as your existing trigger with the extra condition "'Player 1 Flag' is cleared".
  • Use a transmission instead of one of the wait actions. Transmissions are blocking actions like wait actions, so you can use them just like waits, but apparently wait actions and transmissions won't block each other; they will only block actions of the same type as themselves (I haven't tested this personally).


For a more complicated solution, use a death-counter timer or a 'physical timer'.
(We have tutorials for everything!)

QUOTE(Zb2k @ Jun 6 2005)
Ok biskit, something else is wrong. Even before I posted this thread, it would display "Red has stolen the other team's flag" and it would do the same for blue w/o the Wait 0 ms triggers

But even with the wait 0 ms triggers it would still not display for teal. In fact, I deleted the "Clear Teal Grab" action altogether, and it still did not work.

Do I have the lastest working version of your map? If I don't, could you post it or PM it please?

Do you mean that the text would display when red or blue captured the flag, but not when teal captured the flag?
(psst... you haven't copied the 'capture the flag' triggers to players 3-6 yet; you've only done it for players 1 and 2)
Make sure that you have an action in your 'capture the flag' trigger that sets the switch 'Teal Grab'.

Or do you mean that "Red has stolen the other team's flag" displays for the red and blue players, but not for the teal player?
In that case, I would find it very strange - it shouldn't do that in the version that I have. Test it again to see if it still happens.
Report, edit, etc...Posted by Zb2k on 2005-06-06 at 16:47:11
I sent you a PM.

I mean that when red captures the flag it will say "Red has stolen the other teams flag!". When blue stole the flag, it would also work saying "Blue has stolen the other team's flag!"

But it will NOT display it when teal steals the flag. I am sure it is being told to activate, but it does not. However, for experimental purposes I simply made a trigger


null
Trigger
Players:
¤ All Players
Conditions:
¤ Always
Actions:
¤ Set 'Teal Grab'


and the trigger DID acitivate. But I do not know why it will not work when I try to set the switch in the triggers that allow teal to capture the flag(where I am trying to make it work). I have heard that setting multiple switches at once can cause problems, but I don't see why it should here because I am using identical triggers for red and blue (of course changing certain things to the appropriate player, like instead of 'Teal Grab' it is 'Red Grab'.)

I have not tried to get these triggers to work for the bottom team force.
Report, edit, etc...Posted by in_a_biskit on 2005-06-07 at 09:19:56
I don't see a map attached to the PM...

Who does the text display for? All of the Top team?

Is teal actually capturing the flag? (i.e. does the flag disappear? Can teal gain points for the Top Team?)

In the version I currently have, you don't have 'capture the flag' triggers for player 3.
That means that there are no triggers that will set 'Teal Grab'.

If you copy and translate the same triggers you made for player 1 to player 3, there shouldn't be a problem
Report, edit, etc...Posted by Zb2k on 2005-06-07 at 16:36:51
Who does the text display for? All of the Top team?

It displays for top team as "Teal has stolen the other team's flag!"

The Bottom Team gets the display "Teal has stole your team's flag.

Is teal actually capturing the flag? (i.e. does the flag disappear? Can teal gain points for the Top Team?)

Yes. That is why I get so confused.

In the version I currently have, you don't have 'capture the flag' triggers for player 3.
That means that there are no triggers that will set 'Teal Grab'.

If you copy and translate the same triggers you made for player 1 to player 3, there shouldn't be a problem


I know, of course I copied the triggers from player 1 to player 2, and player 2 to player 3. And I changed whatever I need to, to suit the player (i.e 'Blue Grab' to 'Teal Grab') The messages displaying and the sounds playing does not work. I have copied the triggers more than once.
Report, edit, etc...Posted by in_a_biskit on 2005-06-08 at 04:16:53
Does this problem always occur?

I'm currently stumped...
(At the moment you've stuck lots of wait actions all over teal's 'capture the flag' trigger. Have you tried it both with and without those extra wait actions?)

Also:
  • In your triggers for All players, Player 1 gets pinged every 500 milliseconds, whilst every other player gets pinged every 300 milliseconds.
  • You probably want 'wait 0' actions before clearing 'Top flag just returned' in that trigger for All players.
  • You don't clear the switches 'Blue grab' or 'Teal grab' in your Top Team triggers.
    You don't clear 'Teal grab' in your Bottom Team triggers.
  • You probably want a 'wait 0' action before clearing 'Top flag just returned' in that trigger for All players.

Test it again...
For which players does the text display?
What does player 1 see?
What does player 2 see?
What does player 3 see?
Is there any other differences in gameplay - Is it only that the text doesn't display, or are all of teal's triggers slow, or is there any other problem?
Is it only a problem when someone is respawning, or something else is happening?

Try deleting the trigger and making it again.

I can't tell what the problem is just looking at the triggers...:S Hopefully a bit more testing will help.
Report, edit, etc...Posted by Zb2k on 2005-06-08 at 12:01:04
QUOTE(in_a_biskit @ Jun 8 2005, 02:16 AM)
Does this problem always occur?

I'm currently stumped...
(At the moment you've stuck lots of wait actions all over teal's 'capture the flag' trigger.  Have you tried it both with and without those extra wait actions?)

Also:

  • In your triggers for All players, Player 1 gets pinged every 500 milliseconds, whilst every other player gets pinged every 300 milliseconds.
  • You probably want 'wait 0' actions before clearing 'Top flag just returned' in that trigger for All players.
  • You don't clear the switches 'Blue grab' or 'Teal grab' in your Top Team triggers.
    You don't clear 'Teal grab' in your Bottom Team triggers.
  • You probably want a 'wait 0' action before clearing 'Top flag just returned' in that trigger for All players.

Test it again...
For which players does the text display?
What does player 1 see?
What does player 2 see?
What does player 3 see?
Is there any other differences in gameplay - Is it only that the text doesn't display, or are all of teal's triggers slow, or is there any other problem?
Is it only a problem when someone is respawning, or something else is happening?

Try deleting the trigger and making it again.

I can't tell what the problem is just looking at the triggers...:S Hopefully a bit more testing will help.
[right][snapback]229447[/snapback][/right]


I have tried it without any of the wait 0 MS triggers in teal's triggers. The text displays for no one, and I don't see why I would need the wait triggers for teal but not blue or red but I put them there anyway just to test it out. I really think this is some kind of glitch.
Next Page (1)