[FIX] Tent Saving Issues for 1.8 - Problem

Discussion in 'Script/Addon help' started by willidshome, Sep 26, 2013.

  1. willidshome

    willidshome Well-Known Member

  2. rosska85

    rosska85 Valued Member!

    What map are you running because that doesn't look like the 1.8 code.

    Without knowing the map, I can't test this so if you use it, make a backup first to be safe.

    Try this, find
    Code (Text):
            if (_damage < 1) then {
                //diag_log format["OBJ: %1 - %2", _idKey,_type];
             
                //Create it
                _object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
                _object setVariable ["lastUpdate",time];
                _object setVariable ["ObjectID", _idKey, true];
    And replace it with
    Code (Text):
    if (_damage < 1) then {
            diag_log("Spawned: " + str(_idKey) + " " + _type);
       
            _object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
            _object setVariable ["lastUpdate",time];
            // Don't set objects for deployables to ensure proper inventory updates
            if (_ownerID == "0") then {
                _object setVariable ["ObjectID", str(_idKey), true];
            } else {
                _object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
            };
    Let me know how you get on, but if it doesn't work you need to tell me what mod/map you're running.
  3. willidshome

    willidshome Well-Known Member

    firstly it would not work, so I asked for help then it start working before I do anything ?

    Sorry to have bothered you but thanks.
  4. rosska85

    rosska85 Valued Member!

    What map are you running? I'm curious because the variables I've used aren't defined in your file so they may set off RPT errors or cause problems for you if you're using it with the wrong files.
  5. willidshome

    willidshome Well-Known Member

    Running Epoch(cherno) 1.0.2.3
  6. rosska85

    rosska85 Valued Member!

    Ahh ok, yeah Epoch doesn't use 1.8 yet.
  7. Twamp

    Twamp Member

    I applied this to my server 2-3 days ago, tents are still not saving contents. I did however notice that it does not have anything to do with server restarts (as i thought prior). DayZ 1.8
  8. rosska85

    rosska85 Valued Member!

    Hmmm strange, if it's not to do with server restarts then it implies it's not issuing the correct publish command. If you send your mission and server pbos I will take a look at them when I get a chance.

    This fix is only for the problem with them after a restart since it alters how the game reads them from the DB on startup to stop it turning them into static entities that don't get updated.
    Twamp likes this.
  9. Twamp

    Twamp Member

    I sent you my PBOs earlier :) for help with loot tables. These issues are present with 0% customization on 1.8. Meaning that it is an issue with reality+dayzcode1.8.

    I was watching the instance_deployable table in my database, saw a new entry which was a tent with no inventory. I asked the owner if he recently placed a tent and if there was any gear in it, he said yes it was nearly full, he also said he saved it a couple times. The only reason people(including me) blame server restarts is because that is when the server is supposed to repopulate the tent with its contents, BUT there is no contents since nothing was actually ever saved to the database.

    Some of the tents in my database have inventories, so this does not seem to be all tents. Also the same thing goes for the vehicles not saving, or reverting back to their starting positions. Perhaps these two issues are the same/similar.
  10. willidshome

    willidshome Well-Known Member

    I found it to be something in the compile.sqf file, I have a seperate compile.sqf file for my stuff and it is working. Haven't got a clue what it does mind but it works

    Code (Text):

    progressLoadingScreen 0.4;
    call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                    //Compile regular functions
    progressLoadingScreen 0.5;
    call compile preprocessFileLineNumbers "server_traders.sqf";                                    //Compile trader configs
    call compile preprocessFileLineNumbers "dayz_code\compiles.sqf";                                 //Compile custom compiles
    progressLoadingScreen 1.0;
     
  11. rosska85

    rosska85 Valued Member!

    Ah right, I'll go hunting for that post then.
    Probably wont have time to look at it today though, will see how I am for time, got problems on my own server too haha.

    I use reality and with the base 1.8 files tents deployed and updated fine, until the restart, that's where the problem with reality lies. The fact that your issue is not that, means this is a different issue entirely, I'll have to do some digging.

    It's possible your DB is corrupted. Though I wouldn't do anything to it until I can confirm if it's working on my end. When you say some tents work, are they different types of tent at all? Like camping tent vs dome tent?
    Twamp likes this.
  12. Twamp

    Twamp Member

    I did not check to see if they are dome/old. I will do that now.

    When you said "...tents deployed and updated fine, until the restart, that's where...."
    Do you mean that once you place items in the tent, you can see them in the instance_deployable inventory ?
  13. rosska85

    rosska85 Valued Member!

    Yeah, when I place a tent it shows in instance_deployable (with empty inventory obviously), then I add an item and it updates in the DB. Then I restart server, check DB and it's still there. Then I take item out, and this time it doesn't remove the item from the DB.
    That's what this fix is for.

    What you're describing isn't quite the same. It sounds almost like it's publishing it to the DB wrong, but then if that were the case it would be all tents, not just some of them.
    Twamp likes this.
  14. Twamp

    Twamp Member

    Ahh shit, yea completely different issues, you are dealing with a duping issue, i'm just stealing people's shit.
  15. rosska85

    rosska85 Valued Member!

    Indeed. I'll still take a look at your files as soon as I can though and at the very least it will show whether or not it's caused by your database. If it works fine on my end then it's your DB, if it doesn't work on my end then it's code related.
    I'll let you know.
  16. Twamp

    Twamp Member

    Yea, unfortunately i cannot seem to reproduce this issue on my localhost test server. So I think it is something wrong with the database. It is nearly 4AM in Australia(my server is in AU) so i am just going to backup the DB and try a fresh roll-out. I will be only restoring the survivor/profile tables to prevent carrying this issue over to the new DB. If you try to reproduce my issues I am sure you will have as much luck as i have on my test server. I appreciate the help you have given me and the rest of the community.
    rosska85 likes this.
  17. rosska85

    rosska85 Valued Member!

    Let me know how you get on. I had to nip out for a bit so still haven't had a chance to check your files out.
  18. Twamp

    Twamp Member

    Well it seems to be fixed. This is what I did:

    When 1.8 was released i wiped my server migrated realitymain, then(like a dumbass) executed the SQL files released by dayzmod.com. This added some extra tables to the database(for official hive) even though these tables were not being used, i think some other aspects of the SQL files were impacting the database in a negative way. So what i did was backed up the Survivor/Profile tables, deleted the database, made a new database with the same name, restored the survivor/profile tables.

    Now, after doing this i placed a tent ingame and it would not publish the gear to the DB. So i reverted server/mission PBOs back to completely fresh. I added each script that my server runs one by one, testing the tent saving each time. I added each script back, and tents save. Comparing my old PBOs to my new PBOs, there is not one difference......

    Sooo... all i can think is that the database dickery that i did actually fixed the issue. I just do not understand what the issue could have been(other than DB).

    I am tired as hell, so i have not looked at this time.... But didn't 1.8 add dome tents? How does a player spawn a dome tent? When you "build tent" is there a chance its a dome tent? whats the deal? Reason i ask, is even after all this work, if I place a tent and put an item in it, it shows up in the database.... almost all the time...... Still after all this work, sometimes the tent will still not publish items. So i was thinking maybe there is some sort of random chance to spawn a dome tent, and maybe this feature is broken, and wrecking the inventory publishing.

    Let me know what you think...
    rosska85 likes this.
  19. rosska85

    rosska85 Valued Member!

    Definitely sounds like it was the DB then. I had a similar issue a little while back with Oring where it wasn't saving vehicle positions or inventory changes and wiping the DB was the only way I could get it working again. Though that was in my first few days of hosting so it was probably some dumb mistake I made haha.

    As for dome tents, I'm really not sure. One guy had said that they are a separate loot item you can find to place, but I can't see them in the loot tables anywhere so I really don't know.
  20. rosska85

    rosska85 Valued Member!

    Well I had a quick play with your files today and I couldn't replicate the problem on my end either, so sadly that's a sure fire sign that it was definitely your DB.

Share This Page