Project : More Tents

McKeighan

Well-Known Member
Ok - So here's the idea.

There's a tent that dayz uses called Land_A_Tent - which is the standard "Pup Tent" that we're all used to seeing.

There is also a tent called ACamp which some people have figured out how to deploy in game by simply referencing that instead of Land_A_Tent in the dayz_equip.pbo file (within the config.bin).
The ACamp tent is a larger, 6 to 8 man dome tent.

So... I'm the kind of person, like that wierd soda commercial, that always says "AND..." Or in this case, why not both??

The concept would be have both tents as potential loot. The puptent would spawn in all the same places, with a slightly higher rate (and added to) the hunting / guard towers. None of it's other characteristics would change.

The "NEW" tent would only spawn in Grocery Stores (and maybe churches), at a very low % chance on the drop, making them very rare. The reason for the rarity would they would be able to hold roughly 2.5 times the amount of gear then a standard tent.... Think non-mobile URAL.


------------------------------------

Here's what's already developed (and what I have working).
  • New tent is defined as "DomeTentStorage", and built in all the appropriate places (dayz_equip.pbo\config.bin & dayz_code.pbo\CfgMagazines.hpp) *** Now definied not as class ACamp, but as class Land_A_Tent, calling the model that is the ACamp model instead.
  • New SQF files in dayz_code\actions and \compile that mimic the tent_pack.sqf, tent_pitch.sqf , and player_packTent.sqf (called convienently DomeTent_Pack.sqf, DomeTent_Pitch.sqf, and player_packDomeTent.sqf).
  • Updated fn_selfActions.sqf to include activity pertaining to the new tent.
  • Updated dayz_code\init\compiles.sqf to contain all the additions mentioned above.
  • Added a handling variable to variables.sqf (s_player_packdometent = -1; )
  • Added "dometentstorage" to the player_monitor.fsm file within the class Load_In statement.
  • Added lines to dayz_server\compile\server_publishObject.sqf to include DomeTentStorage
  • Added line to dayz_server\compile\server_updateNearbyObjects.sqf to include DomeTentStorage
  • Added segment to dayz_server\system\server_monitor.sqf to include the "DomeTentStorage" item.
  • Added DomeTentStorage to allowed obejects query in dayz_server\init\server_functions.sqf
  • Added deployable object "DomeTentStorage" to the database table (Pwonzor's Database Version).

--------------

Here's where it's going wrong.

Item is lootable, clickable, deployable.... In game.

Once tent is deployed, it NEVER writes itself into the database. But it IS working correctly in the server_updateNearbyObjects.sqf... as the tent has a life span of maybe 15 seconds before it deletes (because it doesn't exhist in the database).
Not including the tent in the server_updateNearbyObjects.sqf will leave a semi-permanent version of the dome tent up... it accepts the entire loadout of gear, it works great (sleep function, pack tent, gear) all work. Problem is it doesn't exhist on the database, and on a server restart, the tent disappears, taking with it all the loot it had stored in it.

----------------------

I didn't want to just start dropping code into the thread.... just wanted to see if there's people out there willing to assist in figuring this puzzle out. I can provide a link to the pack'd code I have currently testing on our testserver - or I could upload the unpacked pbo's as well to a repository. Or... Could just start cut and pasting thousands of lines of code into here too ;)

- McKeighan
Dayz_Derp servers
www.thegiuidez.com
 

Kind-Sir

OpenDayZ Rockstar!
This would be neat!
Would it be at all possible to send over your edits?
I may have a solution with writing to the database.
 
I have no skills of my own, but a bunch of these changes are similar to how Daimyo's base building functions, perhaps he may be able to assist you with your quest to add more tent types. Personally I'm interested in that very little dark green tent that is dome-like. The current tent model isn't cutting it!
 

McKeighan

Well-Known Member
Yeah - I'll upload a zip when I get home with the entire project unpacked - and then give a table of contents as to where to look in each file at the changes. Would that be good, or just dump all the stuff up here?

There are other aspects of the mod i've been toying with that has nothing to do with this issue, but are cool none the less.

  • 1st person only when in a vehicle, 1st and 3rd person allowed outside of vehicles.
  • custom loot drops for everything.
  • new custom loot for air control towers, aircraft hangars, churches, and something else which is escaping me right now...
  • Zombie increase by 1 or 2 units for every building.
  • New Clothes ( Bandit1 thru 6, Camo1 thru 9, soldier1 thru 6, pilot1 thru 3, rocket and rocket2, guille1 thru 4).
  • Unlocked and edited vehicles. Various additions that have had there storage capacity modified, the ammo capacities and allowance modified, the removal of their radars, etc. These all work without the need of @rmod... and thanks to the @rmod people for the "how to do this" knowledge applied.
  • Various descriptions altered in all of the stringtable.xml files.

I'm sure i'm forgetting stuff too....
 
The FP lock in helis exists for Celle already

Code:
//1st person lock in Air Vehicles
if (!isDedicated) then
{
    0 spawn
    {
        while {true} do
        {
            if((cameraView == "EXTERNAL" || cameraView == "GROUP") && (vehicle player isKindOf "Air")) then
            {
                vehicle player switchCamera "INTERNAL"; titleText["This type of vehicle is 1st Person only!!", "PLAIN DOWN", 5]
            };
        sleep 0.1;
        };
    };
};
There's a thread for changing the whole loot table as well.
 

McKeighan

Well-Known Member
Yep - the Celle add was done after the fact (the 1st person camera code I use is what was added to Celle).

All the bulleted items I listed are ALREADY live and in my code. They all currently work correctly. It's just the tent thing that is causing grey hair + shedding.
 
Definitely support this, i would like to have that tent as a additional rare, tent.

Just wondering, does the new tent, on the ground (like as a weaponholder) have the same picture as the normal tent?

What i mean is, would you be able to tell the difference on the ground at a lootspawn?

Would be cool if you could, even if it was as simple as changing the color of it, etc.
 
Yep - the Celle add was done after the fact (the 1st person camera code I use is what was added to Celle).

All the bulleted items I listed are ALREADY live and in my code. They all currently work correctly. It's just the tent thing that is causing grey hair + shedding.
Oh. Now I get it.. lol.

I badly want to edit my Celle loot table but I have a feeling its going to be a painfully slow process
 

McKeighan

Well-Known Member
Manatee - It gets faster with practice on editing the loot tables.

unkinhead - Right. Currently, it's using the same bag for the weaponholder. I've been looking around for different options, but nothing stands out. Maybe I could clone the model, and then alter it with a tool to be the same girth, but a bit longer (insert 5th grade joke here).
 

Kind-Sir

OpenDayZ Rockstar!
Manatee - It gets faster with practice on editing the loot tables.

unkinhead - Right. Currently, it's using the same bag for the weaponholder. I've been looking around for different options, but nothing stands out. Maybe I could clone the model, and then alter it with a tool to be the same girth, but a bit longer (insert 5th grade joke here).
You might be able to apply a different texture to it.
Slap the texture in a mission file, and have it be generated via the mission file.
Not sure if that'll work, but it's worth a shot.
 

Fr1nk

Valued Member!
Manatee - It gets faster with practice on editing the loot tables.

unkinhead - Right. Currently, it's using the same bag for the weaponholder. I've been looking around for different options, but nothing stands out. Maybe I could clone the model, and then alter it with a tool to be the same girth, but a bit longer (insert 5th grade joke here).
Even something as simple as a slightly different color could work. Great idea though :)
 
