PDA

View Full Version : Project help


NEPALII
05-11-2013, 09:38 PM
Hello,

I wasn't aware there was a forum related to the Alice program and I was very relieved when I found out. I am hoping someone in here can help me out.

I am taking Computer Programming Fundamentals on College, and pretty basic stuff that I have done with Alice. I'm getting better at it and it's crazy at how much you can do with it. It's really exciting.

However, my professor has given everyone a "Final project" assignment and I am struggling with it. He hasn't been very helpful and I don't understand why, so I'm hoping anyone will help me.

Here is the assignment itself:

Create an interactive Alice world, where the user controls and/or manipulates the objects. Make sure the user can control the angles and movement of the camera. Your project should be logical and make sense. (See Cases and Places 3 on page AL 235 of the Alice Text). Provide a written description (PDF) of the project and the controls used and a billboard on screen of the controls used that can be toggled on and off with the keystroke F1. Below are your requirements for the project. Clearly mark each of the requirements in your code with comments.

1. Move the Camera so it is always watching the movements of the objects performing the tasks.
2. Create methods in Alice that implement each of the following:
a. Control test guy so he can walk to the light switch.
b. Control his arms/hands/fingers so he can turn a given light switch.
c. Move the switches corresponding to (b) above.
3. The following is the logical expressions for the light switches:
a. The lights are on only when the lightswitch is in the up position.
b. When either red switch is on, the room will get a yellow lighting effect.
c. When both red light switches are on the room will get a red lighting effect.
d. When either green switch is on, the room will get a yellow lighting effect.
e. When both green light switches are on the room will get a green lighting effect.
f. When one green and one red is on (either switch) the room will get a blue lighting effect.
g. When no light switched are on the room will get a white lighting effect.
4. Perform a stack, queue and bubble sort on the frogs.
a. Stack, line up the frogs FIFO and have them exit the stack LIFO.
b. Queue, line up the frogs LIFO and have them exit FIFO.
c. Sort the frogs (Bubble).

I have managed to get the mouse to be used to move the camera. I have also managed to get the character (test guy) to walk to the light switch using the walk method that comes with it. Also, I have the light switches working and make them change lights to ON and OFF... sadly, that's all I have got.

I can't get his arms, hands & fingers to move so the character can touch the light switch rather than having the light switch moving by itself. How do I do that? I use "move" method, the arms come off. I use "turn", the arms barely move. I don't know what to do. Maybe some parameter or variable that I am missing.

I also need to get the button switches working and do the bubble sort, but one step at a time. :)

I have uploaded my work, it is based on the "Switches.a2w" file. Hope you can be more helpful than my professor.

x2495iiii
05-11-2013, 11:47 PM
Always willing to help.

Moving the arms is a combination of turns and rolls, generally. This can be done at runtime, or beforehand and the body's position can be saved as a pose. Poses are easier to use, but more restrictive.

Bubble sort is easy enough to do. I actually made an example of it just for laughs. Here's the link:

http://www.alice.org/community/attachment.php?attachmentid=1749&d=1255766808

The button switches are easy enough to get working as well, but like you said, one problem at a time.

Let me know what you'd like to work on first.

NEPALII
05-12-2013, 10:43 AM
Combination? Use a "Do Together"? Sorry for asking these noob questions. :p I only have to make the left arm move so the character can reach the light switch.

The same will be done for the button switches.

x2495iiii
05-12-2013, 03:26 PM
Let's go ahead and use poses.

Double-click the "Stand" method your testGuy has. Notice the "set pose to UpperBodyNeutral" part of that method? That's a method which tells the testguy to set his upper body (arms, neck, and head) to a specific position called a pose. Poses are made by arranging the testguy's subparts in any way you like, then clicking the "capture pose" button under the properties tab.

The subparts are arranged by clicking the "Add objects" button, then clicking the "affect subparts" checkbox, and finally using the tools in the upper-right to move the testGuy's arms into a pose that looks like he's reaching for a lightswitch. The turning and tumbling tools are most useful for setting the subparts properly.

NEPALII
05-12-2013, 11:41 PM
Thank you so much. My professor did not tell me that about the poses.

We just work with methods but like you said it involves a lot of trial and error. I just couldn't figure out what to use. Great to know about the poses. Now, I'll see if I can get the testGuy to touch on all switches without any issues. Shouldn't be difficult.

Once I get the hang of it, then I'll move on to the Bubble sort. Once again, thank you. :)

NEPALII
05-13-2013, 03:31 PM
I have finally got all the switches working and I have got the room to change color according to which button the character presses. It looks a little sloppy but it's the best I could do.

Now, I only need two more things:

1 - Perform a stack, queue and bubble sort on the frogs.
a. Stack, line up the frogs FIFO and have them exit the stack LIFO.
b. Queue, line up the frogs LIFO and have them exit FIFO.
c. Sort the frogs (Bubble).

2 - A billboard on screen of the controls used that can be toggled on and off with the keystroke F1.

I looked in add objects to see if there was a billboard but I couldn't find it. I also can't find the frogs. The world says they are there but I don't see them. :confused:

I have uploaded the updated file.

x2495iiii
05-13-2013, 05:22 PM
there are plenty of frogs in the gallery. Did you try gallery search button?

As for billboards, they mean imported pictures. Since they're completely flat 3d objects, they're called billboards in Alice. Click file>import, then choose your picture file to import it and turn it into a billboard.

NEPALII
05-13-2013, 08:23 PM
Here is my Alice file, what I have so far.

You can see the billboard is somewhere in there but how do I make it toggle ON and OFF with the keystroke F1? I have to also make it well visible. This is what I am asked:

a billboard on screen of the controls used that can be toggled on and off with the keystroke F1


I have edited the billboard with the correct controls. Basically I edited the picture and I just imported it as a billboard. Now I don't know how to get showing fully on the screen and how to make it go ON and OFF.

The frogs are lined up but I have to do bubble sort and I have no clue on how to do that. I have to do the following:

Perform a stack, queue and bubble sort on the frogs.
a. Stack, line up the frogs FIFO and have them exit the stack LIFO.
b. Queue, line up the frogs LIFO and have them exit FIFO.
c. Sort the frogs (Bubble).

After this, I am done.

x2495iiii
05-13-2013, 10:44 PM
Check out the bubblesort world I gave you a link to in my first post. It demonstrates how to bubblesort pretty nicely.

As for the F1 thing, it's not possible in vanilla Alice 2.3. Arty made some add-ons that will enable it, but I'd ask the teacher if he meant F or 1.

NEPALII
05-13-2013, 11:18 PM
I totally missed the link, I'll look at it. :) Thanks, I have until tomorrow to finish this.

That's odd that the F1 key can't be used, don't know why my teacher would ask it then. The billboard is driving me crazy, I'm thinking of just sending the pic itself instead of putting it into Alice.

x2495iiii
05-14-2013, 11:12 AM
Setting it ON and OFF is easy. Here's an example