Staredit Network

Staredit Network -> UMS Assistance -> Switches' firing orders
Report, edit, etc...Posted by fm47 on 2005-12-06 at 23:42:07
Ok, If I have this:


Trigger
Description:
To always randomize 'Switch 1'
Conditions:
¤ Always.
Actions:
¤ Randomize 'Switch 1'.
¤ Preserve Triggers.



Trigger
Description:
Actions done when 'Switch 1' is cleared
Conditions:
¤ 'Switch 1' is Cleared.
Actions:
¤ Set resources. Add 'Current Player' 1 Minerals.
¤ Randomize 'Switch 1'



Trigger
Description:
Actions done when 'Switch 1' is set
Conditions:
¤ 'Switch 1' is Set.
Actions:
¤ Set resources. Subtract 'Current Player' 1 Minerals.
¤ Randomize 'Switch 1'



Ok so my question is that would the first set of triggers fire more than once before any of the other two are fired, or would it the first one fire, then the first one and either the second or third one fire at the same time, and if fires at the same time, will I still get two results?
Report, edit, etc...Posted by Diggidoyo on 2005-12-07 at 01:35:54
Becuase everything is happening so fast there might be some side effects apart from the effect you're trying to acheive. Maybe if you add a wait action into the first trigger, before the preserve trigger, it would make it go smoother.
Report, edit, etc...Posted by fm47 on 2005-12-07 at 02:08:24
wait as in
wait 0,
wait 1
wait 1000?
Report, edit, etc...Posted by Rantent on 2005-12-07 at 03:34:15
Thats a weird idea, the minerals would randomly rise and fall...
Triggers run through from top to bottom, and then restart at the top again.
So it would randomize for one of the either two triggers.
You might want to add preserve trigger to the other two triggers, otherwise the result would either be 1 or 0 minerals.
Report, edit, etc...Posted by fm47 on 2005-12-07 at 03:52:57
Oh yeah, that, forgot to write those in, but they're there.

Yeah... the idea kind of just hit me. It just rises and falls, and if you put a cap on it, it will only rise and fall between a Min and Max.

Here's the problem to that idea though - It randomly increases and decreases by 1, instead of for example:
Initial number: 240
First randomization result: 123
Second randomization result: 415

It will be more like
Initial number: 240
First randomization result: 240
Second randomization result: 241
3rd: 242
4th: 241
5th: 242

and so forth. Though with that flaw, I'm sure that is what makes this idea worthwhile as well, depending on how you use it.

To set a cap on it, give it something like:

First-

Cond.
'Switch 1' is Cleared.
Act.
Subtract 1 mineral.
Preserve triggers.

then

Cond.
Player resource is at most 64(max number - 1, so in this case, max number is actually 65)
'Switch 1' is Set.
Act.
Add 1 mineral.
Randomize 'Switch 1'.
Preserve triggers.

then

Cond.
Player resource is exactly/at least 65
'Switch 1' is Set.
Act.
Randomize 'Switch 1'
Preserve triggers.

That way when it reaches 65, it only randomizes again to see if the number either falls or stays, instead of increasing further on. What could be done is that you have a wait time for all of the randomizations, and I would probably imagine it best that the wait times are set to be the same. You can also set a minimum this way with the At Least option.

And of course, this could be done to death counters (which is what I was using it for) as well.

