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)

arty-fishL 01-21-2012 11:59 PM

Save Tool
 
2 Attachment(s)
[FONT=Impact][SIZE=4][COLOR=DarkGreen]Arty-fishL's[/COLOR] Save Tool[/SIZE][/FONT]
[FONT=Impact][COLOR=DimGray]
[SIZE=3]Description[/SIZE][/COLOR][/FONT]
[IMG]http://img408.imageshack.us/img408/8206/reviewseparator.png[/IMG]
This is basically File I/O Tool - version 2.
For the old tool [URL="http://alice.org/community/showthread.php?t=6758"]click here[/URL].

This is a save tool based upon my previous File I/O Tool.
It is much simpler and easier to use.
[B]It is capable of saving and loading world variables.[/B]
[FONT=Impact][SIZE=3][COLOR=DimGray]
Instructions[/COLOR][/SIZE][/FONT]
[IMG]http://img408.imageshack.us/img408/8206/reviewseparator.png[/IMG]
Import the object into the world you want to use it in.
Don't rename it and don't delete any of its variables, methods or events.

Set saveTool's variable - [I]game_title[/I] - to the name of your game.
Set saveTool's variable - [I]author[/I] - to your name.
[FONT=Impact][SIZE=3]
[COLOR=DimGray]Compatability[/COLOR][/SIZE][/FONT]
[IMG]http://img408.imageshack.us/img408/8206/reviewseparator.png[/IMG]
So far this [B]only works with world level variables of string or number type[/B].

This can be used simultaneously with the File I/O Tool.

Please use this for game saves from now on.

[FONT=Impact][SIZE=3][COLOR=DimGray]Updates[/COLOR][/SIZE][/FONT]
[COLOR=Gray][IMG]http://img408.imageshack.us/img408/8206/reviewseparator.png[/IMG]
[B][SIZE=1]2012[/SIZE][/B][/COLOR]
22 Jan - 1.0 - Original version
25 Jan - 1.1 - Fixed bug with validity check
06 Aug - 1.2 - Added internal functionality for ArtyOnline Tool compatibility
[COLOR=Gray][B][SIZE=1]201[SIZE=1]3[/SIZE][/SIZE][/B][/COLOR]
07 Mar - 1.3 - Added support for the [URL="http://alice.org/community/showthread.php?p=52378#post52378"]Alicedoc mod[/URL]

[FONT=Impact][SIZE=3][COLOR=DimGray]Further Help[/COLOR][/SIZE][/FONT]
[IMG]http://img408.imageshack.us/img408/8206/reviewseparator.png[/IMG]
[B]Read below only if you require help:[/B]
[COLOR=black]
[/COLOR] [COLOR=black][U][SIZE=1][B]VARIABLES:[/B][/SIZE][/U][/COLOR]
[SIZE=1][COLOR=Blue][B]- game_title[/B][/COLOR]
[/SIZE][SIZE=1][COLOR=DarkGreen]Set by you.[/COLOR]
The name of the game/world[/SIZE][SIZE=1].[/SIZE][SIZE=1]

[COLOR=Blue][B]- author[/B][/COLOR]
[COLOR=DarkGreen]Set by you.
[/COLOR]Your name/nickname/username[/SIZE][SIZE=1].[/SIZE][SIZE=1]

[/SIZE][SIZE=1][COLOR=Blue][B]- has_var_output[/B][/COLOR]
[COLOR=Red]Do not change.[/COLOR]
The result of a [COLOR=Sienna][I]has_var[/I][/COLOR] check - true if variable is saved, false if it is not in the save data.[/SIZE]

[SIZE=1][COLOR=Blue][B]- @alicedoclocalvars[/B][/COLOR]
[COLOR=Red]Do not change.[/COLOR]
An internal data variable for the [URL="http://alice.org/community/showthread.php?p=52378#post52378"]Alicedoc mod[/URL].[/SIZE]