Manatee - It gets faster with practice on editing the loot tables.

unkinhead - Right. Currently, it's using the same bag for the weaponholder. I've been looking around for different options, but nothing stands out. Maybe I could clone the model, and then alter it with a tool to be the same girth, but a bit longer (insert 5th grade joke here).
Oh I'm not saying it can't be done, I edited my loot table when the only method I knew of was direct loot substitution... That took forever and a day to figure out because of how many items actually spawn in diff places.. and matching up desired loot chances..

The method currently available is FAR easier to actually do, it's just a matter of sitting down and going through Celle's 200 custom guns & like 30 custom skins... A bunch of stuff has to be removed because I find it to be overpowered or just out of place.... The actual edit time after that point is actually the easy part.
 

McKeighan

Well-Known Member
Here's the code from dayz_equip.pbo for the tent's (plural). I've parsed out everything else and just left the specific code for those pieces - if you look in the RAR file I uploaded, I show the entirety of the PBO changes (in all their glory).

Anyway...
Code:
class cfgWeapons
{
    class Default;
    class ItemCore;
    class Loot: Default
    {
        scope = 2;
        value = 0;
        type = 0;
        displayName = "Use";
        canDrop = 0;
        muzzles[] = {"this"};
        magazines[] = {"ItemBandage","ItemHeatPack","PartWoodPile","PartFueltank","PartWheel","PartGeneric","PartEngine","PartVRotor","PartGlass","ItemWaterbottle","ItemWaterbottleUnfilled","ItemEpinephrine","ItemMorphine","ItemBloodbag","ItemAntibiotic","ItemPainkiller","ItemJerrycan","ItemGenerator","ItemTent","ItemDomeTent","ItemSandbag","ItemTankTrap","ItemWire","FoodSteakRaw","TrashTinCan","ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","FoodEdible","FoodSteakCooked","FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta"};
        modes[] = {"this"};
        useAction = 0;
        useActionTitle = "";
        enableAttack = 0;
        showToPlayer = 0;
    };
};
class CfgMagazines
{
    class CA_Magazine;
    class ItemTent: CA_Magazine
    {
        scope = 2;
        count = 1;
        type = "(256 * 3)";
        displayName = "$STR_EQUIP_NAME_20";
        model = "\dayz_equip\models\tentbag_gear.p3d";
        picture = "\dayz_equip\textures\equip_tentbag_ca.paa";
        descriptionShort = "$STR_EQUIP_DESC_20";
        class ItemActions
        {
            class Pitch
            {
                text = "$STR_PITCH_TENT";
                script = "spawn player_tentPitch;";
            };
        };
    };
    class ItemDomeTent: CA_Magazine
    {
        scope = 2;
        count = 1;
        type = "(256 * 3)";
        displayName = "6 MAN DOME TENT";
        model = "\dayz_equip\models\tentbag_gear.p3d";
        picture = "\dayz_equip\textures\equip_tentbag_ca.paa";
        descriptionShort = "6 MAN DOME TENT";
        class ItemActions
        {
            class Pitch
            {
                text = "$STR_PITCH_TENT";
                script = "spawn player_DometentPitch;";
            };
        };
    };
};
class CfgVehicles
{
    class NonStrategic;
    class BuiltItems: NonStrategic{};
    class TrapItems: NonStrategic{};
    class ReammoBox;
    class WeaponHolderBase: ReammoBox
    {
        scope = 0;
        accuracy = 1000;
        vehicleClass = "Survival";
        displayName = "Weapon";
        memoryPointSupply = "collect";
        supplyRadius = 3;
        transportMaxWeapons = 0;
        transportMaxMagazines = 0;
        transportMaxBackpacks = 0;
        transportAmmo = 0;
        transportRepair = 0;
        transportFuel = 0;
    };
    class WeaponHolder_ItemTent: WeaponHolderBase
    {
        scope = 2;
        displayName = "$STR_EQUIP_NAME_20";
        model = "\dayz_equip\proxy\tentbag.p3d";
        class eventHandlers
        {
            init = "[(_this select 0),'cfgMagazines','ItemTent'] execVM '\z\addons\dayz_code\init\object_pickupAction.sqf';";
        };
    };
    class WeaponHolder_ItemDomeTent: WeaponHolderBase
    {
        scope = 2;
        displayName = "6 MAN DOME TENT";
        model = "\dayz_equip\proxy\tentbag.p3d";
        class eventHandlers
        {
            init = "[(_this select 0),'cfgMagazines','ItemDomeTent'] execVM '\z\addons\dayz_code\init\object_pickupAction.sqf';";
        };
    };
    class Land_A_tent;
    class ACamp;
    class TentStorage: Land_A_tent
    {
        vehicleClass = "Survival";
        transportMaxMagazines = 50;
        transportMaxWeapons = 10;
        transportMaxBackpacks = 3;
    };
    class DomeTentStorage: Land_A_tent
    {
        vehicleClass = "Survival";
        model = "\ca\buildings\Tents\astan";
        transportMaxMagazines = 100;
        transportMaxWeapons = 20;
        transportMaxBackpacks = 10;
    };
    //BELOW is the prior build attempt, just using a link to Acamp directly. The above is just substituting in the model for the ACamp.
    /*class DomeTentStorage: ACamp
    {
        vehicleClass = "Survival";
        transportMaxMagazines = 100;
        transportMaxWeapons = 20;
        transportMaxBackpacks = 10;
    };*/
};
 

