Ammo Crates Fix

Discussion in 'DayZ Mod' started by BoNeHeD, Jun 19, 2013.

  1. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    Those are both turned off.
     
  2. barry egginton

    barry egginton Member

    Joined:
    Jan 30, 2013
    Messages:
    90
    Likes Received:
    1
    runing your own server?
     
  3. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,421
    Likes Received:
    336
    i dont think the 1.8.5 resec or antihack would affect the crates although they should be disabled anyways. the code looks to deal only with plants and points of interest.

    check your work and make sure you repacked your dayz_server.pbo so changes are active.

    i had thought before that it might be something else if it actually does take 30+ minutes for them to be deleted. infistar is usually instantaneous and the cleanup scripts run every 5 minutes or so.

    why dont you post an rpt log?
     
  4. barry egginton

    barry egginton Member

    Joined:
    Jan 30, 2013
    Messages:
    90
    Likes Received:
    1
    what happens is the ammo boxes come in then delete quickly is this the case??????
     
  5. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    It seems to take them like 20-30 minutes for them to get removed. Any ideas?
     
  6. barry egginton

    barry egginton Member

    Joined:
    Jan 30, 2013
    Messages:
    90
    Likes Received:
    1
    last chance I could help mate
     
  7. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    I added you to skype but no friends request was accepted. I am still having this issue.. Add me on skype cikez0781. Thanks.
     
  8. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    I am still having this issue with 1.8.6.1. It worked just fine with prior versions. The issue is I cannot find the code that is making them disappear. It seemed like in earlier version the code was in server_monitor or server_cleanup. With the way they have changed and added the new sched_* files I figured it would be in there somewhere. Any help would be much appreciated!

    Any
     
  9. delpi

    delpi Well-Known Member

    Joined:
    Feb 4, 2014
    Messages:
    336
    Likes Received:
    15
    There is a variable you need to add. its something like 'permanent' true. Search around for it.
     
  10. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    I do not think that will work. I am using database spawned crates, not SQF spawned crates.
     
  11. delpi

    delpi Well-Known Member

    Joined:
    Feb 4, 2014
    Messages:
    336
    Likes Received:
    15
    yes it will, you just don't understand how to do it.


    Watch in server-monitor for your item to come across, make sure it allows it to be spawned, and then set the variable from there.
     
  12. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    What do you mean by look in server-monitor for it to come across? So I guess I didnt know this but you are saying that you can set a "permaloot" variable to an item that is in the database and not spawned via SQF?
     
  13. delpi

    delpi Well-Known Member

    Joined:
    Feb 4, 2014
    Messages:
    336
    Likes Received:
    15
    You haven't taken the time to search for that variable. When you search the dayz pbo's for it and still don't understand, then i'll be happy to help you.
     
  14. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    I have taken the time to search for it but I thought that variable could only be set on items that are spawned with SQF and NOT through object_data in SQL.

    I see this in spawncarepackages file: _lootVeh setVariable ["permaLoot", true];

    But like I said above.. How do you set a variable to an item that is not being spawned via SQF?
     
  15. delpi

    delpi Well-Known Member

    Joined:
    Feb 4, 2014
    Messages:
    336
    Likes Received:
    15
    You don't the way you are asking.

    You could go into the server_monitor and check to see if the item being spawned in is the type of item you are looking for and add the variable. You have to mess with the server_monitor in most cases to get it to load a custom object anyhow.
     
  16. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,421
    Likes Received:
    336
    in your server file that streams in all the database objects the classname is passed to the code. Compare the streamed classname with your classname and if true, set the variable.

    Here is the Dayz server monitor. Look at line 154, it has created the streamed item and now it checks for if its a trap item and does specific code. https://github.com/DayZMod/DayZ/blo...491/SQF/dayz_server/system/server_monitor.sqf
    Do something with your crate like that.
    Code:
    //Create it
    _object = createVehicle [_type, _pos, [], 0, if (_type in DayZ_nonCollide) then {"NONE"} else {"CAN_COLLIDE"}];
    // prevent immediate hive write when vehicle parts are set up
    _object setVariable ["lastUpdate",diag_ticktime];
    _object setVariable ["ObjectID", _idKey, true];
    dayz_serverIDMonitor set [count dayz_serverIDMonitor,_idKey];
    _object setVariable ["CharacterID", _ownerID, true];
    _object setdir _dir;
    _object setDamage _damage;
    if (!_wsDone) then {
    [_object,"position",true] call server_updateObject;
    };
    if (_type == "Base_Fire_DZ") then { _object spawn base_fireMonitor; };
    //Dont add inventory for traps.
    if (!(_object isKindOf "TrapItems") And !(_object iskindof "DZ_buildables")) then {
    _cargo = _inventory;
    clearWeaponCargoGlobal _object;
    clearMagazineCargoGlobal _object;
    clearBackpackCargoGlobal _object;
    _config = ["CfgWeapons", "CfgMagazines",
    
    
     
  17. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    Ahhh, makes sense now.. So something like this should work in server_monitor.sqf:

    Code:
            //If class is AmmoBoxBig set permaloot to true
            if (_type == "AmmoBoxBig") then { _object setVariable ["permaLoot", true]; };
     
  18. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,421
    Likes Received:
    336
    .... EDIT ... OKAY. i see the code has _type already defined as the classname so your code is correct. I had made a post using "typeof _object " logic but thats not needed. again,
     
  19. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    OK no problem. Thanks a lot for your help. I have applied this code to my server... We will see if everything goes as planned. Thanks again man!
     
  20. Cikez

    Cikez Well-Known Member

    Joined:
    Feb 3, 2014
    Messages:
    116
    Likes Received:
    3
    It seems to be helping a lot but some of the crates still are disappearing.. Would having a "banned" or "invalid" weapon in the crate cause it to disappear? I noticed that a few of them had a KSVK and AS50 in them which is now banned in Vanilla. This could be what is causing the others to disappear.

    Thanks again for your help. Much appreciated.
     

Share This Page