Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Chapter 9 Exercise 1 The Wave (http://www.alice.org/community/showthread.php?t=4283)

 chunter 04-22-2010 03:12 PM

Chapter 9 Exercise 1 The Wave

I have set the animation up with the coach, student1, skaterGirl, and randomGuy2. I am using For all in order and a world variable list. The problem I have is the skateGirl and randomGuy2 does the wave with arm forward movement. The coach and student1 does the wave with arm left movement. How can I get all of them to use they same movement type so I can use one variable with all four of them in a list?

 chunter 04-22-2010 04:36 PM

Problem Correct

I found the problem.

 poolebj 05-07-2012 10:06 PM

What was the problem? I'm having the same issue

 shan841 12-15-2014 10:43 AM

Curious how others did this?? The only way I could make this work was to create two different lists/methods, one for skatergirl & random guy, and another for coach & student.

 chickentree 12-15-2014 08:04 PM

IMHO this is a terrible problem. What it says and implies by the picture is that these objects can all be programmed in a list to do the wave. The problem is, as you pointed out, that if you try and use the characters shown, it will never work.
The reason it does not work is that the objects are not all built the same so that the steps in getting one object to wave is not the same as getting another one to wave. This is not to say that all the characters have to be the same type of object, just that they need to be structured the same. If you look at the coach, he has a his arms attached to his upper body and each arm has a hand sub-object. The Random Girl 1, by contrast, has shoulder sub-objects directly beneath the main object. In addition, the sub-objects are arm->forearm->hand. And the Random Guy 1 is different than either of the objects above
he has arms coming off his upper body (like the coach) but the arms consist of arm->elbow->forearm->hand.

In short there is no sane way to program Alice using lists because the sequence of sub-objects from the main character to its hand are different. While you could write a method that test for the type of object and executes different instructions for each type, that kind of defeats the purpose of the exercise.

Mark

 MrMoke 12-16-2014 10:31 AM

Or a Good Challenge

1 Attachment(s)
A few of the important things I’ve learning over the last 47 years or so of programming is to master the language you are using, and use it creatively through experimentation.

One of the things that Alice2 objects have in common is the ability to use Poses that you have captured during the design phase of your project. In this instance, we have a fixed number of objects, so the objects and poses can be stored in “either Lists or Arrays” and they will work the same when referenced with a single index value.

Your job is to think beyond drag-and-drop, and instead build the project “Before” you start coding. If you were standing up and wanted to wave to someone, how many unique positions (aka: poses), including repeatable, would be needed? Now use your mental list of positions to build those poses into each character. The only thing finite here is the step count, not the poses, so the waves don’t have to look the same.

Once complete you can use loops to activate the poses on the items in the Object and Pose arrays. This can be done in straight-line code, or using mouse-click events where the object clicked is passed in as a parameter.

The attached demo is small example. Note that the setup time was much longer than the coding phase. My finished project is much more sophisticated. Have fun and remember that your C.O. might be watching :)

 chickentree 12-16-2014 03:26 PM

Hi,

Great information and thinking outside the box!
My problem with the exercise is that any answer tends to obscure what the chapter is trying to show case. That of using lists and instructions. Can the objective be accomplished? Yes, this thread has talked about 3 ways to succeed [LIST=1][*]Different lists for different kinds of objects[*]Making the method "object aware." [*]Using Poses to make the characters wave.[/LIST]
But at some point the main idea and implementation of a List becomes less and less front and center.

Mark

P.S. I have found over the years that many of Alice's "Quirks" were not quirks but the natural result of the rendering paradigm used to make the movie. If the object is not actively in a scene, the method I am waiting for might never be executed. The result is that situations like making an object invisible can cause unexpected side effects.

[QUOTE=MrMoke;55232]A few of the important things I’ve learning over the last 47 years or so of programming is to master the language you are using, and use it creatively through experimentation.

One of the things that Alice2 objects have in common is the ability to use Poses that you have captured during the design phase of your project. In this instance, we have a fixed number of objects, so the objects and poses can be stored in “either Lists or Arrays” and they will work the same when referenced with a single index value.

Your job is to think beyond drag-and-drop, and instead build the project “Before” you start coding. If you were standing up and wanted to wave to someone, how many unique positions (aka: poses), including repeatable, would be needed? Now use your mental list of positions to build those poses into each character. The only thing finite here is the step count, not the poses, so the waves don’t have to look the same.

Once complete you can use loops to activate the poses on the items in the Object and Pose arrays. This can be done in straight-line code, or using mouse-click events where the object clicked is passed in as a parameter.

The attached demo is small example. Note that the setup time was much longer than the coding phase. My finished project is much more sophisticated. Have fun and remember that your C.O. might be watching :)[/QUOTE]

 All times are GMT -5. The time now is 10:44 AM.