McKeighan

Well-Known Member
Here is the code changes to dayz_code.pbo\CfgMagazines.hpp

Code:
class CfgMagazines {
    class CA_Magazine;    // External class reference
    class ItemTent : CA_Magazine {
        scope = public;
        count = 1;
        type = (256 * 3);
        displayName = $STR_EQUIP_NAME_20;
        model = "\dayz_equip\models\tentbag_gear.p3d";
        picture = "\dayz_equip\textures\equip_tentbag_ca.paa";
        descriptionShort = $STR_EQUIP_DESC_20;
        
        class ItemActions {
            class Pitch {
                text = $STR_PITCH_TENT;
                script = "spawn player_tentPitch;";
            };
        };
    };
    //Added by McKeighan
    class ItemDomeTent : CA_Magazine {
        scope = public;
        count = 1;
        type = (256 * 3);
        displayName = "6 MAN DOME TENT";
        model = "\dayz_equip\models\tentbag_gear.p3d";
        picture = "\dayz_equip\textures\equip_tentbag_ca.paa";
        descriptionShort = "6 MAN DOME TENT";
        
        class ItemActions {
            class Pitch {
                text = $STR_PITCH_TENT;
                script = "spawn player_DometentPitch;";
            };
        };
    };
};
 

McKeighan

