Author: code34
Author Website: https://github.com/code34/

Requirements: INIDBI2

Version: 0.91

Short description: Create a main bus message between clients and server.

Support the author:

100% of your donation goes directly to the author of this content!
Date: 2018-09-19 13:55


Comments: (1)
Rating:



 





Object Oriented Persistent Data World (OO PDW)

by
code34


Description:
OO PDW is a class (object oriented) that permits to save & restore world and players datas and make worlds persistent. This object uses Object Oriented SQF scripting of Naught and requires the INIDBI addon.


Features:
- Save & restore all objects
- Save & restore players/units
- Save & restore inventory


Installation / Usage:
Put the "oo_pdw.sqf" and the "oop.h" files in your mission directory
Put this code into your mission init.sqf
Call compilefinal preprocessFileLineNumbers "oo_pdw.sqf"
See example mission in directory: init.sqf

Examples:
[] call compilefinal preprocessFileLineNumbers "oo_pdw.sqf";
		sleep 2;

		 _pdw = ["new"] call OO_PDW;
		["saveUnit", [name player, player]] call _pdw;
		["saveInventory", [name player, player]] call _pdw;

		sleep 2;

		hint "Restore Unit";
		_object = ["loadUnit", name player] call _pdw;

		sleep 2;

		hint "Clear inventory";
		["clearInventory", _object] call _pdw;
		
		sleep 2 ;

		hint "Restore Inventory";
		["loadInventory", [name player, _object]] call _pdw;
		
		sleep 2;

		hint "Save all objects";
		"saveObjects" call _pdw;

		sleep 2;
		hint "Delete all objects";
		{deletevehicle _x;}foreach vehicles;

		sleep 2;
		
		_objects = "loadObjects" call _pdw;
		hint format ["Restore all objects %1", _objects];


Licence:
Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author


Changelog:
v0.91
fix including / excluding objects (duplicate objects)

v0.9 - update oop.h
- add setIncludingTypes method from contributor: [LTC] Vegas =21st=
- add debug entry points
v0.80
- fix private keywords
- fix array reference
- fix clearcargo
- add setSaveName method to use pdw with differents missions :)

v0.76
- 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

v0.74
- 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

v0.72
- fix return values of methods
- add savePlayers & loadPlayers methods
- add saveGroups & loadGroups methods
- fix initServer.sqf example for MP servers
- update documentation

v0.7
- Compatibilty with inidbi2 (inidbi1 is not anymore compatible)
- fix saveObjects method

0.4
- re factory saveUnit, loadUnit, saveObject, loadObject
- add saveObjects, loadObjects
- add saveInventory, loadInventory, clearInventory
- add more doc

v0.3
- fix reload
- fix function names
- fix example codes

v0.2
- fix typo error, fix adduniform

v0.1
- first release



- INIDBI2


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: No tags