DayZ 1.8 deployable items not saving & TrapTripwireGrenade not crafting

You're very probably running into the problem with Reality DB not being able to remove deployables or update their state after a server restart. I made a fix for this for use with 1.8 located here. I made it because I noticed tents weren't updating their inventories or being removed from the server if the server had restarted since they were placed. Though it's possible the same is true for traps since they are classed as deployables.

If that fix doesn't work, let me know and I'll try having a look at the coding in the file specific to traps and see if they also need a similar fix.
 
This works great. However I'm having an issue where if I take items from the tent, the items come back after restart. But if I destroy or remove tents they dont dupe anymore, so that's fixed, but items coming back in a tent is still a BIG problem.
 
This works great. However I'm having an issue where if I take items from the tent, the items come back after restart. But if I destroy or remove tents they dont dupe anymore, so that's fixed, but items coming back in a tent is still a BIG problem.

Sorry, I'm confused. Did you apply my tent fix, and then it's still not updating to the DB?
 
Sorry, I'm confused. Did you apply my tent fix, and then it's still not updating to the DB?

Yes I am using it. If I place a tent and pick it back up it will not dupe it back to that 1st placed location. If I place a tent and then destroy it, it wont come back. As it should.

But the current problem is when I place a tent, drop a few items inside, server restarts items are still there (good), I take items away from inside, server restarts, items are back in the tent. Basically items dupe inside tents.

Was doing this before your script too so it's not your script fix problem...
 
Yes I am using it. If I place a tent and pick it back up it will not dupe it back to that 1st placed location. If I place a tent and then destroy it, it wont come back. As it should.

But the current problem is when I place a tent, drop a few items inside, server restarts items are still there (good), I take items away from inside, server restarts, items are back in the tent. Basically items dupe inside tents.

Was doing this before your script too so it's not your script fix problem...

My fix should stop that from happening though. That's how I noticed the problem on my own server and this fix stops it. Are you using Reality yeah?

Have you checked your DB when removing items from tents after a restart to see if the DB is updating? Have you checked your RPT log to see if when you take items out it's sending the information to the DB with the correct UID for that tent?
 
My fix should stop that from happening though. That's how I noticed the problem on my own server and this fix stops it. Are you using Reality yeah?

Have you checked your DB when removing items from tents after a restart to see if the DB is updating? Have you checked your RPT log to see if when you take items out it's sending the information to the DB with the correct UID for that tent?


Yeah when I take an item away it does not update to database it seems :( as for RPT not sure what to look for here, but if DB is not updating I imagine something is not sending... i'll try to check and thanks for the help btw :)
 
In the RPT there should be an entry something like
Code:
"HIVE: WRITE: "CHILD:309:139380291470267:[[[],[]],[["SmokeShellRed"],[1]],[[],[]]]:""
When it updates a tent. That long code starting 13938 is the UID for the tent I was adding an item to.

With my changes in place, your RPT should show this
Code:
"Spawned: "139380291470267" TentStorage"
for every tent it spawns on server start up.

The code for the tent you're editing, should match one of the codes listed as spawned. If it doesn't match any of them, then for some reason my fix isn't applying properly and it's not getting the right codes when trying to update.

You said you can pack a tent up after a server restart and it doesn't come back though didn't you?
 
You said you can pack a tent up after a server restart and it doesn't come back though didn't you?

Yes that works fine ;)


