Timmy_kirton
Well-Known Member
Yea in my last post in playersyc and update object need to add _EP1 to it.
And add them in deployable and spawn them that way.
And add them in deployable and spawn them that way.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yea in my last post in playersyc and update object need to add _EP1 to it.
And add them in deployable and spawn them that way.
Just spawn USBasicAmmunitionBox_EP1 same way as vehicles, that worked for me.
I thought I had it, but then I missed adding the classnames into the safeObjects, triple checked, ready to upload, but now server is filling up... will have to get back with results later. It certainly looks like it has potential!
"/*" \n
"//Check for Ammobox" \n
" {" \n
" if(!(_x isKindOf ""WeaponHolder"")) then {" \n
" diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
" deleteVehicle _x;" \n
" };" \n
" } forEach allMissionObjects ""ReammoBox"";" \n
"*/" \n
"" \n
Okay I'll throw this out there without any extra stuff we have been working on. Here is the basics of spawning in a ammo box that updates to the database. If you put more than 80-90 different items in it will error out and not spawn. eg. 100 m4a1 and 100 stanag mags would only count as 2 items. All of this is done in the dayz_server.pbo.
Go to your compile folder and in the script server_playerSync and server_updateNearbyObjects add the classname of the object that you want to update after tentstorage.
Eg for classname "USBasicAmmunitionBox"
} forEach nearestObjects [_pos, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage","USBasicAmmunitionBox"], 10];
Add the classname to the table "deployable" and note the id number
So you do not delete the box with cleanup script. Make a new Survivor in the survivor table with a randon ass UID and set isdead to 0. (this will make it so if it is not used within X days it won't be cleaned up) This will vary server to server.
Note the ID of the survivor you created.
Now go to your instance_deployable table and insert a new entry. Leave id blank and make up some crazy UID for the UID field. Under owner ID put the ID (Not UID) of your created survivor. Worldspace explanatory. You can create an inventory or leave it blank. All other values are not needed. Create the entry.
Restart your server and it should spawn in like anything else.
I am not responsible for your crap not working or breaking your database. I have only tested this for a day on my server.
AGAIN BE CAREFUL WITH HOW MANY DIFFERENT ITEMS YOU PUT IN IT!!!!!
It will save to the db fine but when you restart the server it will error out on the overfilled box.
server_cleanup.fsm
"Check for Ammobox" \n
" {" \n
"if(!(_x isKindOf ""WeaponHolder"")) then {" \n
"diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
"deleteVehicle _x;" \n
"};" \n
"} forEach allMissionObjects ""ReammoBox"";" \n
"*/" \n
"" \n
server_cleanup.fsm
"//Check for Ammobox" \n
"// {" \n
"//if(!(_x isKindOf ""WeaponHolder"")) then {" \n
"//diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
"//deleteVehicle _x;" \n
"//};" \n
"//} forEach allMissionObjects ""ReammoBox"";" \n
"//*/" \n
""// \n
I found in variables.sqf you can edit this line to include any ammo crates you want to add as safe objects:
Code:
SafeObjects = ["Land_Fire_DZ", "TentStorage", "Wire_cat1", "Sandbag1_DZ", "Hedgehog_DZ", "StashSmall", "StashMedium"];
If you add them to that list it will prevent the server_monitor.sqf from deleting them here:
Code:
else { // else for object or non legit vehicle
if (!(_class in SafeObjects )) then {
_damage = 1;
};
This requires a custom variables.sqf. If you don't already have one you can add it to your mission by editing your init.sqf like this:
Code:
call compile preprocessFileLineNumbers "variables.sqf";
Copy variables.sqf from ArmA 2\@Dayz\Addons\dayz_code\init to the root of your mission pbo then make your changes.
Using crates with 1.7.7.1
Alright, working crates that respawn on reboots, and that allow you to save content, regardless of reboots. This is a copy/paste job of tid bits of work done by people in this forum, and on other forums. I personally made no code changes, I am just a noob, but I have compiled it all here for you other noobs like me to follow, and I thank everyone for their help!!!!
Now that you have that part done, here is part II for the 1.7.7.1 patch, credit goes to those in this forum that made the actual adjustments:
In your dayz_server.pbo go to the system folder and edit server_cleanup.fsm, find this code
Code:server_cleanup.fsm "Check for Ammobox" \n " {" \n "if(!(_x isKindOf ""WeaponHolder"")) then {" \n "diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n "deleteVehicle _x;" \n "};" \n "} forEach allMissionObjects ""ReammoBox"";" \n "*/" \n "" \n
and uncomment like so:
Code:server_cleanup.fsm "//Check for Ammobox" \n "// {" \n "//if(!(_x isKindOf ""WeaponHolder"")) then {" \n "//diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n "//deleteVehicle _x;" \n "//};" \n "//} forEach allMissionObjects ""ReammoBox"";" \n "//*/" \n ""// \n
Then do as ebay says above my post:
I did all the above, and it works like a charm! Thanks to you all!
You have to add them to the deployable anyway. Since the update, it appears that the crates get removed in two ways:
First they are not in the safeObjects
Secondly the cleanup fsm file removes them
You will need to add to safeObjects, and stop the cleanup from cleaning them up. The rest remains the same as in version 1761.
The only issue I am having now, is they don't always spawn, sometimes they do, sometimes they don't. Content and location remain the same, not sure why they don't always spawn.
Hey guys, after doing all of the above my crates were still getting deleted and some weren't spawning at all.
So I looked back in server_cleanup.fsm and sure enough there is another routine that is deleting them. I am not sure what other effects commenting this out will have on your server so use at your own risk:
This needs to be commented out too like so:
Code:name = "cleanup_objects"; init = /*%FSM<STATEINIT""">*/"//_missionObjs = allMissionObjects ""WeaponHolder"" + allMissionObjects ""WeaponHolderBase"" ;" \n "//_missionObjs = allMissionObjects ""ReammoBox"";" \n "//_qty = count _missionObjs;" \n "//" \n "//diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n "//" \n "//_delQty = 0;" \n "//{" \n " //_keep = _x getVariable [""permaLoot"",false];" \n " //_nearby = {isPlayer _x} count (_x nearEntities [[""CAManBase""], 250]);" \n "//" \n " //_created = (_x getVariable [""created"",-0.1]);" \n "//" \n " //if (_created == -0.1) then {" \n " //_x setVariable [""created"",(DateToNumber date)];" \n " //};" \n "" //\n " //_age = ((DateToNumber date) - _created) * 525948;" \n "//" \n "//diag_log format [""Pile : %1, Created: %2, Age: %3"", _x, _created, _age];" \n "//" \n " //if ( (!_keep) && (_nearby==0) && (_age > 60) ) then {" \n " //deleteVehicle _x;" \n " //_delQty = _delQty + 1;" \n " //};" \n "//" \n "//} forEach _missionObjs;" \n "//" \n "//if (_delQty > 0) then {" \n " //diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n "//};" \n