Vanilla Database Calls vs Epoch

delpi

Well-Known Member
To save a vehicle to the database from script is easy, but what I'm having trouble with is the objectID. In epoch I could get it with "CHILD:388". That doesn't seem to exist in vanilla.

Anyone know a way to do this?
 
Not looking for ObjectUID, I'm looking for ObjectID. Its the only way that the system seems to save a vehicle location after publish.

I can't find a single call to the database to retrieve the ObjectID. To get around this for vehicles I spawn in and make 'real', i have to replace its save posititon to dabase with a delete and republish until the server reboots and you get ObjectID on the stream.


Specifically this portion is the problem. I can find no place that the database will communication the ObjectID other than the original stream.
Code:
    _object_position = {
        private["_position","_worldspace","_fuel","_key"];
        _position = getPosATL _object;
        _worldspace = [
            round(direction _object),
            _position
        ];
        _fuel = 0;
        if (_object isKindOf "AllVehicles") then {
            _fuel = fuel _object;
        };
       
        _key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
        _key call server_hiveWrite;   

        #ifdef OBJECT_DEBUG
        diag_log ("HIVE: WRITE: "+ str(_key));
        #endif
    };
 
Last edited:
okay, It was wrong of me to just spout off crap I seemed to remember from 2 years ago. I have forgotten most of what little I knew and the rest has been changed by the dayz devs.

I poked around and see what you mean. The objectID is assigned to each object in dayz_servermonitor
_object setVariable ["ObjectID", _idKey, true];
and the _idKey is retrieved from the database for each object. But nowhere in the code is there a method to actually create and write the _idkey into the database (or simply assign setvariable objectID to a NEW object). This looks like some anti-hack scheme to prevent players from putting objects into the database.
Here is the code (I think) that puts the vehicles into the database if they are missing (not familiar with dynamic vehicles in dayz).. It looks like the _idKey is just a random number. I didnt see the associated hivewrite that works with this _myarray data and I am a bit confused at the moment because I dont see where the _myarray is returned to any calling function.
dayz_server\compile\fa_hivemaintence.sqf
Code:
#ifdef VEH_MAINTENANCE_ADD_MISSING   
    // create missing vehicles of each kind.
    {
        for "_y" from 1 to (_x select 1) do {
            // create a new one at the end of _myArray list
            _type = (_x select 0);
            _idKey = format["%1%2",48,60000+floor(random 10000)];
            // "1" as Character ID since if I put "0" the vehicle is not stored in hive (since january 2013)
            _myArray set [count _myArray, ["CREATED",_idKey,_type,"1",[0,[0,0,0]],[[[],[]],[[],[]],[[],[]]],[],0,0.9]];
            diag_log (format["fa_checkVehicles: inserting in HIVE: vehicle class=%1, chosen oid=%2", _type, _idKey]);
        };
    } foreach _vehcat;
#endif
};
 
I don't think there is a way to do it cleanly, they just don't have the call.

It looks like i'll have to stick with my jacked up method of deleting and reading it for locations saves until the next reboot.


Thanks for looking.
 
this is part of the reason I abandoned standard Dayz, every update made it more difficult to do anything unique. At one point, I had used an older version of the hiveext.dll which retained the child 999 calls once they had been removed by the Devs ... thats an option.
 
Back
Top