Home   Help Search Login Register  

Author Topic: Oracle-Saving (BETA 1.0)  (Read 2409 times)

0 Members and 1 Guest are viewing this topic.

Offline Oracle

  • Members
  • *
Oracle-Saving (BETA 1.0)
« on: 04 Mar 2009, 00:40:14 »
Hello everyone, Just thought i would post this here.

It's a saving/loading script that will work whilst the mission is running to load and save any variables. Useful for long games (mainly RPG missions).

This is just a basic version i put together, in the future i will be making this alot more advanced, just wanted to
see if it was of any use to anyone.

So would be great to get some feedback on it. It's pretty obsolete compared to armalib and the lot, but it could provide useful to the servers with linux on.

The example mission is pretty basic (sorry) i had to throw something together quickly, If anyone likes or uses this script i will probably go ahead and make it more advanced, the functions are listed in the readme in the folder if anyone has trouble working out what they do, there's a brief example and explanation on what they do.  :)

Oh and of course its just a beta, so let me know if there's any issues  :)

Hope you enjoy
Oracle.

« Last Edit: 04 Mar 2009, 00:51:55 by Oracle »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Oracle-Saving (BETA 1.0)
« Reply #1 on: 04 Mar 2009, 14:53:02 »
You use Oracle_ as your personal code tag. Valid OFPEC tags are 3-5 letters, all upper case, such as SPON_ and should be registered to prevent multiple people using the same tag and causing issues. Sorry to make a big deal about this, but I'm mentioning it as much to remind other people as to tell you.

Sometimes I see you use (A very common mistake, that I make myself):
Code: [Select]
publicVariable Saved_Array;
rather than:
Code: [Select]
publicVariable "Saved_Array";
On a more advanced note, since you update a networked value on any client, it is possible that you could lose data when the array is updated on multiple clients at once. Ideally, the array should only be updated on the server and the clients should just send a message asking the server to update and re-public the array.

You don't need to re-public a value on JIP. JIP players automatically synchronise with the last publiced values. Thus, you don't need to use onPlayerConnected to sync player data.
Code: [Select]
_Handler = [] ExecVM "Oracle-Core\Oracle-Core.sqf";
WaitUntil {ScriptDone _Handler};
Is a complex way to do this:
Code: [Select]
[] call compile preprocessFileLineNumbers "Oracle-Core\Oracle-Core.sqf";
Some nice ideas and techniques used there though, so don't be put off by my corrections (not many people even try advanced scripting, so...). I never did get around to adding this functionality to SPON Money, for which I am continually berated by certain people :whistle: (I gave up that project and did other more interesting things instead)! I look forward to updates and new projects...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Oracle-Saving (BETA 1.0)
« Reply #2 on: 04 Mar 2009, 15:54:21 »
Well a 6 character ORACLE_ tag should do as well.  :)

Thanks for posting Oracle and thanks to Spooner for your comments!
Learnt something new again.  :whistle:

Offline Oracle

  • Members
  • *
Re: Oracle-Saving (BETA 1.0)
« Reply #3 on: 04 Mar 2009, 16:07:38 »
Thanks for the heads up, didn't think the tags were that important, just thought it added a personal touch  :-[.

Quote
Sometimes I see you use (A very common mistake, that I make myself):

publicVariable Saved_Array;
rather than:

publicVariable "Saved_Array";

Thanks lol, didn't see that silly mistake  :)


After scripting it i realised that i should have done the saving/loading mainly by the server, for the next version i will make it so the server handles all the scripts and just updates the array for everyone and sends the loaded values to the players, Should also increase performance a little instead of each player sending the array around... and deep into a mission that array could get very big, Also there will be other saving options, should as saving your weapon and magazine's and other thing's like that.

I was asked to do this script a while ago by some people making quarantine unleashed i think it was called, they vanished a while ago though and i never got around to finishing it.

I actually wanted to do something similar to SPON_Money in the future but i don't really want to step on anyone's toes lol.







Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Oracle-Saving (BETA 1.0)
« Reply #4 on: 04 Mar 2009, 16:39:35 »
Well a 6 character ORACLE_ tag should do as well.
Yes, but to register a tag here, it must be exactly 3-5 characters long (yes, ok, that is an arbitrary limit :P) Although a 6- or a 20-character tag would still have the desired effect (create a namespace for your own global variables), it is best if the tag is short (max 5 characters) and that it has at least a few characters (min 3) so the tag contains useful info if you don't recognise it (e.g. I could use S_, but SPON_ is easier to remember, or guess, as associated to Spooner).

@Oracle: As I said, I always intended to go back to SPON Money eventually, but I realised I didn't find RPG scenarios very interesting in an ArmA setting, so I lost interest in the script (To keep motivated, I need to want to use the script I'm making myself). I might go back to it one day, but I can't promise anything.

Although a lot of people have already written a script like this before as parts of larger scripts or missions, it is always good to have a generic component like this that people could use in their own projects. In fact, it is on the cards for SPON Core (something I sorely need to work on again), and it would be relatively simple, since it already contains scripts to streamline data storage (associative array data type) and mp comms (SPON Core event system).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)