Jump to content

code34

Member
  • Content Count

    1416
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by code34


  1. the way it s working is simplier than that

     

    	call compile preprocessFileLineNumbers "oo_pdw.sqf";
    
    	private _pdw = ["new", "inidbi"] call OO_PDW;
    
    	["setSaveName", "thevigil7"] call _pdw;
    	["setDbName", "thevigil7"] call _pdw;
    
    	["setIncludingMarkers", ["owb_base","test"]] call _pdw;
    	["setExcludingTypes",  ["Land_HBarrierTower_F","Land_Campfire_F","Weapon_srifle_LRR_F","Vysilacka","Land_Laptop_device_F","Land_Laptop_02_unfolded_F","Laptop_EP1","Land_HBarrierWall4_F","Land_HBarrierWall6_F","Land_HBarrier_1_F","MetalBarrel_burning_F","Land_WoodenTable_large_F","Land_Razorwire_F"]] call _pdw;
    
    	_objects = "loadObjects" call _pdw;
    
    	while {true} do {
    		sleep 15;
    		"saveObjects" call _pdw;
    	};

     

    • Like 1

  2. On 11/09/2018 at 8:26 PM, TheVigil7 said:

    hi Code34,

     

    Thanks for the reply. I added the counter because I am re-running the save command repeatedly, and was hoping by adding a counter I could pick an autosave out of the entire log. it was just an attempt to try and make this useful. However, even with the counter it is duping the same object over and over again. for troubleshooting my issue, ignore the counter its not important.

     

    To reproduce this is simple. Just set up a zone on a map that you want to save the objects in it. place a single object, like a truck. Then just have a loop run the save command every few seconds. The first time it runs, it will create an entry for the truck. The second time, it will create two entries for the truck, third time it makes 3... etc. If you attempt to order it to load the objects saved to the log this way, it spawns the same truck, in the same location, X many times based on how many copies were saved in the database, resulting in some truly spectacular physics glitches. I just cannot understand why it always creates a copy of the object unless inidbi itself is holding onto this variable somewhere. I cannot get it to clear all data its holding before writing new entries back.

     

    oo_pdw saves the item in one place unless you ask him to do something else.

     

    You should share your code for this simple test :)

    • Like 1

  3. Hi all

     

    I just release the new version of oo_vitems 0.3

     

    Release informations:

    - add multiplayer first implementation

    - add a first implementation of button to use object

    - simplification of objects declaration with array :)

     

    Example with new object prototype

    _inventory = ["new", box] call OO_CONTAINER;
    ["setProperties", ["Box",100,100]] call _inventory;
    _potatoe = ["Potatoe","A vulgar potato damaged","food",2,0.5,"Captain_A",10, {}];
    ["addItem", _potatoe] call _inventory;

     

    • Like 2

  4. Good idea :)

     

    Currently, I have not looked at this use case yet. In fact, I've planned this system for vanilla play and all non-modeled objects that can not be used by conventional inventory. Maybe in the end there will be a mix with real 3d object, but I'm not there yet :)

    For the idea of the "groundWeaponholder", it will anyway be necessary to use a 3d object in which placed the virtual objects on the ground to avoid that the virtual objects are lost when they are dropped. I will look in the list of 3d objects (all ideas are welcome :) ).


  5. Hi all :)

     

    Just release a new alpha 0.2 version with some cool features. You normaly can begin to have a nice sharing objects experience !

     

    Release informations:

    • add containers capacities /weight informations
    • add player inventory
    • add drop / take actions and switch beetween inventory. You can now take an object in a container and put it in another one :)

     

    screenshot1:

    https://www.dropbox.com/s/4oa3tvfpwm4vp9s/demoscreen_vitems.png?dl=0

    • Like 2

  6. OO VITEMS
    Lastest version: 0.4 by Code34

     

    Hi,

    I propose a first alpha version of this system, which I will improve if you are interested. This version does not show all the features already present in the library .Virtual Items is an OOP Class which allows to manage virtual inventories in ARMA. This system makes it possible to store virtual objects in any of the 3D objects of the game. In this first demonstration, you will be able to see the contents of 4 x 3D objects deposited in the editor. These virtual objects were created directly via script in the initserver.sqf

     

    More informations:

    This class creates containers with properties that will contain virtual objects with properties. The containers are attached to the 3D objects of the game. You can easily add many objects that do not require 3D modeling, and all without using mods: keys, cans, screwdrivers etc.

     

    Properties for the containers are:
    - size
    - the weight

     

    Properties for objects are:
    - the price
    - size
    - the weight
    - the owner
    - the description
    - durability

     

    These properties may evolve which allows to add very elaborate features to the games. Any feedbacks are welcome ! :drinking2:

     

    Github: https://github.com/code34/oo_vitems.vr

    Download: https://github.com/code34/oo_vitems.vr/releases

    Reference: http://forums.bistudio.com/showthread.php?167980-Object-Oriented-SQF-Scripting-and-Compiling

     

    Features:

    - Simple demo version

     

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

    • Like 5
    • Thanks 2

  7. In fact OO_pathfinding uses a custom weight function as input parameter to work cause the application field is larger than gps.

     

    It can be a function relative to road, or anything you want (like tree, house, number of peoples, etc.)

     

    in the default exemple, the weight function is relative to road segment size (for a gps like exemple)

    private _weightfunction = {
    			private ["_position", "_size", "_average", "_cost"];
    			
    			_position = _this select 0;
    			_size = _this select 1;
    			_average = 0;
    			_cost = 0;
    
    			_list = _position nearRoads _size;
    			if(count _list > 0) then {
    				_bbr = boundingBoxReal (_list select 0);
    				_br0 = _bbr select 0;
    				_br1 = _bbr select 1;
    				_maxwidth = abs ((_br1 select 0) - (_br0 select 0));
    				_maxlength = abs ((_br1 select 1) - (_br0 select 1));
    				_average = floor (_maxwidth * _maxlength);
    				if(_average > 200) then {
    					_cost = 1;
    				} else {
    					_cost = 2;
    				};
    			};
    			_cost;
    		};

     

    So it wasn't really affect by this problem. I encountered this kind of problem with segment in other cases. I used the same kind of tricks with the same commands that gc8 used :)

     

    if needed, @AmauryD can perhaps help you cause he worked more specifically on gps application.

    • Like 2
    • Thanks 1

  8. In summary, you have to follow thoses steps :

     

    if you know SQL and want to use extdb3

    1. install your mysql database, create your database + tables
    2. install extdb3
    3. use oo_extdb3 and check if you access to db server, database and table
    4. build your code to insert/update/delete the score (with the locality mindset)

     

    if you don't know SQL langage, there are alternative methods like profilenamespace, or inidbi2

     

    it is not recommended to use compiled dlls whose code is not officialy published, and the license is not known. There is no guarantee on this.

    • Like 2
×