Page 1 of 3

"Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:17 pm
by Kr!s
So I got this:

Pseudo code
[code:xlnlsjkm]
+Key "Enter" is pressed
-Set "1" to "2"

+Key "Enter" is pressed
-Set "2" to "3"[/code:xlnlsjkm]

If I do something like this, it would jump straight to "3".
I'm trying to make a menu, so if I press enter to get to a sub-menu, the first option of that sub-menu is instantly selected, and I want to avoid that.

Any help would be gratly appreciated.
Thanks!

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:23 pm
by Arima
Events are run from top to bottom. That means first "1" is set to "2", then "2" is set to "3" immediately after.

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:32 pm
by Ashley
Maybe you just want to add 1 to the value...?

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:34 pm
by Jeswen
[code:2m3c8a7v]+ Enter is pressed
+ X = "2"
- Set X to "3"[/code:2m3c8a7v]

Use this if you don't want to just add like Ashley suggested.

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:34 pm
by dfyb


can use something like this. as it is in that image, it doesn't work -- the conditional one still needs to be ABOVE the non-conditional. i thought this was a bug but changing the order fixed it.

later tonight i can give you a cap and better explanation -- i already had that image hosted, so it was convenient.

[quote="Jeswen":23ydkpqt][code:23ydkpqt]+ Enter is pressed
+ X = "2"
- Set X to "3"[/code:23ydkpqt]

Use this if you don't want to just add like Ashley suggested.[/quote:23ydkpqt]
just keep in mind that if you have

+ Enter is pressed
- Set X to "2"

infront of that event, it'll still go straight through them in one key press.

you need:

[code:23ydkpqt]+ Enter is pressed
+ X = "2"
- Set X to "3"

+ Enter is pressed
- Set X to "2"[/code:23ydkpqt]

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:36 pm
by Jeswen
lol, BAM 3 solutions ...

@dyfb: Not if you do it for each X = Y
I just tried it.

Which is what I meant.

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:42 pm
by dfyb
[quote="Jeswen":68sbqkrf]lol, BAM 3 solutions ...

@dyfb: Not if you do it for each X = Y
I just tried it.

Which is what I meant.[/quote:68sbqkrf]
http://upload.dfyb.net/uploaded/numbers.cap

nope

if they are in order, it'll run through them all at once. to get it to work, you need to reverse their order.

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:43 pm
by Kr!s
Thanks for the tips, guys. I'll try some of this stuff now.

The weird thing is, I thought it would work the way I had done it in the first place, since the condition is "Key is pressed" instead of "Key is down".

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:43 pm
by Jeswen
[quote="dfyb":27gpyewp]nope

if they are in order, it'll run through them all at once. to get it to work, you need to reverse their order.[/quote:27gpyewp]

You didn't do it for each, you took what I said literally as "X = Y" then "X = Z"

No matter though, he's got it!

Re: "Key is pressed" error?

PostPosted: Thu Sep 25, 2008 10:47 pm
by dfyb
[quote="Jeswen":27iync02][quote="dfyb":27iync02]nope

if they are in order, it'll run through them all at once. to get it to work, you need to reverse their order.[/quote:27iync02]

You didn't do it for each, you took what I said literally as "X = Y" then "X = Z"

No matter though, he's got it![/quote:27iync02]
can you post a quick example .cap (or screenshot)? not sure what you're saying should be different.