I guess with hyper triggers this thing will actually fire through pretty quickly for a greater difference between numbers of each result. But of course, the result will fire off each trigger based on the difference of the results because it will have to roll through it it (since it travels by 1's) one way or the other
Report, edit, etc...Posted by Joshgt2 on 2005-12-07 at 05:04:37
You would not need this in the second and third triggers:
Trigger
Actions:
¤ Randomize 'Switch 1'

You already have the first trigger on set to always
Trigger
Conditions:
¤ Always
Report, edit, etc...Posted by IA-Sky on 2005-12-07 at 05:05:20
QUOTE(fm47 @ Dec 6 2005, 09:42 PM)
Ok so my question is that would the first set of triggers fire  more than once before any of the other two are fired, or would it the first one fire, then the first one and either the second or third one fire at the same time, and if fires at the same time, will I still get two results?
[right][snapback]373415[/snapback][/right]

TRIGGERS DO NOT FIRE AT THE SAME TIME.

if you want the first trigger to fire FIRST make sure its the first one down the list, from player 1-8, down the list then to next player, then force1-force4 samd thing down the list on each force befor it goes to the next force, then under All players, fires from each player starting from p1 first.

but if you want it to fire more than once, say twice?
then its easy just make a second copy of your first trigger.
if you want to do it another way you can for example give the trigger, to all players or a force, and im sure it would fire many times. depending on the number of players under the force.

also just a side note your last 2 triggers have no Preserve Trigger on them.
Report, edit, etc...Posted by fm47 on 2005-12-07 at 05:58:41
QUOTE
You would not need this in the second and third triggers:


I forgot, as the way I later explained, you then would not need the first trigger because it wouldn't be neeed.

QUOTE
TRIGGERS DO NOT FIRE AT THE SAME TIME.

if you want the first trigger to fire FIRST make sure its the first one down the list, from player 1-8, down the list then to next player, then force1-force4 samd thing down the list on each force befor it goes to the next force, then under All players, fires from each player starting from p1 first.

but if you want it to fire more than once, say twice?
then its easy just make a second copy of your first trigger.
if you want to do it another way you can for example give the trigger, to all players or a force, and im sure it would fire many times. depending on the number of players under the force.

also just a side note your last 2 triggers have no Preserve Trigger on them.


Ok you're not understanding the question here. First off, read later posts then post?
And what I'm asking is that if I'm constantly firing off a randomized switch, in which when it is fired off it will be fired AGAIN, except adding/subtracting a mineral while firing it off again...

Now let say it does this

Cond.
Always.
Act.
Randomize switch 1
preserve triggers.

cond.
switch 1 is cleared
act.
subtract 1 mineral
randomize switch 1
preserve triggers

OK, let say the first trigger results in a Switch on is Cleared, so that brings us to the second trigger, where when swtich 1 is cleared, it subtracts 1 mineral and randomizes switch 1 again, but by this time, would the first trigger which is being fired off at Always and preserved triggers be fired as well, so that it fires TWICE this time in stead of one at a time like it would if i simply left out the first trigger?
Report, edit, etc...Posted by Kumano on 2005-12-07 at 08:20:57
If the first trigger was made before the 2nd or 3rd, yes it will go off first, then the 2nd or 3rd would go off, then it would start over at the first 1 randomizing it again I think. This could be changed though if the 2nd one would randomize it again, and if it's set the 3rd would go off, and if cleared the 2nd one wouldn't since it already went off in that cycle, and it would go to the first trigger again. So I guess that could be a problem since it would be a 75% chance of the 3rd and 25% of the 2nd if you got the 2nd last time, making it more likely to subtract minerals then to add. The first trigger really isn't needed, and without it there should be equal chances again.

Trigger 1 makes switch cleared.
Trigger 2 randomizes, either
- Cleared still, and it goes back to trigger 1 and randomizes AGAIN making a 25% chance of being cleared both times.
- Set, and the next trigger would subtract 1 mineral and then it randomizes and goes back to trigger 1 and re-randomizes.

Trigger 2 has a chance of either trigger 3 going off or just re randomizing, giving trigger 3 another chance to go off. The first randomize in trigger 3 doesn't matter since it's the end of the cycle, and it would go back to trigger 1.
Report, edit, etc...Posted by PCFredZ on 2005-12-07 at 18:45:31
Read and only read Bolt's explanation of trigger execution, everything else will lead you astray.
Report, edit, etc...Posted by fm47 on 2005-12-07 at 19:46:27
Rofl Pc, thanks. Kumano, I slightly get what you are trying to say, thanks smile.gif Now I at least have an idea because I don't know if the trigger would be set off as soon as the conditions are met or AFTER all triggers are executed first... Anyway, I did realize that the first trigger isn't needed, but I asked because this case of problem comes up other times too... I'll go read the trigger firing thing now
Report, edit, etc...Posted by (U)Bolt_Head on 2005-12-07 at 20:28:14
Your first trigger isn't needed because switches start the game off as clear.
If your only two triggers are as follows then you would have the same effect as you listed in your first post. (except the first choice is always a subtract)

Trigger 1:
Conditions:
-Switch 1 is clear
Actions:
-Subtract 1 min
-Randomize Switch 1
-Preserve Trigger

Trigger 2
Conditions:
-Switch 1 is set
Actions:
-Add 1 min
-Randomize Switch 1
-Preserve Trigger

This kind sounds pointless to me because statistically the minerals for the most part will just hover at one value slightly going up or down.

Now if you did what you in ‘Post8’ then statistically your minerals would slowly increase because of what Kumano said. Your probability becomes…
25% subtract one mineral
25% stay the same (subtract immediately followed by a add)
50% add one mineral

Your basic question is confusing and is sending people stray. The triggers will fire exactly in the order you put them in with the previous trigger finishing completely before the second one checks its’ conditions. The only exception to this rule is when a waits are used.

The order between players is (P1-P8) group owned triggers fire along with the single owned triggers NOT after So what IA-Sky said is wrong.
Report, edit, etc...Posted by fm47 on 2005-12-08 at 02:43:40
Well, sometimes the problem exists because even if I didn't have the first trigger, the problem will show up in a different scenerio. Which then I guess the trigger would be fired once more than I want it to...
Report, edit, etc...Posted by Kumano on 2005-12-08 at 06:13:48
I guess if you really needed the first trigger you could just have no preserve trigger on the first trigger, it should work fine then.
Report, edit, etc...Posted by fm47 on 2005-12-08 at 20:14:13
Well, I had this once-
Player is outside - randomize switch 1
Player wins battle - randomize switch 1
to put it simply.
It then gets fired twice as much before something clears it... Anyway, I get it all now, thank you guys.

Oh by the way, when firing a trigger, does it matter where switches land as long as they're not conflicting other triggers IN the trigger? The firing thing runs through the entire trigger and then checks which other triggers need to be run first right?

So if I had
cond.
-player is outside
act.
something
something
something
set switch 1
something
something
something
preserve triggers.

and

cond.
switch 1 is set.
act.
something else happens.

It will run through the first script entirely THEN go fire the second trigger right?
Report, edit, etc...Posted by Kumano on 2005-12-09 at 06:24:42
It depends on how long that would take. If there are waits in it (or other things that could slow it down), then no, but you can put a 'Wait 0 milleseconds' on the second one at the start so it would wait for the other waits to finish before it, but if there are multiple waits after the switch was set it wouldn't work you would be better off just setting another switch to be set and have trigger 2 required to have that switch set also (wait 1 goes off after switch, then trigger 2 stops waiting and starts going, trigger 1 still has wait 2 that should have happened first).
Report, edit, etc...Posted by fm47 on 2005-12-10 at 01:05:08
Oh I see, wow that's a load I couldnt understand till i read it like 30 times -_-
Next Page (1)