Jump to content

RL - AVE

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Posts posted by RL - AVE


  1. I had a take on implementing a higher risk of loosing force and combat efficiency when taking high risks in our milsim group. The increased risk should push all commanders to vaule the lives of the players througout the gaming session, and to make decisions based on that risk.

    This respawn method is one of of many ways to achieve this. 

     

    With this script dead players are respawned by other players placing their dead body in a body bag and returning it to a collection point (object named morgue). I plan on using it together with a second method of respawn through Zeus manual mass respawn.

     

    Requirements: 

    ACE 3 

     

    //Editor placed Tarp_01_Large_Yellow_F (morgue). No respawn modules. Empty marker (respawn_west).


    //description.ext

    Spoiler

     

    
    respawn = 3;
    respawnOnStart = 0;
    respawnDelay = 1e9;
    respawnTemplates[] = {"ace_spectator"};

     

     

     


    //init.sqf

    Spoiler

     

    
    //BodyBag Respawn
    if (isServer) then {
    	if (isNull morgue) exitWith {systemChat "Error: Place object named 'morgue' in editor";};
    	["ace_placedInBodyBag", {
    		params ["_deadGuy", "_bodyBag"];
    		private _name = [_deadGuy] call ace_common_fnc_getName;
    		_bodyBag setVariable ["BodyName", _name];
    	}] call CBA_fnc_addEventHandler;
    
    	[] spawn {
    		while {true} do {
    			sleep 10;
    			private _bags = morgue nearObjects ["ACE_bodyBagObject", 5]; 
    			{
    				private _bodyBag = _x;
    				if (!(_bodyBag getVariable ["processed", false])) then {
    					_bodyBag setVariable ["processed", true];
    					_name = _bodyBag getVariable ["BodyName", "err"];
    					[_name,_bodyBag] remoteExec ["RL_fnc_BodyBagRespawn", -2];
    				};
    			} forEach _bags;
    		};
    	};
    };
    
    RL_fnc_BodyBagRespawn = {
    	params ["_name","_bodyBag"];
    	if (profileName isEqualTo _name && !alive player) then {
    		_bodyBagPos = getPos _bodyBag;
    		_bodyBagDir = getDir _bodyBag;
    		setPlayerRespawnTime 0;
    		private _bodyBagEmpty = createVehicle ["Land_Bodybag_01_empty_black_F", [0,0,0], [], 0, "NONE"];
    		_bodyBagEmpty setDir (_bodyBagDir);
    		sleep 2;
    		deleteVehicle _bodyBag;
    		_bodyBagEmpty setPos _bodyBagPos;
    		player setDir (_bodyBagDir+45);
    		player setPos _bodyBagPos;
    		sleep 0.5;
    		[player, 'Acts_UnconsciousStandUp_part1'] remoteExec ['switchMove', 0];
    	};
    };

     

     

     


    Credit to @pabstmirror who got this going at ACE Github! 


  2. I'm learning by creating a simple mod with: 

    • custom equipment in crates
    • containers that spawn said crates through ace interact with child.

    But I must have missed something obvious, any help would be appriciated! Should I do anything differently? 

    Is to run MP on dedi, only tested from editor MP.

     

    What works:

    Packing from P:/ruthless/addons/RL_Logistik with PboProject without errors. 

    Crates are fine, containers show up in editor and Zeus.

    Other crates that init the same way as the currently non-working containers (init="[(_this select 0)] execVM ...) are executed fine.

     

    What doesn't work: 

    No custom ace interaction on the custom containers. Standard "Interact -> Cargo" from inherited ace works. 

     

     

    \ruthless\addons\RL_Logistik\config.cpp

    Spoiler

    ...

    class CfgVehicles
    {

    ...

    ///Works: Create new crate class, apply additional texture, fill with equip///

        class RL_AK5_crate: Land_PlasticCase_01_medium_F
        {
            author="[RL] AVE";
            class SimpleObject
            {
                eden=1;
                animate[]={};
                hide[]={};
                verticalOffset=0.19400001;
                verticalOffsetWorld=0;
                init="''";
            };
            editorPreview="\A3\EditorPreviews_F_Enoch\Data\CfgVehicles\Land_PlasticCase_01_medium_olive_F.jpg";
            _generalMacro="Land_PlasticCase_01_medium_olive_F";
            editorSubcategory="RL_boxes";
            scope=2;
            scopeCurator=2;
            displayName="RL AK5 Am Stor";
            model="a3\Structures_F_Heli\Items\Luggage\PlasticCase_01_medium_F.p3d";
            hiddenSelections[]=
            {
                "Camo",
                "Camo2"
            };
            hiddenSelectionsTextures[]=
            {
                "a3\Props_F_Enoch\Military\Supplies\Data\PlasticCase_01_olive_CO.paa",
                "\ruthless\addons\RL_Logistik\data\crates\RL_AK5_crate.paa"
            };
            class TransportWeapons
            {
            };
            class TransportItems
            {
            };
            class TransportMagazines
            {
                class _xx_sfp_30Rnd_556x45_Stanag_plastic
                {
                    magazine="sfp_30Rnd_556x45_Stanag_plastic";
                    count=60;
                };
            };
        };

    ...

     

    ///Either this or sqf below is not working. Create container class and run sqf on init///

        class RL_amcontainer_liten: Land_Cargo10_military_green_F
        {
            author="Bohemia Interactive";
            class SimpleObject
            {
            };
            editorSubcategory="RL_containers";
            scope=2;
            scopeCurator=2;
            displayName="RL amcontainer liten";
            class EventHandlers
            {
                init="[(_this select 0)] execVM '\ruthless\addons\RL_Logistik\scripts\cargo\RL_amcontainer_liten.sqf'";
            };
            hiddenSelections[]={};
            hiddenSelectionsTextures[]={};
        };

    ...

     

     

    \ruthless\addons\RL_Logistik\scripts\cargo\RL_amcontainer_liten.sqf

    Spoiler

    _code = {
        hint "MainAction";
    };
    _crate = (_this select 0);
    _condition = {
            true
    };

    _action_1 = ["RL_Log_LossaAm", "Unload","",_code,_condition] call ace_interact_menu_fnc_createAction;
    [_crate, 0, ["ACE_MainActions"], _action_1] call ace_interact_menu_fnc_addActionToObject; 

     

    _code = 
    {
        _emptyPosAGL = [(_this select 0),"CAManBase",player,10,true] call ace_common_fnc_findUnloadPosition;
        if (count _emptyPosAGL == 0 ) then
            { 
            hint "No avaliable space to unload!"; 
            } else 
            {
            _box = createVehicle ["RL_AK5_crate", _emptyPosAGL, [], 0, "NONE"];
            _box setPosASL (AGLtoASL _emptyPosAGL);
            };
    };
    _action = ["RL_AK5_crate","RL AK5 Amlåda stor","\A3\Ui_f\data\IGUI\Cfg\simpleTasks\actions\rearm.paa",_code,_condition] call ace_interact_menu_fnc_createAction;
    [_crate, 0, ["ACE_MainActions","RL_Log_LossaAm"], _action] call ace_interact_menu_fnc_addActionToObject; 
     

     

     

    _________________Update________________

     

    After some help from ace slack and @dahlgren I changed the implementation to the spoilers below. Unfortunately it didn't solve my problem; no custom ace interaction on the custom container. Standard "Interact -> Cargo" from inherited ace works. 

     

    \ruthless\addons\RL_Logistik\config.cpp

    Spoiler

    ...

    class CfgFunctions 
    {
        class ruthless
        {    
            tag = "ruthless";
            file = "\ruthless\addons\RL_Logistik\functions";
            class RL_FINKAL_556_stor {};
        };
    };

    ...

    class CfgVehicles
    {

    ...

        class RL_FINKAL_556_stor: Land_PlasticCase_01_medium_F
        {
            author="[RL] AVE";
            class SimpleObject
            {
                eden=1;
                animate[]={};
                hide[]={};
                verticalOffset=0.19400001;
                verticalOffsetWorld=0;
                init="''";
            };
            editorPreview="\A3\EditorPreviews_F_Enoch\Data\CfgVehicles\Land_PlasticCase_01_medium_olive_F.jpg";
            _generalMacro="Land_PlasticCase_01_medium_olive_F";
            editorSubcategory="RL_boxes";
            scope=2;
            scopeCurator=2;
            displayName="RL FINKAL 556 stor";
            model="a3\Structures_F_Heli\Items\Luggage\PlasticCase_01_medium_F.p3d";
            hiddenSelections[]=
            {
                "Camo",
                "Camo2"
            };
            hiddenSelectionsTextures[]=
            {
                "a3\Props_F_Enoch\Military\Supplies\Data\PlasticCase_01_olive_CO.paa",
                "\ruthless\addons\RL_Logistik\data\crates\RL_FINKAL_556_stor.paa"
            };
            class TransportWeapons
            {
            };
            class TransportItems
            {
            };
            class TransportMagazines
            {
                class _xx_sfp_30Rnd_556x45_Stanag_plastic
                {
                    magazine="sfp_30Rnd_556x45_Stanag_plastic";
                    count=60;
                };

            };
        };

    ...

         class RL_amcontainer_liten: Land_Cargo10_military_green_F
        {
            author="Bohemia Interactive - mod. by [RL] AVE";
            class SimpleObject
            {
            };
            editorSubcategory="RL_containers";
            scope=2;
            scopeCurator=2;
            displayName="RL amcontainer liten";
            class ACE_Actions {
                class RL_Log_LossaAm {
                    displayName = "Lossa";
                    condition = "alive _target";
                    exceptions[] = {};
                    statement = "_player switchMove 'TestDance'";
                    icon = "\A3\Ui_f\data\IGUI\Cfg\simpleTasks\objects\container.paa";
                        class RL_FINKAL_556_stor {
                        displayName = "RL FINKAL 5,56 stor";
                        condition = "alive _target";
                        exceptions[] = {};
                        statement = [] call ruthless_fnc_RL_FINKAL_556_stor;
                        icon = "\A3\Ui_f\data\IGUI\Cfg\simpleTasks\actions\rearm.paa";
                    };
                };
            };
            hiddenSelections[]={};
            hiddenSelectionsTextures[]={};
        };

     

     

    \ruthless\addons\RL_Logistik\functions\fn_RL_FINKAL_556_stor.sqf

    Spoiler

    _emptyPosAGL = [(_this select 0),"CAManBase",player,10,true] call ace_common_fnc_findUnloadPosition;
    if (count _emptyPosAGL == 0 ) then
        { 
        hint "No avaliable space!"; 
        } else 
        {
        _box = createVehicle ["RL_FINKAL_556_stor", _emptyPosAGL, [], 0, "NONE"];
        _box setPosASL (AGLtoASL _emptyPosAGL);
        };

     

×