PDA

View Full Version : walk with variable while moving


miogi
12-03-2006, 02:30 PM
hello, I am trying to get my final asignment done and I am having
so much trouble with this Alice, I have thought just saying the heck with it,
I am sooo frustrated with this.. If anyone can help, please...

I am trying to make a person(he-man build) to walk with built in walk
and also to move same time. The problem I am having is that when I create
a variable (while something is true) to up arrow and variable being true,
I cant get the person to walk and move at same time with out errors. Man, I
have tried so many darn times. I go to create an event, I choose while something is true and put the variable in there and the method of movement which I have move and walk in a do together block, I then go to while a key is pressed and I put the up arrow and the variable to set to true.
This should work, but its not. I just overall want to get a person to walk, move forward with up arrow and stop with down arrow (variable set to false).

PLEASE help as I am going crazy with this..

DrJim
12-03-2006, 06:41 PM
Looks like a real bug - the attached always gives me an error when I release the up arrow key - and it's about as simple as code can be to do what you want.

The walk method works ok when I call it from something else but not when called from "while key is pressed." Also tried both regular and "slow and steady" Alice - no difference.

The error message is "index out of range" but I can't see anything that would cause that in the code.

Didn't see anything in the bug list that might apply except a note that "he/she builder poses are broken"????

Maybe someone else can see the problem.

zenteo
12-23-2006, 01:51 PM
Here is my working version!

DrJim
01-02-2007, 11:02 AM
Nice work - your solution really works smoothly. Thanks! :)

I've been trying to figure out what the original problem was and am still not sure. :confused: If you have some more time, could you post a little more explanation of what you did.

In general, the problem seems to be that in the original, when the while event terminated, it left/set some loop index to an illegal value - but I can't figure out how or what index. This leads to the following questions:

1. When actually is the while conditional statement evaluated for an event?
2. Is possible to set the value of "elapsed time" and, if not, when is it reset? (It looks to me like this only occurs when you restart Alice.
3. Despite the cryptic comment in the "know bug" list, it doesn't look like the poses had anything to do with the original problem. Anyone agree/disagree?