Death cross script ??

Maybe
Code:
_playerMagazines = magazines _body;
instead of
Code:
_playerMagazines = getMagazineCargo _body;
 
Are you sure you have this in the right spot?
Code:
// ################## grave cross parameter start ##################
    _magazines    = call player_countmagazines;
    _backpack  = unitBackpack player;
 
    // ------------------items backpack check
    private ["_newBackpackType","_backpackWpn","_backpackMag"];
        dayz_myBackpack = unitBackpack player;
    _newBackpackType = (typeOf dayz_myBackpack);
        if(_newBackpackType != "") then {
            _backpackWpn = getWeaponCargo unitBackpack player;
            _backpackMag = getMagazineCargo unitBackpack player;
        };
// ################## grave cross parameter stop ##################

Because if so then the old
Code:
_playerMagazines = _magazines;

Should work fine.
 
Feed back using DayZ 1.8.0.3

my player_death.sqf: http://pastebin.com/AGMv5aWU

Before death carry: 1x brick / 1x bandage / 1x beans / 1x create / 1x nails / 1x painkillers / 1x roadflare / 1x windscreen glass / 1x wooden arrow / 1 x flashlight


Return to scene of death : 1x clothing parcel / 1 x flashlight
everything else missing.
 
You would need to add the .ogg sound file to your mission.pbo
Then you need to reference it like so in the description.ext
Code:
class CfgSounds
{
    sounds[] = {};
    class spooky1
    {
        name = "soo_spooky";
        sound[] = {"fx\spooky.ogg", 1, 1};
        titles[] = {1, "Someone must have died nearby..."};
    };
};

Then you have to mod my script to create a trigger at the grave location that checks if a player is within a certain distance, and if so, play the sound.

under
Code:
_graveBase setDir _playerDir;
add
Code:
// Lets add Sounds!
_trig = createTrigger ["EmptyDetector", getPos _tempContainer];
_trig setTriggerArea [5,5,0,false]
_trig setTriggerActivation ["NONE", "present", true];
_trig setTriggerStatements ["player distance < 30", "player say "spooky1"" , ""];

Unless I have the trigger code wrong it should work.
 
under
Code:
_graveBase setDir _playerDir;
add
Code:
// Lets add Sounds!
_trig = createTrigger ["EmptyDetector", getPos _tempContainer];
_trig setTriggerArea [5,5,0,false]
_trig setTriggerActivation ["NONE", "present", true];
_trig setTriggerStatements ["player distance < 30", "player say "spooky1"" , ""];

Unless I have the trigger code wrong it should work.[/quote]




Soon as I add this part of code, then try it out.
You die as normal with grave cross, but you get stuck on debug plains screen.
 
Then my trigger is wrong. Gonna have to wait for someone with more experience with triggers to come along.
 
Maybe
Code:
_playerMagazines = magazines _body;
instead of
Code:
_playerMagazines = getMagazineCargo _body;

_playerMagazines = magazines _body; is the only line that spawns everything for me (epoch 1.0.2.5) the other 2 won't spawn magazines.
 
under
Code:
_graveBase setDir _playerDir;
add
Code:
// Lets add Sounds!
_trig = createTrigger ["EmptyDetector", getPos _tempContainer];
_trig setTriggerArea [5,5,0,false]
_trig setTriggerActivation ["NONE", "present", true];
_trig setTriggerStatements ["player distance < 30", "player say "spooky1"" , ""];

Unless I have the trigger code wrong it should work.

Soon as I add this part of code, then try it out.
You die as normal with grave cross, but you get stuck on debug plains screen.

try this as the trigger
Code:
_trg=createTrigger["EmptyDetector",getPos _tempContainer];
_trg setTriggerArea[10,10,0,false];
_trg setTriggerActivation["ANY","PRESENT",true];
_trg setTriggerStatements ["this", "player say 'spooky1'", ""];
 
There should be a way to add study body. Theoretically you could add an exception in fn_selfActions to let you have studybody on a cross, but since there is no _body I think it'll just be unknown name with an unknown cause. Instead I tossed together a script to give you a random cause but it'll still be unknown name unless you want me to put in random names too (like Fred, Dave, etc).

Add this to your fn_selfActions under
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
add
Code:
// Study Graves
if ((cursorTarget == "GraveCross2") && _canDo) then {
    if (s_player_studygrave < 0) then {
        s_player_studygrave = player addAction ["Study Grave","Custom\studygrave.sqf",cursorTarget, 0, false, true, "",""];
    };
} else {
    player removeAction s_player_studygrave;
    s_player_studygrave = -1;
};
// End Study Graves

