Author Topic: Saving Variables  (Read 7558 times)

Saving Variables
A variable events expansion that allows saving and loading.


Description
This is an expansion to the Variable/Conditional events created by Destiny and Chrono. It allows for saving and loading player and client variables to a .txt file located in your "config/server" folder. If you know what you're doing, you can change where these variables are saved to if you need to by looking in the script and editing $VSF::Path.

Please note that all of the variables will be saved to a single .txt, so you will NOT have a load of files spamming up your folder.

To save or load a variable, click on the Client option in the wrench events menu. You should see both saveVariable and loadVariable on the list. (Yes, they're output events.) Click the one you want and type in the name of the variable, and bam, it saves or loads.

Questions? Suggestions? Found a glitch?
Please post any feedback you may have.

Download
Event_SavingVariables.zip (Last Updated: Thu Dec 25, 2008 9:12 pm)

Installation
Put Event_SavingVariables.zip into the Add-Ons folder in your Blockland folder.

Required Add-On
This Add-On requires Event_Variables.zip in order to work, so make sure to download it too!

Click Here to view this file on the RTB Download Manager
« Last Edit: December 25, 2008, 08:17:09 PM by Truce »


So two separate clients can save different integers of the same variable, and load them correctly?

So two separate clients can save different integers of the same variable, and load them correctly?

Correct. It also saves the BLID of the client, which is how it distinguishes them.

What happens if a noob on your server saves them more money then they have and then they load it for themselves?

What happens if a noob on your server saves them more money then they have and then they load it for themselves?

What?
The only input is the variable's name.

Saving just saves the current value of it, and loading replaces the current value of it with the one saved in the .txt.


im new to variable's ... can this thing be used to make it so when you click a button it save so you can leave and can it make it so when you join again you can click a "load" brick and load your weapons/playertype?


im new to variable's ... can this thing be used to make it so when you click a button it save so you can leave and can it make it so when you join again you can click a "load" brick and load your weapons/playertype?
Use saveVariable to save a player/clients variable, then when they join another time, you can use loadVariable to set the player/clients variable to the saved value.



Use saveVariable to save a player/clients variable, then when they join another time, you can use loadVariable to set the player/clients variable to the saved value.

Correct. Since it saves to a .txt file in your Blockland folder, you will always be able to load any saved variables. Unless, of course, you edit/delete the file.

Correct. Since it saves to a .txt file in your Blockland folder, you will always be able to load any saved variables. Unless, of course, you edit/delete the file.
stuff! EPIC!

*bows down

Praise.

*bows down

so does this thing let me somehow save a playertype/item's or not?if so please tell me how i needit badly for an RPG