I have worked with MMF for some years now, but there's still a little thing I find anoying. It's about counters.
I am making a version of "Lingo" (the game in which you are to guess the right word).
So I have this code:
If Counter = 0
+ Upon Pressing "A" :
Set String1 to "A"
& Add 1 to Counter
Then the counter goes to 1, which is the second letter of the word you want to type.
If Counter = 1
+ Upon Pressing "A":
Set String2 to "A"
& Add 1 to Counter
"A" is just the letter. It can be anything from A to Z. The problem is that when you type "A" for the first letter, it will do it for the second as well (and probably the other 4 letters too, which I did not code yet). So, the counter is "too fast". Does anyone recognize this problem and has a simple solution to this?
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
21st October, 2006 at 07:18:28 -
Huh, you do your events stupidly. The order the conditions go in matters. Try this, it works for me. There's more ways to do it though, this is just the easiest.
*Only one action when event loops
*Upon Pressing "M"
*If Counter = 0
-Events
Alternativly, you can put in another counter and change the event list to this...
*Only one action when event loops
*Upon Pressing "M"
*If Counter = 0
*If CounterB = 0
-Set CounterB to 10
-Other events
*Always
-Sub 1 from Counter B
Maybe, I'm too lazy to test if it actually works.
Edited by the Author.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
21st October, 2006 at 07:40:08 -
MMF has to run through the event list 50 times a second. So, MMF looks at each line one at a time. It'll run through all the conditionals on that line until it hits one that negates the line (and moves on to the next) or fufils the conditionals and does the events. So, put conditionals that are negated easily (like if the player presses a button) near the top. Totally irrevelant, it's just good habbits.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Instead of having a second counter, you could have a flag that needs to be off to run the event. Then when you press a key, it becomes true, thus stopping it using the next event.