Jump to content
Reeveli

Adding Ace interaction via config

Recommended Posts

Before I start yes I have read the ACE documentation. The problem is that I find either the documentation or my ability to read it lacking. So why even use config and not scripts as there are many examples of those? Well I think that if the config option would work it would be an easier way to include actions within certain categories and with custom icons etc (adding my own parent categories like the equipment and gesture ones that are already in will be a problem for the next phase). Anyway does anyone know how one is to actually use an action defined in a config (I assume description.ext would suffice, if not the a dedicated file)? Not only is the one given example broken there is no mention how you are to add the action to an object/class or am I missing something obvious here?

Share this post


Link to post
Share on other sites

Ace interactions cannot be set from description.ext AFAIK . It is however possible to set them via configuration from an add-on and the example provided in the documentation does work!

Share this post


Link to post
Share on other sites
1 hour ago, Mr H. said:

Ace interactions cannot be set from description.ext AFAIK . It is however possible to set them via configuration from an add-on and the example provided in the documentation does work!

 

Can you elaborate on that? Do you mean a new config file has to added into a new addon and thus cannot be a mission specific only? As for the example given in the documentation I would have assumed that several brackets were missing.

Share this post


Link to post
Share on other sites
3 hours ago, Reeveli said:

Can you elaborate on that? Do you mean a new config file has to added into a new addon and thus cannot be a mission specific only?

Exactly

3 hours ago, Reeveli said:

would have assumed that several brackets were missing.

Yes indeed, I assume the closing brackets I've been left out intentionally. In other words the example code works, you just have to close the brackets. 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the clarification. Doing a dedicated addon even just for some interactions is beyond my league. There is some talk about child actions which I think would create a new sub category instead of just filling the main interaction space. However I can't wrap my head around the example provided. Anyone here with any experience with child actions and how to use them?

Share this post


Link to post
Share on other sites

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);
    };

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×