Jump to content
code34

OO PDW - oriented object Persistent Data World

Recommended Posts

Hi guys :)

 

Just release the lastest version of OO_PDW : 0.74

 

Changes log:

            - fix magazines count for infantry
            - turn off gps add
            - fix binocular not assigned
            - Add saveObjectsAroundPos method
            - Add saveObjectsInMarkers method
            - Add saveObjectsOutOfMarkers method
            - Add saveObjectsExcludingObjects method
            - Add saveObjectsExcludingTypes

 

Download From Dropbox

  • Like 2

Share this post


Link to post
Share on other sites

wow amazing stuff, was expecting to wait a few weeks.

 

Great work!

 

hope you will like it ! :D

 

note : give me feedback about the features, there is certainly things to improve

Share this post


Link to post
Share on other sites

Just curious as to how this works with ALiVE.  I have not been able to get their database to work for me, and was looking for something that I and my other tech guys could manage ourselves.  The key feature to alive that we like is the virtualization of units, allowing us to create a living battle field without serious performance hits.  

I am wondering if this can tell if the unit's are virtual or not, or if it will just spawn all units that it recognized and then ALiVE will spawn another set?

Share this post


Link to post
Share on other sites

Just curious as to how this works with ALiVE.  I have not been able to get their database to work for me, and was looking for something that I and my other tech guys could manage ourselves.  The key feature to alive that we like is the virtualization of units, allowing us to create a living battle field without serious performance hits.  

I am wondering if this can tell if the unit's are virtual or not, or if it will just spawn all units that it recognized and then ALiVE will spawn another set?

 

hI ohally

 

If alive doesn't support officialy the function, it will save and restore units as they physical exist :)

Share this post


Link to post
Share on other sites
_markers = ["marker_1","marker_2"]

Hey code, if you used this with the  saveObjectsOutOfMarkers  function then had a saveObjectsInMarkers in side of it or vice versa, which one has priority?

Share this post


Link to post
Share on other sites

i was sure you will ask for this, but i didn't how much time it will take :))

 

In fact, currently, you can not combine all objects save methods together

 

If you call for example 2 methods. The second call will erase the save done by the first.

 

It doesn't work as:

A + B + C + D = ABCD

 

it works sequential and overwriting as:

A, B replace A, C replace B, etc

 

you have to choose one methods, instead others, and call it at unique place in your code (to avoid overwrite)

 

This post concerning all global object saves :

saveObjects

saveObjectsExcludingTypes

saveObjectsExcludingObjects

saveObjectsAroundPos

saveObjectsInMarkers

saveObjectsOutOfMarkers

 

It s not a final state and i will improve this (it s a first release) :) i must be sure it s happen logic and reliable for everybody.

 

To answer to your post, concerning futur implementation :

 

if _x is exclude from A

if _x is include from B

at first stage, you will retrieve  _x include by B cause it s the simpliest way to do (OO_PDW, will parse sequential all the backup files, and will find an entry for B)

Share this post


Link to post
Share on other sites

I have tried loadplayers and saveplayers but it does not appear to affect anything. In single player editor. I called saveplayers, then moved around a bit, dropped some weapons and called loadplayers, but nothing happens. I called it from the console.

Share this post


Link to post
Share on other sites

hi, and do you initiate the object ? :)

 

you should don't use it in editor, try in script it s more reliable.

Share this post


Link to post
Share on other sites

 

It doesn't work as:

A + B + C + D = ABCD

 

it works sequential and overwriting as:

A, B replace A, C replace B, etc

But I can still save players separately in the same mission and later use commands that affect objects and it wont erase the player saves?

 

Also can we get easier to follow syntax examples? I keep getting errors when it comes to arrays in saveObjectsAroundPos.

Another problem for me is getting a specific crate to save:

crate script

		_pdw = ["new", "profile"] call OO_PDW;
		
		
		
		_bool = ["saveObject", ["crate1", "BOX_IND_Wps_F"]] call _pdw;
12:02:22 Error in expression <e = "pdw_object_" + _name;

_array = [
(typeof _object),
(getpos _object),
(getd>
12:02:22   Error position: <typeof _object),
(getpos _object),
(getd>
12:02:22   Error typeof: Type String, expected Object
12:02:22 File C:\Users\cat\Documents\Arma 3\missions\cat_cp_1.Stratis\persistence\oo_pdw.sqf, line 404

the crate "crate1 exists in the map and I used the classname displayed in the 3d editor

 

 

And using crate1 as a variable instead of string in the script creates a new error:

12:04:01 Error in expression <ss, {nil}]));
};