Well-Known Member
Here's the call for pitching the dometent. dayz_code.pbo\actions\dometent_pitch.sqf

Code:
private["_position","_tent","_location","_isOk","_backpack","_tentType","_trg","_key","_classname"];
//check if can pitch here
call gear_ui_init;
_playerPos =     getPosATL player;
_item = _this;
_hastentitem = _this in magazines player;
_location = player modeltoworld [0,2.5,0];
_location set [2,0];
_building = nearestObject [(vehicle player), "HouseBase"];
_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
//_isOk = true;

//diag_log ("Pitch Tent: " + str(_isok) );

_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");

if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};

//blocked
if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
//Block Tents in ponds
_objectsPond =         nearestObjects [_playerPos, [], 10];
    {
        _isPond = ["pond",str(_x),false] call fnc_inString;
        if (_isPond) then {
            _pondPos = (_x worldToModel _playerPos) select 2;
            if (_pondPos < 0) then {
                _isOk = true;
            };
        };
    } forEach _objectsPond;

//diag_log ("Pitch Tent: " + str(_isok) );

if (!_isOk) then {
    //remove tentbag
    player removeMagazine _item;
    _dir = round(direction player);    
    
    //wait a bit
    player playActionNow "Medic";
    sleep 1;
    
    _dis=20;
    _sfx = "tentunpack";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;  
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
    
    sleep 5;
    //place tent (local)
    _tent = createVehicle ["DomeTentStorage", _location, [], 0, "CAN_COLLIDE"];
    //_tent = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"};
    _tent setdir _dir;
    _tent setpos _location;
    player reveal _tent;
    _location = getPosATL _tent;

    _tent setVariable ["characterID",dayz_characterID,true];

    //player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];

    //["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],"DomeTentStorage"]] call callRpcProcedure;
    dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"DomeTentStorage"];
    //dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],_classname];
    publicVariableServer "dayzPublishObj";
    
    cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
} else {
    cutText [localize "str_fail_tent_pitch", "PLAIN DOWN"];
};
 

