PDA

View Full Version : While key is pressed.


general
06-12-2006, 01:15 AM
Found it but still need help.

I get an error after I let go of the key I press. Like, I want to make mana move forward so I use the up arrow to move then if I let go of the arrow, I get an error. Any idea why?
Please help.
http://i10.photobucket.com/albums/a139/amzharpyro/aliceerror.jpg

Jabberwocky
06-12-2006, 05:00 PM
Your code is obstructed in the screen capture, but I assume from the error message that your Walk method has a loop. Inside that loop you access the loops index value at some point but you go beyond it's value range.

general
06-15-2006, 08:00 AM
Well, how would I solve this problem?
Here's my codes if you need it. I'm using the walk method that came with Mana.

http://i10.photobucket.com/albums/a139/amzharpyro/code.jpg

Jabberwocky
06-16-2006, 04:37 PM
I see nothing in the Walk method that would generate an error. Inside it though you're calling another method, WalkHelper. That might be where your problem is. What does it look like?

In the Walk method do you need the MoveAmt parameter or the Loop? Since the event is already a While loop shouldn't the character continue to walk as you hold down the While key?

Jayjay122
06-17-2006, 02:31 AM
im just guessing but maybe it should say:
-while (up) is pressed:
-begin (walk)
-during (non-cutscene or none if you dont mind when he walks)
-end (none)

you were saying that while he was walking and he pressed up the guy would do nothing and end nothing

or is that so he can alternate leg animations and stop inbetween strides?

edit: nevermind, I didn't understand very much about while events when I posted this

Jabberwocky
06-17-2006, 10:12 AM
Posting code on the forum simply clutters it up.

I agree that posting large screen captures clutters up the forums. It's ugly, especially when the graphics go beyond the normal message borders.

What worries me more is that in the future, since they are housed offsite, the screenshots will vanish when users let their offsite hosting lapse, and the forums will become riddled with holes and gaps in information.

If you will attach the screenshots instead of embedding them in the message post, the post will be clean and the image is archived on the forum for future reference.

Alternatives to screen captures would be either posting the World file (.a2w) or an HTML page (.htm).... from the File menu choose "Export Code for Printing" {btw, you can select what methods you want to export}.

You could also go back and edit you earlier post to convert the embedded graphics to attachments, if you really wanted too. ;)