_name = "pdw_object_" + _name;

_array = [
(typeof _object),
(>
12:04:01   Error position: <+ _name;

_array = [
(typeof _object),
(>
12:04:01   Error +: Type Object, expected Number,Array,String,Not a Number
12:04:01 File C:\Users\cat\Documents\Arma 3\missions\cat_cp_1.Stratis\persistence\oo_pdw.sqf, line 401

I think the script is very powerful and useful but better example to follow would be great to make its use easier for less experienced scripters.

Share this post


Link to post
Share on other sites

hi alleycat

 

players and objects don't use the same files.

 

i will add more typing control in next release :) Can you  copy/paste your code for saveObjectsAroundPos.

 

Anyway, for "saveobject", it seems its because you dont give the right parameter to the pdw.

 

The first element is a string to identiy the backup like "thenameofmyobject", the second one is the object itself.

Share this post


Link to post
Share on other sites

Ok so as for load and save, I think I was confused by:

 

 

    Function: _bool = ["saveObject", [_name, _object]] call _pdw;
    Save object, and all its cargo
        
    Parameters:
        _name : string name of the object to save
        _object :  object


    Function: _object = ["loadObject", _name] call _pdw;
    Load object and return object loaded
        
    Parameters:
        _name : string name of the object to load

 

 

string name of the object to load - does that mean the CLASSNAME of the object? I got it working but that might be an accident. I dropped one crate ( Box_NATO_Ammo_F classname) and called the crate variable crate1.

Then:

// execVM	"persistence\save.sqf";
		

		_pdw = ["new", "profile"] call OO_PDW;
		
		
		
		hint "Save all players";
		"savePlayers" call _pdw;
		sleep 2;

		_pdw = ["new", "profile"] call OO_PDW;


		hint "Restore all Players";
		"loadPlayers" call _pdw;	
		sleep 2;

This correctly spawned the saved crate (with the same inventory as it was saved). But "string name of object" still confuses me.

EDIT: After reading your post again I get it. the name is just a label I can freely choose so it can be identified in the database?

 

 

 

As for savenear

/*
	Function: ["saveObjectsAroundPos", _array] call _pdw;
	Save all objects informations (type, position, damage) around an array containing [_position, _maxdistance]
	
	Parameters:
		_array : [[_position, _maxdistance], ..]
		_position : position array
		_maxdistance: scalar
	Return : True if success


*/


// execVM	"persistence\savenear.sqf";
_pdw = ["new", "profile"] call OO_PDW;
["saveObjectsAroundPos", [[getmarkerpos "strat_players", 100]]call _pdw;//This line causes error

Getting an error somwhere in the bracket.

Share this post


Link to post
Share on other sites

Hey code34,

I noticed that iniDBI2 is optional, but I also noticed some SP commands in the github example mission. Does this script and iniDBI2 work on dedicated servers in a persistent way?

Thanks, :)

Rawner135

Share this post


Link to post
Share on other sites

We have the script working on dedicated. Although we are saving to players profile. Inidbi should work also but all players need to run it to have their own database

Share this post


Link to post
Share on other sites

Hey code34,

I noticed that iniDBI2 is optional, but I also noticed some SP commands in the github example mission. Does this script and iniDBI2 work on dedicated servers in a persistent way?

Thanks, :)

Rawner135

I'm using INIDBI 2 for object persistence on my dedicated server, it works perfectly. I haven't attempted to use player saving as of yet.

Share this post


Link to post
Share on other sites

Ok so as for load and save, I think I was confused by:

 

 

string name of the object to load - does that mean the CLASSNAME of the object? I got it working but that might be an accident. I dropped one crate ( Box_NATO_Ammo_F classname) and called the crate variable crate1.

Then:

// execVM	"persistence\save.sqf";
		

		_pdw = ["new", "profile"] call OO_PDW;
		
		
		
		hint "Save all players";
		"savePlayers" call _pdw;
		sleep 2;

		_pdw = ["new", "profile"] call OO_PDW;


		hint "Restore all Players";
		"loadPlayers" call _pdw;	
		sleep 2;

This correctly spawned the saved crate (with the same inventory as it was saved). But "string name of object" still confuses me.

EDIT: After reading your post again I get it. the name is just a label I can freely choose so it can be identified in the database?

 

 

 

As for savenear

/*
	Function: ["saveObjectsAroundPos", _array] call _pdw;
	Save all objects informations (type, position, damage) around an array containing [_position, _maxdistance]
	
	Parameters:
		_array : [[_position, _maxdistance], ..]
		_position : position array
		_maxdistance: scalar
	Return : True if success


*/


// execVM	"persistence\savenear.sqf";
_pdw = ["new", "profile"] call OO_PDW;
["saveObjectsAroundPos", [[getmarkerpos "strat_players", 100]]call _pdw;//This line causes error

Getting an error somwhere in the bracket.

 

yes it s a label :)

 

for error i will check, and fix it in the next release.

Share this post


Link to post
Share on other sites

Ok so as for load and save, I think I was confused by:

 

 

string name of the object to load - does that mean the CLASSNAME of the object? I got it working but that might be an accident. I dropped one crate ( Box_NATO_Ammo_F classname) and called the crate variable crate1.

Then:

// execVM	"persistence\savenear.sqf";
_pdw = ["new", "profile"] call OO_PDW;
["saveObjectsAroundPos", [[getmarkerpos "strat_players", 100]]call _pdw;//This line causes error

Getting an error somwhere in the bracket.

 

hi

 

missing a bracket :)

 

 

["saveObjectsAroundPos", [[getmarkerpos "strat_players", 100]]]call _pdw;//This line causes error

Share this post


Link to post
Share on other sites

G'day code34, :)

Quick question. When I use the function "loadPlayer", will it automatically acquire the player's name or ID to load his/hers inventory, location, etc?

Thanks!

Rawner135

Share this post


Link to post
Share on other sites

Hi guys :)

 

Just release the new version of pdw 0.76

 

Download from Dropbox

 

changelogs:

            - Add setIncludingMarkers method
            - Add setExcludingMarkers method
            - Add setAroundPos method
            - Add setExcludingTypes method
            - Add setExcludingObjects method
            - Add setIncludingObjects method
            - Delete saveObjectsAroundPos method
            - Delete saveObjectsInMarkers method
            - Delete saveObjectsOutOfMarkers method
            - Delete saveObjectsExcludingObjects method
            - Delete saveObjectsExcludingTypes
            - Control type methods parameters

 

I changed the filters method to save objects introduced by 0.74 be carefull about it :)

 

