Silly question about conditions
I've been wondering about this for awhile now...sometimes when particular conditions are made in an event, they will be displayed with red text. Not all conditions have this...things like "Start of Frame", fast loops, read joystick state, and animations have this, just to name a few. Why is this? I just need to settle my curiosity because I'm sure this is done for an important reason.
Re: Silly question about conditions
I was wondering about the same thing a while back, and found my answer on The Daily Click.
----------------------------
Posted by: Ricky Garces:
Red Events are tested as soon as they are true. So if there is a collision (collisions are red) that will be tested before anything else.
They don't have to be true right away. ON LOOP (which is red) will be tested immediately after start loop happens)
also, order of conditions decides whether or not it is immediate. Ex.
Start of frame
no sample is playing this is immediate
no sample is playing
start of frame not immediate
I hope this helps rather than confuse you. If i did confuse you, look up immediate events in the help.
Re: Silly question about conditions
That's about it - normally MMF reads the event list in order from top to bottom, but the red "immediate" events are performed immediately when their conditions are met. For immediate conditions to work correctly, they have to be at the top of the event line that contains them.
Re: Silly question about conditions
Also remember the positioning of red events in your code can nullify their priority.
Place an Event code over top of a collision event and it turns black, the collision is no longer first, and this can make your game not function the way you thought it would.
Like what Norway said.
Re: Silly question about conditions
Alright, I get what they are now I think...so, if an immediate condition is at the top of the event list, then whenever that condition occurs, that event is checked to see if all the other conditions are true. If so, it is then executed regardless of where it stands in the top-to-bottom queue that MMF2 uses to process events...is that the right logic?
Re: Silly question about conditions
Yup, you can have a Start of Frame event at the bottom of your list, it still gets executed first, "if it's red".