Alice Community  

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

Reply
 
Thread Tools Display Modes
Positioning
Old
Paradox
Guest
 
Status:
Posts: n/a
Question Positioning - 03-23-2010, 01:34 PM

I'm trying to make a simple game in my program where an arm and a sword swing when enter is pressed, I have a lot of it down but I'm trying to make it where the arm returns to it's origional position, I've tried just copying the code and reversing it, but it doesn't work. So I'm wondering if I can reset its position somehow, or if I'm overlooking something simple... any help is appreciated
   
Reply With Quote
Old
dragnet
Member
 
Status: Offline
Posts: 38
Join Date: Jan 2010
Default 03-23-2010, 03:49 PM

The easiest way I've found is to use poses.

Move your sword to the hand of the character you want to swing it. Position the sword exactly where you want it and then set it's 'vehicle' to the hand of the character that is holding it. Now position the arm to where you want it to be before the swing starts. You'll notice that the sword will move with the arm if it's 'vehicle' property is set correctly. When you get the arm(and sword because it is attached) to the position you like, click on the character object and select 'capture pose'. Name the pose swingBegin or something like that. Now move the arm to where you want the sword swing to end. Again the sword should move with the arm. Capture this pose and name as swingEnd.

Now that you have your two poses you simply set the pose of your character in a 'while key is pressed' event. So 'while enter is pressed' for the event and place the characters setpose to swingEnd method in the begin portion of the event. Then in the end portion of the event set the pose to the swingBegin. Now you have an arm and sword moving together up and then back again. Remember the sword's vehicle must remain as the hand you want to swing it.

In this way you don't have to code individual motion into your movements. You can simply set poses and use duration amounts to create complex movement. The Alice engine simple moves all the pieces of your object from pose to pose, smoothly.

If you have any problem I can send you an example.
   
Reply With Quote
Old
Paradox
Guest
 
Status:
Posts: n/a
Default 03-24-2010, 12:38 PM

Quote:
Originally Posted by dragnet View Post
The easiest way I've found is to use poses.

Move your sword to the hand of the character you want to swing it. Position the sword exactly where you want it and then set it's 'vehicle' to the hand of the character that is holding it. Now position the arm to where you want it to be before the swing starts. You'll notice that the sword will move with the arm if it's 'vehicle' property is set correctly. When you get the arm(and sword because it is attached) to the position you like, click on the character object and select 'capture pose'. Name the pose swingBegin or something like that. Now move the arm to where you want the sword swing to end. Again the sword should move with the arm. Capture this pose and name as swingEnd.

Now that you have your two poses you simply set the pose of your character in a 'while key is pressed' event. So 'while enter is pressed' for the event and place the characters setpose to swingEnd method in the begin portion of the event. Then in the end portion of the event set the pose to the swingBegin. Now you have an arm and sword moving together up and then back again. Remember the sword's vehicle must remain as the hand you want to swing it.

In this way you don't have to code individual motion into your movements. You can simply set poses and use duration amounts to create complex movement. The Alice engine simple moves all the pieces of your object from pose to pose, smoothly.

If you have any problem I can send you an example.
I think you're misunderstanding, I've done all of this and the pose isn't what's bothering me, it's resetting the arm to the starting position in the world, the arm itself and sword don't pivot, it moves forward and across the screen [it's vehicled to the camera], I'm wanting it to move in a swing motion, and return to the origion position in front of the camera, but for some reason when I reverse the code as I've previously done, it doesn't return to normal.

Last edited by Paradox; 03-24-2010 at 12:59 PM.
   
Reply With Quote
Old
dragnet
Member
 
Status: Offline
Posts: 38
Join Date: Jan 2010
Default 03-24-2010, 06:21 PM

Have you tried placing a dummy object where your sword start position is? You could then have the sword move and orient itself to the dummy object over a specified period of time, after a sword swipe is done.

I haven't tried it myself but it should accomplish what you want to do.
   
Reply With Quote
Reply

Tags
game, position

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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.