alice-teacher Export a person in Alice 3

Vanderhyde, James vanderhyde at sxu.edu
Mon Jan 13 09:44:57 EST 2020


Don, thanks. In Java, you can extend a class with the only new thing being a new constructor that sets all the property values the way you want them. Is there a way to do this in Alice 3?

James
—
James Vanderhyde
Associate Professor and Department Chair
Computer Science
Saint Xavier University
3700 W. 103rd St.
Chicago, IL 60655
773-298-3454

On Jan 12, 2020, at 7:47 PM, Donald Slater <dslater at andrew.cmu.edu<mailto:dslater at andrew.cmu.edu>> wrote:

James,
You are correct, that because the Alice 3 Export  function exports essentially a Java class, methods, functions, class properties of the class will be exported. But not the particular characteristics fo an object of that class.

If Alice allowed the creation of properties and variables of the type adultPersonResource, teenPersonResource, childPersonResource, etc, then one could create a class property of that resource with the specific values of the avatar, which would be exported with the class. That may be worth investigating for future releases.

But I did come up with a work-around, a hack, actually  ;-) Using the TeenPerson class

1) Create a method for the person class, name it something like setMyResource…
2) Inside that method, use the  setTeenPersonResource to build the avatar. (This will not change the appearance of the avatar in the scene until the method setMyResource is called). See the attached screen shot.
3) You may now export this class, and the setMyResource method, with the specific values for the avatar will be exported as part of this method.
4) When you import this class into a new project, call the setMyResource method as the first line of code, and the avatar in the scene will take on the desired appearance at runtime.

I have also attached a sample project that you might play with.

It is a hack, but it is something until until we come up with a more elegant solution.

Lete me know if you have any questions.

All the best,
Don Slater

Alice Project

<p1.png>

On Jan 12, 2020, at 9:03 AM, Vanderhyde, James <vanderhyde at sxu.edu<mailto:vanderhyde at sxu.edu>> wrote:

Hello, everyone. I have made the jump from Alice 2 to Alice 3. Is there any guide to Alice 3 for long-time users of Alice 2? I am hitting a problem right away. In Alice 2, I had each of my students create an “avatar” using the He/she builder, export the object, and use it in every one of their homework assignments. I can’t find a way to export a carefully crafted person in Alice 3 for use in other projects. The class export system seems to be completely different.

James
—
James Vanderhyde
Associate Professor and Department Chair
Computer Science
Saint Xavier University
3700 W. 103rd St.
Chicago, IL 60655
773-298-3454

_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
To change settings or unsubscribe visit:
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

<ResourceImportDemo.a3p>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20200113/7ef73724/attachment.html>


More information about the alice-teachers mailing list