Alice Community

Alice Community (
-   How do I...? (
-   -   Where in Alice3.x is change to "while a key is pressed" event? (

mmar 07-30-2014 12:22 PM

Where in Alice3.x is change to "while a key is pressed" event?
I'd like to move object unless I release a key. This is very simple with Alice 2.x where I choose event "when a key is typed" and change it into "while a key is pressed". The problem is that I can't find something similar in Alice 3.x.

Thanks for help.

MrMoke 07-30-2014 03:27 PM

Good Question
1 Attachment(s)
The answer might be to create a new event that handles arrow keypresses, and build the code to make it work the way you want it to.

I created a grass world using , added a Humvee, positioned the camera and locked it to the Humvee, and then experimented with a little code to moveit, moveit, turnit, turnit.

Added an image of the code for you to view.

The Forum squashes image uploads to unreadable sizes, so I zipped it. Just click and open to view it.

Use the image to put your own event together, and Make sure you pay attention to the options I chose, If you get it to work the Humvee should move and turn while the arrow keys are pressed.

Now create backup copy, saved as version 2, and modify the various options to see how they affect performance.

mmar 07-31-2014 08:26 AM

MrMoke, code you sent me is ok, but the problem is with FIRE_MULTIPLE trigger on event, because it always stop at the end although begin and end abruptly.

But looks like I recognized the point. Duration must be equal or less than distance. Am I write?

MrMoke 07-31-2014 01:01 PM

Not Exactly
The duration is only the speed that each individual move or turn is done. Abrupt puts the individual moves and turns together with no slowdown between repetitions.

The durations, distances, and degrees were tweaked until they looked natural to me.

More later, if I have a little time.

All times are GMT -5. The time now is 04:52 AM.

Copyright ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.