McKeighan

Well-Known Member
Here's the changes to dayz_code.pbo\compile\fn_selfactions.sqf - There's too much going on to just carve it down to what I actually added - so I'll just leave an //added by McKeighan part in the code below.


Code:
scriptName "Functions\misc\fn_selfActions.sqf";
private["_menClose","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_vehicle","_inVehicle","_color","_part"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_bag = unitBackpack player;
_classbag = typeOf _bag;
_isWater =         (surfaceIsWater (position player)) or dayz_isSwimming;
_hasAntiB =     "ItemAntibiotic" in magazines player;
_hasFuelE =     "ItemJerrycanEmpty" in magazines player;
//boiled Water
_hasbottleitem = "ItemWaterbottle" in magazines player;
_hastinitem = false;
{
    if (_x in magazines player) then {
        _hastinitem = true;
    };
} forEach boil_tin_cans;


_hasKnife =     "ItemKnife" in items player;
_hasToolbox =     "ItemToolbox" in items player;
_onLadder =        (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_nearLight =     nearestObject [player,"LitObject"];
_canPickLight = false;

if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

//1st Person In Car - Added by McKeighan - coding help from BlackMamb on the BI forums.
if (!isNull _vehicle && _inVehicle) then 
            {
            if (cameraOn == _vehicle && cameraView == "External") then { 
                _vehicle switchCamera "Internal"; 
    };
};

//Grab Flare
if (_canPickLight and !dayz_hasLight) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) then {    //Has some kind of target
    _isHarvested = cursorTarget getVariable["meatHarvested",false];
    _isVehicle = cursorTarget isKindOf "AllVehicles";
    _isVehicletype = typeOf cursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
    _isMan = cursorTarget isKindOf "Man";
    _ownerID = cursorTarget getVariable ["characterID","0"];
    _isAnimal = cursorTarget isKindOf "Animal";
    _isDog =  (cursorTarget isKindOf "DZ_Pastor" || cursorTarget isKindOf "DZ_Fin");
    _isZombie = cursorTarget isKindOf "zZombie_base";
    _isDestructable = cursorTarget isKindOf "BuiltItems";
    _isTent = (cursorTarget isKindOf "TentStorage" || cursorTarget isKindOf "DomeTentStorage"); //switch added by McKeighan
    _isFuel = false;
    _isAlive = alive cursorTarget;
    _canmove = canmove cursorTarget;
    _text = getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName");
    
    
    _rawmeat = meatraw;
    _hasRawMeat = false;
        {
            if (_x in magazines player) then {
                _hasRawMeat = true;
            };
        } forEach _rawmeat; 
    
    
    if (_hasFuelE) then {
        _isFuel = (cursorTarget isKindOf "Land_Ind_TankSmall") or (cursorTarget isKindOf "Land_fuel_tank_big") or (cursorTarget isKindOf "Land_fuel_tank_stairs") or (cursorTarget isKindOf "Land_wagon_tanker");
    };
  
    
    //Allow player to delete objects
    if(_isDestructable and _hasToolbox and _canDo) then {
        if (s_player_deleteBuild < 0) then {
            s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",cursorTarget, 1, true, true, "", ""];
        };
    } else {
        player removeAction s_player_deleteBuild;
        s_player_deleteBuild = -1;
    };
    
    //flip vehicle
    if ((_isVehicletype) and !_canmove and _isAlive and (player distance cursorTarget >= 2) and (count (crew cursorTarget))== 0 and ((vectorUp cursorTarget) select 2) < 0.5) then {
        if (s_player_flipveh  < 0) then {
            s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",cursorTarget, 1, true, true, "", ""];        
        };    
    } else {
        player removeAction s_player_flipveh;
        s_player_flipveh = -1;
    };
    
    //Allow player to fill jerrycan
    if(_hasFuelE and _isFuel and _canDo) then {
        if (s_player_fillfuel < 0) then {
            s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
        };
    } else {
        player removeAction s_player_fillfuel;
        s_player_fillfuel = -1;
    };
    
    if (!alive cursorTarget and _isAnimal and _hasKnife and !_isHarvested and _canDo) then {
        if (s_player_butcher < 0) then {
            s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",cursorTarget, 3, true, true, "", ""];
        };
    } else {
        player removeAction s_player_butcher;
        s_player_butcher = -1;
    };
    
    //Fireplace Actions check
    if (inflamed cursorTarget and _hasRawMeat and _canDo) then {
        if (s_player_cook < 0) then {
            s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",cursorTarget, 3, true, true, "", ""];
        };
    } else {
        player removeAction s_player_cook;
        s_player_cook = -1;
    };
    if (inflamed cursorTarget and (_hasbottleitem and _hastinitem) and _canDo) then {
        if (s_player_boil < 0) then {
            s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",cursorTarget, 3, true, true, "", ""];
        };
    } else {
        player removeAction s_player_boil;
        s_player_boil = -1;
    };
    
    if(cursorTarget == dayz_hasFire and _canDo) then {
        if ((s_player_fireout < 0) and !(inflamed cursorTarget) and (player distance cursorTarget < 3)) then {
            s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_fireout;
        s_player_fireout = -1;
    };
    
    //Packing my tent
    if(cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID) then {
        if ((s_player_packtent < 0) and (player distance cursorTarget < 3)) then {
            s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_packtent;
        s_player_packtent = -1;
        };
    
    //Packing my Dome Tent - Added by McKeighan
    if(cursorTarget isKindOf "DomeTentStorage" and _canDo and _ownerID == dayz_characterID) then {
        if ((s_player_packdometent < 0) and (player distance cursorTarget < 3)) then {
            s_player_packdometent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\dometent_pack.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_packdometent;
        s_player_packdometent = -1;
        };
        
    //Sleep  -  Dometent parts added by McKeighan
    if(cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID || cursorTarget isKindOf "DomeTentStorage" and _canDo and _ownerID == dayz_characterID) then {
        if ((s_player_sleep < 0) and (player distance cursorTarget < 3)) then {
            s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_sleep;
        s_player_sleep = -1;
    };
Rest of code below this part I cut out due to the posting limitations.
 

McKeighan

Well-Known Member
Here's the server.pbo\compile\server_publishObject.sqf

Code:
private ["_class","_uid","_charID","_object","_worldspace","_key"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID =        _this select 0;
_object =         _this select 1;
_worldspace =     _this select 2;
_class =         _this select 3;

if (!(_object isKindOf "Building")) exitWith {
    deleteVehicle _object;
};
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed) exitWith { };


//diag_log ("PUBLISH: Attempt " + str(_object));

//get UID
_uid = _worldspace call dayz_objectUID2;

//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid]; //was CHILD:308
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;

_object setVariable ["ObjectUID", _uid,true];

if (_object isKindOf "TentStorage" || _object isKindOf "DomeTentStorage") then {
    _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];



//BELOW is 1st attempt McKeighan code.

//if (_object isKindOf "TentStorage") then {
//    _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
//};
//if (_object isKindOf "DomeTentStorage") then {
//    _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
//};

//dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

//diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);
 
Top