Then put this in a file called studygrave.sqf
Code:
if ((_this getVariable) == "permaLoot") then {
    switch (floor(random 10)) do {
    case 0: {
        cutText ["There's a large pool of blood nearby.","PLAIN DOWN"];
        };
    case 1: {
        cutText ["There's shell cases littered around.","PLAIN DOWN"];
        };
    case 2: {
        cutText ["This person was buried very hastily.","PLAIN DOWN"];
        };
    case 3: {
        cutText ["There are dead zombies laying around, must have been their final fight.","PLAIN DOWN"];
        };
    case 4: {
        cutText ["They almost made it off the coast.","PLAIN DOWN"];
        };
    case 5: {
        cutText ["There are dragmarks near the cross.","PLAIN DOWN"];
        };
    case 6: {
        cutText ["Next to the cross sits an empty can of beans.","PLAIN DOWN"];
        };
    case 7: {
        cutText ["They never managed to find their Twinky.","PLAIN DOWN"];
        };
    case 8: {
        cutText ["They must have started in Kamenka.","PLAIN DOWN"];
        };
    case 9: {
        cutText ["They thought they could handle it up North. They were wrong.","PLAIN DOWN"];
        };
    };
} else {
    cutText ["It's a grave in a graveyard...","PLAIN DOWN"];
    sleep 3;
    cutText ["Lucky they died before this infection.","PLAIN DOWN"];
};
 
  • Like
Reactions: i76
There should be a way to add study body. Theoretically you could add an exception in fn_selfActions to let you have studybody on a cross, but since there is no _body I think it'll just be unknown name with an unknown cause. Instead I tossed together a script to give you a random cause but it'll still be unknown name unless you want me to put in random names too (like Fred, Dave, etc).

Add this to your fn_selfActions under
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
add
Code:
// Study Graves
if ((cursorTarget == "GraveCross2") && _canDo) then {
    if (s_player_studygrave < 0) then {
        s_player_studygrave = player addAction ["Study Grave","Custom\studygrave.sqf",cursorTarget, 0, false, true, "",""];
    };
} else {
    player removeAction s_player_studygrave;
    s_player_studygrave = -1;
};
// End Study Graves

Then put this in a file called studygrave.sqf
Code:
if ((_this getVariable) == "permaLoot") then {
    switch (floor(random 10)) do {
    case 0: {
        cutText ["There's a large pool of blood nearby.","PLAIN DOWN"];
        };
    case 1: {
        cutText ["There's shell cases littered around.","PLAIN DOWN"];
        };
    case 2: {
        cutText ["This person was buried very hastily.","PLAIN DOWN"];
        };
    case 3: {
        cutText ["There are dead zombies laying around, must have been their final fight.","PLAIN DOWN"];
        };
    case 4: {
        cutText ["They almost made it off the coast.","PLAIN DOWN"];
        };
    case 5: {
        cutText ["There are dragmarks near the cross.","PLAIN DOWN"];
        };
    case 6: {
        cutText ["Next to the cross sits an empty can of beans.","PLAIN DOWN"];
        };
    case 7: {
        cutText ["They never managed to find their Twinky.","PLAIN DOWN"];
        };
    case 8: {
        cutText ["They must have started in Kamenka.","PLAIN DOWN"];
        };
    case 9: {
        cutText ["They thought they could handle it up North. They were wrong.","PLAIN DOWN"];
        };
    };
} else {
    cutText ["It's a grave in a graveyard...","PLAIN DOWN"];
    sleep 3;
    cutText ["Lucky they died before this infection.","PLAIN DOWN"];
};

all you have to do is get all the variables from the dead body and set them on the grave cross and modify study body script a little
 
Feel like adding the 'studyBody' to the gravecross? :)

I know someone had made it but it never worked for me.... its back one page in this thread at the top
http://opendayz.net/threads/death-cross-script.13004/page-4

Thx in advance, really appreciate all the help so far... its been awesome :)

to add study body to the script
in your player_death.sqf find
Code:
_graveBase = createVehicle ["GraveCross2", _containerLoc, [], 0, "NO_COLLIDE"];
_graveBase setPosATL _containerLoc;
_graveBase setDir _playerDir;
then under it add
Code:
_namePlayer = _body getVariable["bodyName","unknown"];
_graveBase setVariable["bodyName", _namePlayer, true];
_graveBase setVariable["deathType", _method, true];
then in your fn_selfActions.sqf find
Code:
// Study Body
    if (_player_studybody) then {
        if (s_player_studybody < 0) then {
            s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_studybody;
        s_player_studybody = -1;
    };
and replace it with
Code:
    _isgravcross = cursorTarget isKindOf "GraveCross2";
    if (_isgravcross) then {
        if (s_player_studybody < 0) then {
            s_player_studybody = player addAction ["Study Grave", "\z\addons\dayz_code\actions\study_body.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_studybody;
        s_player_studybody = -1;
    };
 
Back
Top