Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Where are user defined methods saved?
Old
llarsen
Guest
 
Status:
Posts: n/a
Default Where are user defined methods saved? - 08-04-2009, 09:06 PM

Hi,

I'm a software developer that recently came across alice. My daughter likes to use scratch, but I thought it was time to teach her something that is more sophisticated. I tried storytelling alice first. I like the fact that the objects already have a lot of interesting functionality. I would prefer to use storytelling alice, but unfortunately when I try to open storytelling alice, it crashes most of the time before the GUI opens. (Anyone had success running story telling alice on vista? Did you have to do anything to get it to run properly - modify permissions perhaps?)

Since storytelling alice crashes alot, I tried alice. To make programming more interesting for my daughter I wanted to add some richer functionality to the alice characters (much like storytelling alice). However, I am having a hard time figuring out how to do this. I tried adding a character to my world, then adding some custom functions, and saving the character as a new object (an a2c file). It appears that the functions do not get saved with the character because when I try to import the character into a new world, the custom functions are not there.

Next I tried to figure out how custom methods are saved when you save your project. I have looked at the files stored in the a2w save file, but I couldn't see the customs functions I defined in this file. There is a python script file (with nothing in it), and some xml files, but none of the files seem to include the custom functions I defined. Where are custom methods stored? Is there a way to include custom methods inside the character (a2c) files? can you use the python script to extend the character functionality? Any info would be appreciated.

-llarsen
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 08-04-2009, 11:35 PM

I'm really not sure why that isn't working for you. Since methods and functions can be attached to objects, they can indeed be imported along with the object itself (as proof, look at the walking people objects in Alice 2.2 They all come with custom functions built in).

Are you sure you created the method under the object's own methods tab? If you click on an object in the Alice world, then look on the left side of the screen and click the methods tab, there should be a "create method" button at the very top (unless there are already custom methods saved to the object, in which case, it will be under those). Clicking the create method button will bring up a box which you can type a method name into, and will open the new method in the scripting area of Alice. When this object is saved as an .a2c, then imported into another world, it will reatain all of the methods saved to it in this way.


(')>
   
Reply With Quote
Old
llarsen
Guest
 
Status:
Posts: n/a
Default 08-05-2009, 10:25 AM

I did create the method on the object itself. Actually, during my first attempt I created it as part of the world object and realized that it really needed to be part of the object I was saving. I tried to copy and past it between objects but this didn't seem to work (this would be a really nice feature by the way). However when I imported the object into a new world, the method I created was not there. I am using Alice 2.2. It is nice to know that the methods are supposed to be saved with the object. It is nice to be able to reuse functionality you have created before. I will have to play around with this again and see if I did something wrong.

I still have the question of where methods that you create get saved. Are they supposed to be part of the xml files stored in the a2c file (or a2w file for worlds)? I assume that they should be in the file somewhere, but I have not been able to find them in the worlds I created, or others from the standard gallery that appear to have extra methods included as part of the object.
   
Reply With Quote
Old
llarsen
Guest
 
Status:
Posts: n/a
Default 08-05-2009, 10:37 AM

I looked at some of your examples, and I can see that the methods are stored in the world as xml files. Thanks for the comments.
   
Reply With Quote
Old
hhamilton
Guest
 
Status:
Posts: n/a
Default 08-05-2009, 07:36 PM

Along these same lines... where are the built in methods for Alice stored? We'd like to redo the interface and /revise/eliminate somethings to make Alice into a writing tool.
   
Reply With Quote
Old
llarsen
Guest
 
Status:
Posts: n/a
Default 08-07-2009, 12:38 AM

I found out why I was not seeing the methods in the a2c file. I was renaming the file to a zip file and using vistas built in zip viewer. For some reason this does not show everything in the zip file. When I use 7zip to view the zip file I am able to see all the methods. Not sure why vistas built in zip viewer does not work correctly, but that appears to be the issue.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 08-07-2009, 01:21 AM

Now that actually makes sense. I know personally that many Zip Viewers and Unzip programs are unstable, especially those from Windows. I only use a Windows Unzipper if I have no alternative, otherwise I go with 7-zip every time.


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