[COLOR=black][U][SIZE=1][B]METHODS:[/B][/SIZE][/U][/COLOR]
[SIZE=1][COLOR=Sienna][B]- save_var[/B][/COLOR]
Adds a world variable and its value to the save data.
[COLOR=Indigo][COLOR=black][U]Parameters:[/U][/COLOR]
var[/COLOR] - the name of the world level variable (without [I]world.[/I] at the start), ie. [I]myvar[/I]
[COLOR=Indigo]name[/COLOR] - the identifier to use in the save file, it is the name used when loading.

[COLOR=Sienna][B]- load_var[/B][/COLOR]
Gets a value from the save data and sets a world level variable as it.[/SIZE][SIZE=1]
[U][COLOR=black]Parameters:[/COLOR]
[/U][/SIZE][SIZE=1][COLOR=Indigo]name[/COLOR] - the identifier used in the save file
[/SIZE][SIZE=1][COLOR=Indigo]var[/COLOR] - the name of the world level variable (without [I]world.[/I] at the start), ie. [I]myvar[/I].[/SIZE][SIZE=1]

[/SIZE][SIZE=1][COLOR=Sienna][B]- has_var[/B][/COLOR]
Checks if a variable is in the save data and then
sets saveTool's [COLOR=Blue][I]has_var_output[/I][/COLOR] variable to true or false if it exists or not.[/SIZE][SIZE=1]
[U][COLOR=black]Parameters:[/COLOR]
[/U][/SIZE][SIZE=1][COLOR=Indigo]name[/COLOR] - the identifier used in the save file[/SIZE][SIZE=1].[/SIZE]

[SIZE=2][B]Support me by using [URL="http://adf.ly/8J0dL"][B][SIZE=2]this DOWNLOAD link[/SIZE][/B][/URL][/B] (AdF.ly)[/SIZE]

Dj Tech42 01-22-2012 12:01 AM

Awesome! This is a lot easier and more automatic than the other FileIOTool.

arty-fishL 01-22-2012 12:20 AM

[QUOTE=Dj Tech42;45898]Awesome! This is a lot easier and more automatic than the other FileIOTool.[/QUOTE]So, have you tried it then?
It works with numbers too, so there's no need for the string to number conversion idea I was going to implement before.

Dj Tech42 01-22-2012 09:58 AM

[QUOTE=arty-fishL;45902]So, have you tried it then?
It works with numbers too, so there's no need for the string to number conversion idea I was going to implement before.[/QUOTE]

I was using your string-to-number conversion script before, but this should make things faster.
I haven't been able to try this yet, but it sounds good. However, I may have to change some things to make it cross-platform like I did with the File I/O Tool.

jediaction 01-22-2012 10:19 AM

I used it in Halo 2. It works great, but you have to have the file it is looking for to switch to, in the same folder.

x2495iiii 01-22-2012 10:35 AM

Ought I to sticky this post most excellent?

Dj Tech42 01-22-2012 11:08 AM

[QUOTE=x2495iiii;45916]Ought I to sticky this post most excellent?[/QUOTE]

Yes

jediaction 01-22-2012 12:07 PM

Very cool. now it's a sticky post. So, what exactly do sticky posts do X2495iiii? I never really learned what they were.

arty-fishL 01-22-2012 12:10 PM

Multiquote time
[QUOTE=Dj Tech42;45909]I was using your string-to-number conversion script before, but this should make things faster.
I haven't been able to try this yet, but it sounds good. However, I may have to change some things to make it cross-platform like I did with the File I/O Tool.[/QUOTE]It should work perfectly cross platform, without any changes. You don't actually do anything with files, that is all handled by the tool, you just ask it to save or load a variable. Everything, for every game using this is stored in one file, this is a better approach than using multiple files. You therefore definitely need to set the [I]game_title[/I] and [I]author[/I] variables otherwise you might interfere with somebody else's saves.

[QUOTE=jediaction;45913]I used it in Halo 2. It works great, but you have to have the file it is looking for to switch to, in the same folder.[/QUOTE]:confused:That's the World Loader Tool you're talking about, this is a new tool for saving.

[QUOTE=x2495iiii;45916]Ought I to sticky this post most excellent?[/QUOTE]
[QUOTE=Dj Tech42;45918]Yes[/QUOTE]Yay :D.

x2495iiii 01-22-2012 12:15 PM

Forsooth.


All times are GMT -5. The time now is 09:20 PM.

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