Alice Community  

Go Back   Alice Community > Alice 2 > Share Objects

Reply
 
Thread Tools Display Modes
Save Tool
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Lightbulb Save Tool - 01-22-2012, 12:59 AM

Arty-fishL's Save Tool

Description


This is basically File I/O Tool - version 2.
For the old tool click here.

This is a save tool based upon my previous File I/O Tool.
It is much simpler and easier to use.
It is capable of saving and loading world variables.

Instructions


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 - game_title - to the name of your game.
Set saveTool's variable - author - to your name.

Compatability


So far this only works with world level variables of string or number type.

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

Please use this for game saves from now on.

Updates

2012

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
2013
07 Mar - 1.3 - Added support for the Alicedoc mod

Further Help

Read below only if you require help:

VARIABLES:
- game_title
Set by you.
The name of the game/world
.

- author
Set by you.
Your name/nickname/username
.

- has_var_output
Do not change.
The result of a has_var check - true if variable is saved, false if it is not in the save data.


- @alicedoclocalvars
Do not change.
An internal data variable for the Alicedoc mod.


METHODS:
- save_var
Adds a world variable and its value to the save data.
Parameters:
var
- the name of the world level variable (without world. at the start), ie. myvar
name - the identifier to use in the save file, it is the name used when loading.

- load_var
Gets a value from the save data and sets a world level variable as it.

Parameters:
name - the identifier used in the save file
var - the name of the world level variable (without world. at the start), ie. myvar.

- has_var
Checks if a variable is in the save data and then
sets saveTool's has_var_output variable to true or false if it exists or not.

Parameters:
name - the identifier used in the save file.

Support me by using this DOWNLOAD link (AdF.ly)
Attached Files
File Type: a2c SaveTool.a2c (35.6 KB, 34 views)

Last edited by arty-fishL; 04-06-2013 at 08:33 PM. Reason: Update v1.2 - internal updates
   
Reply With Quote
Old
Dj Tech42
Senior Member
 
Dj Tech42's Avatar
 
Status: Offline
Posts: 202
Join Date: Feb 2011
Default 01-22-2012, 01:01 AM

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


Flight Simulator with Dogfight Modes:
http://www.alice.org/community/showthread.php?t=6840
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 01-22-2012, 01:20 AM

Quote:
Originally Posted by Dj Tech42 View Post
Awesome! This is a lot easier and more automatic than the other FileIOTool.
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.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Old
Dj Tech42
Senior Member
 
Dj Tech42's Avatar
 
Status: Offline
Posts: 202
Join Date: Feb 2011
Default 01-22-2012, 10:58 AM

Quote:
Originally Posted by arty-fishL View Post
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.
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.


Flight Simulator with Dogfight Modes:
http://www.alice.org/community/showthread.php?t=6840
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-22-2012, 11: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.


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 01-22-2012, 11:35 AM

Ought I to sticky this post most excellent?


(')>
   
Reply With Quote
Old
Dj Tech42
Senior Member
 
Dj Tech42's Avatar
 
Status: Offline
Posts: 202
Join Date: Feb 2011
Default 01-22-2012, 12:08 PM

Quote:
Originally Posted by x2495iiii View Post
Ought I to sticky this post most excellent?
Yes


Flight Simulator with Dogfight Modes:
http://www.alice.org/community/showthread.php?t=6840
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-22-2012, 01: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.


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Arrow 01-22-2012, 01:10 PM

Multiquote time
Quote:
Originally Posted by Dj Tech42 View Post
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.
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 game_title and author variables otherwise you might interfere with somebody else's saves.

Quote:
Originally Posted by jediaction View Post
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.
That's the World Loader Tool you're talking about, this is a new tool for saving.

Quote:
Originally Posted by x2495iiii View Post
Ought I to sticky this post most excellent?
Quote:
Originally Posted by Dj Tech42 View Post
Yes
Yay .


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
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 01-22-2012, 01:15 PM

Forsooth.


(')>
   
Reply With Quote
Reply

Tags
file, load, save, variable, write

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