Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do I make my character walk?
Old
steveguy
Guest
 
Status:
Posts: n/a
Post How do I make my character walk? - 05-14-2011, 04:51 PM

I want to make code when I press up/forward, down/backward, etc. I want my character to walk while I move my character. What kind of code do I make for this to happen?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 05-14-2011, 05:05 PM

Go to the events, and find the "When a key is pressed" event. Right-Click it, and say change to "While a key is pressed" Then make a method that says move forward (the speed you want it to go), and put it inside the "during" part of the while a key is pressed thing. Repeat this for turning and moving backward as well.

For walking, if your character is made in the people creator, you can use the inborn walk method, messing with the time parameter that shows up when you put it in until it matches the walking time. Put this in a do together block with the movement, and voila, the guy walks and moves at the same time when you press the appropriate key.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
steveguy
Guest
 
Status:
Posts: n/a
Default 05-14-2011, 05:20 PM

But what if it was a person object NOT from the People Maker?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 05-14-2011, 05:30 PM

Then you would need to make your own walk method by, probably by either setting poses and saying set pose back and forth in a realisic way, or just moving the subparts, and then put it in the method in the same way.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Help please
Old
jacob waitman
Junior Member
 
Status: Offline
Posts: 1
Join Date: Jan 2012
Default Help please - 01-29-2012, 06:26 PM

i wanna know how do you make the other character walk but they are computer. like you seen in other games.
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 01-29-2012, 07:16 PM

You want to know how to make an NPC walk? I'll assume you made a walk animation. First things first: The thing you're trying to make is called an AI. Problem is, I don't know what you want to do with it. Well, what do you want to do with it?
Let's assume all you want to do is get the foo to walk in a random direction at random times.
Make three random numbers. One is between 0 and 10, the second is between -.5 and .5, and the third is between 0 and 20. The first one is how long a wait should be done between walks. -.5 and .5 denote which direction it should walk in and by how many degrees, up to 180 degrees left and 180 degrees right. 0 to 20 is how many meters it should walk.
Make an event that executes this method, and by that I mean every 0-10 seconds it makes an NPC turn -180 to 180 degrees and complete the walk animation while moving forward 0-20 meters.

If you want the NPC to chase the camera, you simply have to do the same thing, except make the NPC face the camera.
This is kinda cheap. At some point someone will figure out how to get the NPC to follow a path in order to reach you.
   
Reply With Quote
Reply

Tags
alice, characters, code, lists, objects

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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