Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Objects (http://www.alice.org/community/forumdisplay.php?f=8)
-   -   Save Tool (http://www.alice.org/community/showthread.php?t=7968)

DensetsuNoKaboom 01-22-2012 02:28 PM

1 Attachment(s)
Looks like this is exactly what Alice needs, thank you! :D

EDIT: I made a simple world to test this tool. It works perfectly as far as I can tell.

Dj Tech42 01-24-2012 06:53 PM

I'm getting a KeyError with it...


Error during simulation.


Alice version: 2.2 12/01/2011

Throwable that caused the error:
Traceback (innermost last):
File "edu.cmu.cs.stage3.alice.core.property.ScriptProperty[name=script,owner=edu.cmu.cs.stage3.alice.core.response.ScriptResponse[world.saveTool.has_var.__Unnamed2__]]", line 1, in ?
File "<string>", line 42, in has
KeyError: Dj Tech42.License to Fly.__default

Lirtjasksta 01-24-2012 07:54 PM

Helpful
 
Any error for this FileIOTool.. I will try to download this one... thanks

arty-fishL 01-25-2012 03:25 AM

I know I said I will be gone for a while, but I cant leave without fixing bugs in this :).

Dj Tech42, the error your getting is in a validity check I have. For every game there is a default value automatically saved upon every save that must equal "valid", under the name "__default" (please don't use any names with double underscores at the start when saving, they are reserved for use by the internal workings of the tool, I should have said that in the main post, but that is not the problem here anyway).
What I should have noticed in the code is that when that value does not exist there will be an error when the code tries to get it.

I've fixed it by adding my friendly dict class (a class that emulates a python dictionary, but does not throw horrible errors) that I built for Addons.

[B]I've updated the top post with the new version.[/B]
I hope no more bugs come up, bye for a while.

InsertName 01-25-2012 08:11 PM

Now I can finally make long RPGish games.

TauTrumpsPi 01-27-2012 06:56 PM

This is actually exactly what I was using the file I/O tool for in the first place. This looks great, thanks Arty!

DensetsuNoKaboom 01-28-2012 06:08 PM

[QUOTE=InsertName;46011]Now I can finally make long RPGish games.[/QUOTE]
I know what I'm gonna do today!

GameKid 02-11-2012 02:33 AM

Two questions.
Where are the saved strings and numbers placed when saved, and what does the author string change (Example, how will the result be different if I enter A for the name from the result if I enter B for the name)?

arty-fishL 02-11-2012 05:20 AM

[QUOTE=GameKid;46413]Two questions.
Where are the saved strings and numbers placed when saved, and what does the author string change (Example, how will the result be different if I enter A for the name from the result if I enter B for the name)?[/QUOTE]
Two answers.

The save data is stored in one file; location "[I]Alice 2.2\Required\saveToolData[/I]" (it has no extension). That file is basically a stringified python structure and therefore loads and saves nicely with python.

The author string and game title string are both in place just to ensure each save variable gets a unique name and people who use the same game title don't overwrite each others saves. I may also give it other uses in the future, but for now its just an easy way to create unique save variable names.

Dj Tech42 02-11-2012 01:10 PM

[QUOTE=arty-fishL;46415]Two answers.

The save data is stored in one file; location "[I]Alice 2.2\Required\saveToolData[/I]" (it has no extension). That file is basically a stringified python structure and therefore loads and saves nicely with python.

The author string and game title string are both in place just to ensure each save variable gets a unique name and people who use the same game title don't overwrite each others saves. I may also give it other uses in the future, but for now its just an easy way to create unique save variable names.[/QUOTE]

Can you use the author string to make profiles? (separate variables for every user playing the game)


All times are GMT -5. The time now is 05:52 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.