Here is what I see in my RPT
Code:
 5:48:54 "Spawned: "905321443860285" TentStorage"
 5:48:54 "Spawned: "905091442760309" TentStorage"
 5:48:54 "Spawned: "8721394980318" TentStorage"
 5:48:54 "Spawned: "194741338490360" TentStorage"
 5:48:54 "Spawned: "15038391900261" TentStorage"
 5:48:54 "Spawned: "37310592340321" TentStorage"
 5:48:54 "Won't spawn object #42217729130360(DomeTentStorage) in/close to a building, _point:[4221.7,7291.32,0], inventory: [] booleans:[false,false,false,true,false,false]"
 5:48:54 "IGNORED DomeTentStorage oid#42217729130360 cid:125 "
 5:48:54 "Spawned: "37934681750336" Trap_Cans"
 5:48:54 "HIVE: WRITE: "CHILD:309:37934681750336:[false]:""
 5:48:54 "Spawned: "2564794149051" Trap_Cans"
 5:48:54 "HIVE: WRITE: "CHILD:309:2564794149051:[true]:""
 5:48:54 "Spawned: "25788940380315" TrapTripwireFlare"
 5:48:55 "HIVE: WRITE: "CHILD:309:25788940380315:[false]:""
 5:48:55 "Spawned: "2711594859039" Trap_Cans"
 5:48:55 "HIVE: WRITE: "CHILD:309:2711594859039:[false]:""
 5:48:55 "Spawned: "2611494276039" TentStorage"
 5:48:55 "Spawned: "26359945280312" TentStorage"
 5:48:55 "Won't spawn object #25723938420312(TentStorage) in/close to a building, _point:[2572.35,9384.17,0], inventory: [] booleans:[false,false,false,true,false,false]"
 5:48:55 "IGNORED TentStorage oid#25723938420312 cid:138 "
 5:48:55 "Spawned: "26335937800132" TentStorage"
 5:48:55 "Won't spawn object #26897950400315(TentStorage) in/close to a building, _point:[2689.65,9503.96,0], inventory: [] booleans:[false,false,false,true,false,false]"
 5:48:55 "IGNORED TentStorage oid#26897950400315 cid:138 "
 5:48:55 "Spawned: "195481338450360" TentStorage"
 5:48:55 "Spawned: "19507133797172" StashMedium"
 5:48:55 "Spawned: "195771338540360" TentStorage"
 5:48:55 "Spawned: "72575301030243" Sandbag1_DZ"
 5:48:55 "Spawned: "911431465591246" StashMedium"
 5:48:55 "Spawned: "914681464202234" StashMedium"
 5:48:55 "Spawned: "55137236810360" DomeTentStorage"
 5:48:55 "Spawned: "5521523699087" CamoNet_DZ"
 5:48:56 "Spawned: "19478133796178" StashMedium"
 5:48:56 "Spawned: "9600142398075" DomeTentStorage"
 5:48:56 "Spawned: "95651421630341" StashSmall"
 5:48:56 "Spawned: "87731420430225" CamoNet_DZ"
 5:48:56 "Spawned: "9587142164012" StashSmall"
 5:48:56 "Spawned: "55150236500147" DomeTentStorage"
 5:48:56 "Spawned: "1159311100440252" TentStorage"
 5:48:56 "Spawned: "1168611094590360" CamoNet_DZ"
 5:48:56 "CLEANUP: INITIALIZING CLEANUP SCRIPT"
 
The fact you can remove them after a restart implies my code is working, because it needs the correct UID to remove it from the DB. :S

That list is showing them spawning, what you need to do now is try adding/removing items from a tent and checking to see if the UID in the HIVE WRITE matches one of those.

Random question, since I see you have some. How did you build Dome Tents? Do they have their own tent item to find lying around or did you have to do something special?
 
How did you build Dome Tents? Do they have their own tent item to find lying around or did you have to do something special?


You can find them ever since the latest 1.8 patch ;) or give it to yourself with this class ID

Code:
ItemDomeTent
 
Are you running a reality hive? I'm currently running this fix on two servers without any issues of connecting.
If you're running reality then can you upload your mission.pbo and server.pbo so I can take a look at them please.
 
Are you running a reality hive? I'm currently running this fix on two servers without any issues of connecting.
If you're running reality then can you upload your mission.pbo and server.pbo so I can take a look at them please.


Yes I am using a reality server I am on dayz.st, let me look over my code for a bit and see if I did something else retarded :D Ill get back to you in like 20 mins.
 
Are you running a reality hive? I'm currently running this fix on two servers without any issues of connecting.
If you're running reality then can you upload your mission.pbo and server.pbo so I can take a look at them please.

