PDA

View Full Version : Where in Alice3.x is change to "while a key is pressed" event?


mmar
07-30-2014, 01:22 PM
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, 04:27 PM
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 3.1.1.92 , 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, 09: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, 02:01 PM
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.