Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Assignment 3
Old
chellydee
Junior Member
 
Status: Offline
Posts: 9
Join Date: Jul 2016
Red face Assignment 3 - 07-16-2016, 11:55 PM

So I had a tough time trying to figure out how to make a mummy walk across the desert sand smoothly. I played around quite a bit....tucking, turning and rolling. Well, maybe not tucking. But I drowned my mummy in quicksand, and even pulled him apart limb by limb, but I figured it out finally.

I'm still not sure on how to get the pharaoh objects' arms, back to their original position.
   
Reply With Quote
Moving parts of objects
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default Moving parts of objects - 07-17-2016, 10:24 AM

Quote:
Originally Posted by chellydee View Post
So I had a tough time trying to figure out how to make a mummy walk across the desert sand smoothly. I played around quite a bit....tucking, turning and rolling. Well, maybe not tucking. But I drowned my mummy in quicksand, and even pulled him apart limb by limb, but I figured it out finally.

I'm still not sure on how to get the pharaoh objects' arms, back to their original position.
You did exactly what you needed to! That is, played with Alice until you got it to do what you wanted. This is great! provided you look at what you ended up with and make sure you understand how and why it is working the way it is.
If you don't take the time to do this you will have a hard time with alice and have to do everything hit or miss.
When I want an object to do something, walk, jump, whatever I start by doing the action myself, paying attention to what I have to do to take a step. Frequently I find it easier to break things down into smaller steps write methods so that the code doesn't end up being a huge clump of instructions that are a nightmare to figure out later. For instance, one walk method that does everything (moves both feet up, forward and back down, moves the object forward, swings the arms ...) would be impossible to understand and harder to debug (find and fix errors) but separate methods that cause a leg to move up, then forward, then down would be much easier to understand and when put together would make one leg "walk."
Also keep in mind the following rule:
Always make sure that the object is exactly the same when you finish a set of moves as it was when you started. In the present case, you would want to ensure that the object and its subobjects are in the same positions relative to each other when the methods legUp, legForward, and legDown are finished as they were when you started.
I should clarify that talking about moving a leg forward is misleading. As a general rule you should not move a subobject relative to its parent (turns and rolls are usually ok) as it will become visually disconnected from its parent. When the parent object moves, turns ... the subobject will follow along just as if it was still part of the object, which it is, but it will continue to appear as if it is separate from the parent - there will be some kind of space between them.

In the case of your pharaoh, if he is altogether before the movie begins, then sometime later the arms become disconnected, there are instructions causing that to happen and you can find and fix them. If, on the other hand, his arms are separated even before the movie starts, his arms were probably positioned by hand using the mouse and in that case it is easier to just delete the object and create another one. You can put the object back together using the same technique you used to move the arms in the first place but they must end up exactly right or you will have problems when you move, turn or roll the object or its subparts.
There is a way to create a "safety net" of sorts. If you are going to be manually positioning subobjects, you can use the capture pose button in the property panel right after the object is created. I usually name the pose something like defaultPose or startPose. If you do this and the object becomes hopelessly mangled (not that I have ever had this happen to me!) you can right click on the object in either the object tree or on the screen, go down the methods list to "set pose" and select the default pose. You can even do this inside a movie if needed to ensure the object is back in its original starting position.

Hope this helps you in your Alice endeavours,
Mark


Mark Henwood
mhenwood@ieee.org

Last edited by chickentree; 07-17-2016 at 10:33 AM.
   
Reply With Quote
Reply

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