Now all filters (include/exclude) options are cumulatives.

 

 

Working note:

  • if you include some specific objects, the save will be : your include objects - your exclude objects
  • if you include nothing the save will be : all objects - your exclude objects

 

 


        //Filters example - will save object around player in a perimeter of 100, around chopper in perimeter of 10, exclude chopper type, exclude objects in markers test1 and test2 :)

       _aroundpos = [[position player, 100], [position chopper, 10]];
       ["setAroundPos", _aroundpos] call _pdw;
       ["setExcludingTypes", ["B_Heli_Light_01_F"]] call _pdw;
       ["setExcludingMarkers", ["test1", "test2"]] call _pdw;

 

        "saveObjects" call _pdw;

  • Like 1

Share this post


Link to post
Share on other sites

:)

 

call compilefinal preprocessFileLineNumbers "oo_pdw.sqf";

_pdw = ["new", "inidbi"] call OO_PDW;

"loadPlayers" call _pdw;
"loadGroups" call _pdw;

_refreshTime = 30; // в Ñекундах
 
while {true} do
{

sleep _refreshTime;

"savePlayers" call _pdw;
"saveGroups" call _pdw;

systemChat "Сохранение...";
};

no work read player ...

Share this post


Link to post
Share on other sites
call compilefinal preprocessFileLineNumbers "oo_pdw.sqf";

_pdw = ["new", "inidbi"] call OO_PDW;

"loadPlayers" call _pdw;
"loadGroups" call _pdw;

_refreshTime = 30; // в Ñекундах
 
while {true} do
{

sleep _refreshTime;

"savePlayers" call _pdw;
"saveGroups" call _pdw;

systemChat "Сохранение...";
};

no work read player ...

 

 

can you give more informations ? :D

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×