alice-teacher Export a person in Alice 3

Vanderhyde, James vanderhyde at sxu.edu
Tue Jan 14 11:15:16 EST 2020


Don, I think this will work.

I think it would be better if Alice 3 allowed the creation of properties of the person resource types. Then a user could create a constant property in the desired class with that type. The user would export the class. Then after creating an object from the imported class, the user could go to the scene editor and set the resource right there, using the constant that was defined. Then the avatar would appear correctly in the scene, without having to call a method at runtime.

I could also wish there was a default person, rather than the random person that appears as the avatar placeholder. I also liked the handful of named characters in Alice 2 that could be used for simple examples (Josh, Nataly, etc.). It would be difficult to make these inclusive for an official release, so maybe it’s better to leave them out.

If there was a way to define person resource properties, it would be easy to make several avatar characters, saving each as a constant property in the class. Each student could create a library of characters, or I could create a library of characters to share with them, that they could easily import and we could use together. That sounds very useful.

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/20200114/9c3a55f0/attachment.html>


More information about the alice-teachers mailing list