Apologies not sure what I did wrong but I went back to an older save and now it is working just fine. I am going to wait a few days then make a tutorial for this so its all condensed for the modding community :D
 
I tried this:
1.) Follow this tutorial [Tutorial] Custom Loot Tables and Adjusting Spawn Rates (this dose work on 1.8)
1.) Move the "dayz_code/traps" folder to "dayz_mission\Fixes\traps"
2.) Changed This in the "compiles.sqf" :
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\traps\init.sqf";
to this:
Code:
call compile preprocessFileLineNumbers "Fixes\traps\init.sqf";
then I changed the "Fixes/traps/init.sqf" to this:
Code:
// functions
setup_trap = compile preprocessFileLineNumbers "Fixes\traps\functions\setup.sqf";
arm_trap = compile preprocessFileLineNumbers "Fixes\traps\functions\arm.sqf";
disarm_trap = compile preprocessFileLineNumbers "Fixes\traps\functions\disarm.sqf";
remove_trap = compile preprocessFileLineNumbers "Fixes\traps\functions\remove.sqf";
trigger_trap = compile preprocessFileLineNumbers "Fixes\traps\functions\trigger.sqf";
 
// traps
beartrap = compile preprocessFileLineNumbers "Fixes\traps\beartrap.sqf";
beartrapflare = compile preprocessFileLineNumbers "Fixes\traps\beartrapflare.sqf";
beartrapsmoke = compile preprocessFileLineNumbers "Fixes\traps\beartrapsmoke.sqf";
tripcans = compile preprocessFileLineNumbers "Fixes\traps\tripcans.sqf";
tripflare = compile preprocessFileLineNumbers "Fixes\traps\tripflare.sqf";
tripgrenade = compile preprocessFileLineNumbers "Fixes\traps\tripgrenade.sqf";
tripsmoke = compile preprocessFileLineNumbers "Fixes\traps\tripsmoke.sqf";
then I changed the "Fixes/traps/functions/trigger.sqf" to this:
I think this also need a database call to remove the item there! Other wise it will redeploy upon a server restart! (this would have to be in the "remove.sqf")
Code:
_trap = _this select 0;[/S]
 
[S]if (getNumber (configFile >> "CfgVehicles" >> typeOf _trap >> "singleUse") > 0) then {[/S]
[S]    [_trap] call remove_trap;[/S]
[S]} else {[/S]
[S]    //[_trap] call disarm_trap;[/S]
[S]    [_trap] call remove_trap;[/S]
[S]};[/S]
[S]

Should this not remove the object no matter how it was triggered? Any help will be welcome!




All I am trying to achieve is when a trap is triggered and explodes it needs to be remove from the game. (I believe they should be 1 time use!)
OMG this dose work...

replace remove.sqf with:
Code:
private ["_id", "_uid"];
_trap = _this select 0;
 
_id = _trap getVariable ["ObjectID", "0"];
_uid = _trap getVariable ["ObjectUID", "0"];
 
PVDZ_obj_Delete = [_id,_uid];
publicVariableServer "PVDZ_obj_Delete";
 
sleep 120;
 
deleteVehicle _trap;
replace trigger.sqf with:
Code:
_trap = _this select 0;
 
[_trap] call remove_trap;


To top it off it deletes form the database and you can't pick it up after its exploded! These are the only changes you need to make!
Then follow this fix for the tents!
You're very probably running into the problem with Reality DB not being able to remove deployables or update their state after a server restart. I made a fix for this for use with 1.8 located here. I made it because I noticed tents weren't updating their inventories or being removed from the server if the server had restarted since they were placed. Though it's possible the same is true for traps since they are classed as deployables.

If that fix doesn't work, let me know and I'll try having a look at the coding in the file specific to traps and see if they also need a similar fix.
 
Apologies not sure what I did wrong but I went back to an older save and now it is working just fine. I am going to wait a few days then make a tutorial for this so its all condensed for the modding community :D

Hahaha, so the tent fix did work for you then? I started panicking there going over my code to make sure I hadn't posted the wrong stuff. :D
 
Back
Top