Staredit Network

Staredit Network -> UMS Assistance -> Triggers' launching rules
Report, edit, etc...Posted by DooM77 on 2006-09-18 at 14:51:08
We have such triggers in that order:


1. Conditions:
- ...
Actions:
- set switch1

2. Conditions:
- switch1 is set
- ...
Actions:
Clear switch1

3. Conditions:
- switch1 is set
Actions:
- ...

And now: do I have a 100% sure that 2nd trigger will finish clearing switch1 before trigger 3 will check its state? Initially I thought that triggers with the same conditions are running almost at the same time and the order they're placed in staredit don't have real impact. Was I wrong? Does staredit care about whether all actions of trigger above are completed before attempting to do new trigger?

In other words: do I get 100% reliable information from trigger 3 about whether conditions from trigger 2 were passed or not?

Report, edit, etc...Posted by xmrxsiegecopx on 2006-09-18 at 15:09:31
Trigger 3 will never run unless a delay action preceeds the clear switch in trigger 2.

StarCraft reads independent player triggers from top to bottom, while group triggers are actually invisible player triggers that are much more difficult to order (unless remade as a independent player trigger). Waits forces StarCraft to recheck the triggers (which is why hypers speed up trigger reading).
Report, edit, etc...Posted by JaFF on 2006-09-18 at 15:25:24
QUOTE(DooM77 @ Sep 18 2006, 09:50 PM)
We have such triggers in that order:
1. Conditions:
  - ...
  Actions:
  - set switch1

2. Conditions:
  - switch1 is set
  - ...
  Actions:
  Clear switch1

3. Conditions:
  - switch1 is set
    Actions:
    - ...

And now: do I have a 100% sure that 2nd trigger will finish clearing switch1 before trigger 3 will check its state? Initially I thought that triggers with the same conditions are running almost at the same time and the order they're placed in staredit don't have real impact. Was I wrong? Does staredit care about whether all actions of trigger above are completed before attempting to do new trigger?

In other words: do I get 100% reliable information from trigger 3 about whether conditions from trigger 2 were passed or not?
[right][snapback]563210[/snapback][/right]

The trigger order does matter. In the case that you showed, trigger 3 will never run because trigger 2 will run before it (if it has no waits before the "clear switch"). Triggers that are set to the same player are scanned in the order they are created.
Report, edit, etc...Posted by DooM77 on 2006-09-18 at 15:40:38
In that case I suppose I developed - if no one did it before - one important thing. Conditions in Staredit are "linked by 'and' operator": if Con1 AND Con2 AND Con3 AND... are True then do Actions. Some situations require alternative rather then conjunction (firefrat in response to my thread said that something like WC3's events where only one must be filled to run actions would be very useful). I think I know how to do it.

While Standard Conditioned Trigger looks like that:

Conditions:
Con1,2,3...
Actions:
Act1,2,3...

Alternative Conditioned Trigger looks like that:

1.Activating trigger
Conditions:
(optional conditions reducing launching it if possible)
Actions:
set switch1

2. Conditions' trigger
Conditions:
NOT Con1
NOT Con2
NOT Con3
...
Actions:
Clear Switch1

3.Actions' trigger
Conditions:
Switch1 is set
Actions:
Act1,2,3,...


For example:
Some actions should be done at Bringing Marine to one of 10 beacon. In standard way it would be:

Bring to L1 - list of actions
Bring to L2 - list of actions
Bring to L3 - list of actions
...
Bring to L10 - list of actions

In best case:

Bring to L1 - set Switch1
Bring to L2 - set Switch1
Bring to L3 - set Switch1
...
Bring to L10 - Set switch1

Switch1 is set - Clear Switch1, list of actions

----------------------------------------------------------------------------

Using alternative conditioned trigger it's maximally only 4 triggers:

(1.
Always - center location M1 at marine)
2.
(Brings beacon to M1) - set S1
3.
Conditions
Brings exacly 0 Marine to L1
Brings exacly 0 marine to L2
Brings exacly 0 marine to L3
...
Brings exacly 0 marine to L10
Actions
Clear S1
4.
S1 is set - list of actions


Was it known before? I think that form is more pure and easier to maintenace.
Report, edit, etc...Posted by JaFF on 2006-09-18 at 16:01:57
In other words, you're suggesting to separate the 10 condition-triggers and one action-trigger for easy use ?

I'm sure a lot of people used it, but didn't discuss that in a topic because it seemed usual for them tongue.gif
Report, edit, etc...Posted by DooM77 on 2006-09-18 at 16:08:11
Hmm... Ok. But it's a pity :]. It wasn't so usual for me when it crossed my mind.

ADDITION:
Hmm, actually im not suggesting to separate 10 Condition triggers and one action triggers, im not sure you understood me well. Im suggesting to push all these 10 conditions to one trigger!
Report, edit, etc...Posted by JaFF on 2006-09-18 at 16:08:37
Many things will seem like a discovery, and most probably, non of them really will be a discovery.

... Only a small discovery of something for yourself...
Report, edit, etc...Posted by DooM77 on 2006-09-18 at 16:10:53
Yepp, you're right. Nowadays it needs to be a genius to make a real discovery. Everything in range of ordinal people was already invented ;S.
Report, edit, etc...Posted by fritfrat(U) on 2006-09-18 at 16:18:59
In warcraft III, they have events, conditions, actions. If atleast 1 event occurs, it checks to make sure all of the conditions are set; if they are, then it runs the actions.

To make this, you could simply have an Always: Set switch 1. Then, if all conditions are NOT met, clear switch 1. For conditions you cant just reverse like that you'd have to just add in their own trigger to set switch 1. Then, the Warcraft III conditions would be present with adding them next to the condition Switch 1 is Set in the actual trigger with the actions.
Next Page (1)