Jump to content
Nutzgo

[SOLVED] Custom Loadouts on respawn only showing one, not all

Recommended Posts

Hi,

I'm trying to set up a mission with a custom respawn loadout. For some reason, when I try to respawn, I can only choose one kind - and that is the rifleman.
I've made multiple classes, but they wont show up.

Can anybody help me? Thanks

Description.ext
 

Spoiler

respawnOnStart=-1;
#include "LoadoutClasses.hpp"


LoadoutClasses.hpp
 

Spoiler

class CfgRoles
{
    class Assault
    {
        displayName = $STR_A3_Role_Assault;
        icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa";
    };
    class Support
    {
        displayName = $STR_A3_Role_Support;
        icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\support_ca.paa";
    };
    class Recon
    {
        displayName = $STR_A3_Role_Recon;
        icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\recon_ca.paa";
    };
};

class CfgRespawnInventory
{
    class Rifleman
    {
        displayName = $STR_A3_ApexProtocol_class_Rifleman;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconMan_ca.paa";
        show = "side group _this == west";
        role = "Assault";

        weapons[] = {
            "arifle_SPAR_01_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "HandGrenade",
            "HandGrenade",
            "SmokeShell",
            "SmokeShell"
        };

        items[] = {
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "muzzle_snds_M"
        };

        linkedItems[] = {
            "V_PlateCarrier2_rgr_noflag_F",
            "H_HelmetB_TI_tna_F",
            "optic_ERCO_khk_F",
            "bipod_01_F_blk",
            "acc_pointer_IR",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "tf_anprc152",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_F";
    };
    class Grenadier
    {
        displayName = $STR_A3_ApexProtocol_class_Grenadier;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconMan_ca.paa";
        show = "side group _this == west";
        role = "Assault";

        weapons[] = {
            "arifle_SPAR_01_GL_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "HandGrenade",
            "HandGrenade",
            "SmokeShell",
            "SmokeShell"
        };

        items[] = {
            "muzzle_snds_M",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
        };

        linkedItems[] = {
            "V_PlateCarrier2_rgr_noflag_F",
            "H_HelmetB_TI_tna_F",
            "optic_ERCO_khk_F",
            "acc_pointer_IR",,
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "tf_anprc152",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_3_F";
        backpack = "B_AssaultPack_rgr";
        
    };

    class MachineGunner
    {
        displayName = $STR_A3_ApexProtocol_class_Autorifleman;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconManMG_ca.paa";
        show = "side group _this == west";
        role = "Assault";

        weapons[] = {
            "arifle_SPAR_02_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "150Rnd_556x45_Drum_Mag_F",
            "150Rnd_556x45_Drum_Mag_F",
            "150Rnd_556x45_Drum_Mag_F",
            "150Rnd_556x45_Drum_Mag_F",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "HandGrenade",
            "HandGrenade",
            "SmokeShell",
            "SmokeShell"
        };

        items[] = {
            "ACE_epinephrine",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "muzzle_snds_M"
        };

        linkedItems[] = {
            "V_PlateCarrier2_rgr_noflag_F",
            "H_HelmetB_TI_tna_F",
            "optic_ERCO_khk_F",
            "acc_pointer_IR",
            "bipod_01_F_blk",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "tf_anprc152",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_F";
        backpack = "B_AssaultPack_rgr";
    };

    class Medic
    {
        displayName = $STR_A3_ApexProtocol_class_Paramedic;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconManMedic_ca.paa";
        show = "side group _this == west";
        role = "Support";

        weapons[] = {
            "arifle_SPAR_01_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "SmokeShell",
            "SmokeShell",
            "SmokeShell",
            "SmokeShell"
        };

        items[] = {
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_epinephrine",
            "ACE_bloodIV_500",
            "ACE_bloodIV_500",
            "ACE_bloodIV_500",
            "ACE_bloodIV_500",
            "ACE_bloodIV_500",
            "ACE_bloodIV_500",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "muzzle_snds_M"
        };

        linkedItems[] = {
            "V_PlateCarrier1_rgr_noflag_F",
            "H_HelmetB_TI_tna_F",
            "optic_Holosight_khk_F",
            "acc_pointer_IR",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "tf_anprc152",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_2_F";
        backpack = "B_AssaultPack_rgr";
    };

    class Engineer
    {
        displayName = $STR_A3_ApexProtocol_class_Engineer;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconManEngineer_ca.paa";
        show = "side group _this == west";
        role = "Support";

        weapons[] = {
            "arifle_SPAR_01_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "SmokeShell",
            "SmokeShell",
            "DemoCharge_Remote_Mag",
            "DemoCharge_Remote_Mag",
            "DemoCharge_Remote_Mag",
            "DemoCharge_Remote_Mag"
        };

        items[] = {
            "ACE_epinephrine",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "MineDetector",
            "ToolKit",
            "ACE_DefusalKit",
            "ACE_M26_Clacker",
            "ACE_wirecutter",
            "muzzle_snds_M",
        };

        linkedItems[] = {
            "V_PlateCarrier1_rgr_noflag_F",
            "H_Booniehat_oli",
            "optic_Holosight_khk_F",
            "acc_pointer_IR",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "tf_anprc152",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_3_F";
        backpack = "B_Kitbag_rgr";
    };
    class RiflemanAT
    {
        displayName = $STR_A3_ApexProtocol_class_ATRifleman;
        role = "Support";

        weapons[] = {
            "arifle_SPAR_01_khk_F",
            "hgun_P07_khk_F",
            "launch_NLAW_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "SmokeShell",
            "SmokeShell",
            "NLAW_F",
            "NLAW_F"
        };

        items[] = {
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "muzzle_snds_M",
        };

        linkedItems[] = {
            "V_PlateCarrier1_rgr_noflag_F",
            "H_HelmetB_TI_tna_F",
            "optic_Holosight_khk_F",
            "acc_pointer_IR",
            "ItemMap",
            "ItemCompass",
            "ItemWatch",
            "tf_anprc152",
            "ItemGPS"
        };

        uniformClass = "U_B_CTRG_Soldier_F";
        backpack = "B_AssaultPack_rgr";
    };
    class Scout
    {
        displayName = $STR_A3_ApexProtocol_class_Scout;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconManRecon_ca.paa";
        show = "side group _this == west";
        role = "Recon";

        weapons[] = {
            "arifle_SPAR_01_GL_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "1Rnd_HE_Grenade_shell",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "MiniGrenade",
            "MiniGrenade",
            "SmokeShell",
            "SmokeShell"
        };

        items[] = {
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
        };

        linkedItems[] = {
            "V_TacVest_oli",
            "H_Cap_blk",
            "optic_ERCO_khk_F",
            "acc_pointer_IR",
            "muzzle_snds_M",
            "muzzle_snds_L",
            "bipod_01_F_blk",
            "tf_anprc152",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_2_F";
        backpack = "B_AssaultPack_rgr"
    };

    class Sharpshooter
    {
        displayName = $STR_A3_ApexProtocol_class_Sharpshooter;
        role = "Recon";

        weapons[] = {
            "arifle_SPAR_03_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "20Rnd_762x51_Mag",
            "20Rnd_762x51_Mag",
            "20Rnd_762x51_Mag",
            "20Rnd_762x51_Mag",
            "20Rnd_762x51_Mag",
            "20Rnd_762x51_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "MiniGrenade",
            "MiniGrenade",
            "SmokeShell",
            "SmokeShell"
        };

        items[] = {
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "optic_LRPS"
        };

        linkedItems[] = {
            "V_TacVest_oli",
            "H_Booniehat_oli",
            "optic_ERCO_khk_F",
            "acc_pointer_IR",
            "bipod_01_F_blk",
            "muzzle_snds_B",
            "muzzle_snds_L",
            "tf_anprc152",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_3_F";
    };

    class Saboteur
    {
        displayName = $STR_A3_ApexProtocol_class_Saboteur;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconManEngineer_ca.paa";
        show = "side group _this == west";
        role = "Recon";

        weapons[] = {
            "arifle_SPAR_01_khk_F",
            "hgun_P07_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "30Rnd_556x45_Stanag_Tracer_Red",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "16Rnd_9x21_Mag",
            "MiniGrenade",
            "MiniGrenade",
            "SmokeShell",
            "SmokeShell",
            "SLAMDirectionalMine_Wire_Mag",
            "SLAMDirectionalMine_Wire_Mag",
            "DemoCharge_Remote_Mag",
            "DemoCharge_Remote_Mag"
        };

        items[] = {
            "ACE_epinephrine",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_morphine",
            "ACE_morphine",
            "ACE_morphine",
            "MineDetector",
            "ToolKit",
            "ACE_DefusalKit",
            "ACE_M26_Clacker",
            "ACE_wirecutter"
        };

        linkedItems[] = {
            "V_TacVest_oli",
            "H_Bandanna_khk_hs",
            "optic_ERCO_khk_F",
            "muzzle_snds_M",
            "muzzle_snds_L",
            "acc_pointer_IR",
            "tf_anprc152",
            "ItemMap",
            "ItemCompass",
            "ItemGPS",
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_2_F";
        backpack = "B_Kitbag_rgr";
    };
};


onPlayerRespawn

Spoiler

_items = items player;

if ("ToolKit" in _items) then {player setVariable ["ACE_IsEngineer",1,true];

}

else
{player setVariable ["ACE_IsEngineer",0,true]

};

if ("ACE_bloodIV_500" in _items) then {player setVariable ["ace_medical_medicclass", 1, true]
}

else

{player setVariable ["ace_medical_medicclass", 0, true]
};


switch (_playerRole) do {
    case "Rifleman";
    {
        _loadoutPlayer = [player] execVM "loadouts\Rifleman.sqf";
        player setUnitTrait ["medic",false,false"];
    };
    
        case "Grenadier";
    {
        _loadoutPlayer = [player] execVM "loadouts\Grenadier.sqf";
        player setUnitTrait ["medic",false,false"];
    };
    
        case "MachineGunner";
    {
        _loadoutPlayer = [player] execVM "loadouts\MachineGunner.sqf";
        player setUnitTrait ["medic",false,false"];
    };
    
        case "Medic";
    {
        _loadoutPlayer = [player] execVM "loadouts\Medic.sqf";
        player setUnitTrait ["medic",true,false"];
    };    
    
        case "Engineer";
    {
        _loadoutPlayer = [player] execVM "loadouts\Engineer.sqf";
        player setUnitTrait ["medic",false,false"];
    };    
    
        case "RiflemanAT";
    {
        _loadoutPlayer = [player] execVM "loadouts\RiflemanAT.sqf";
        player setUnitTrait ["medic",false,false"];
    };
        
        case "Scout";
    {
        _loadoutPlayer = [player] execVM "loadouts\Scout.sqf";
        player setUnitTrait ["medic",false,false"];
    };
        
        case "Sharpshooter";
    {
        _loadoutPlayer = [player] execVM "loadouts\Sharpshooter.sqf";
        player setUnitTrait ["medic",false,false"];
    };
        
        case "Saboteur";
    {
        _loadoutPlayer = [player] execVM "loadouts\Saboteur.sqf";
        player setUnitTrait ["medic",false,false"];
    };
};
    
    


initserver.sqf
 

Spoiler

[west,"Rifleman"] call bis_fnc_addrespawninventory;
[west,"Grenadier",3] call bis_fnc_addrespawninventory;
[west,"MachineGunner",3] call bis_fnc_addrespawninventory;
[west,"Medic",3] call bis_fnc_addrespawninventory;
[west,"Engineer",3] call bis_fnc_addrespawninventory;
[west,"RiflemanAT",3] call bis_fnc_addrespawninventory;
[west,"Scout",3] call bis_fnc_addrespawninventory;
[west,"Sharpshooter",3] call bis_fnc_addrespawninventory;
[west,"Saboteur",3] call bis_fnc_addrespawninventory;


Loadouts
https://www.dropbox.com/sh/f34n6uds2zm29yr/AABXmmVXATR_QP8bAJpzfzTba?dl=0

  • Like 1

Share this post


Link to post
Share on other sites

In LoadoutClasses.hpp there are extra commas on the final array elements on lines 140, 400, 462, and 528. Also, in initServer.sqf, I'm not sure what the "3" in the function call parameters is there for but the only one without it is the one that works so perhaps the problem lies somewhere there.

Share this post


Link to post
Share on other sites
13 minutes ago, SpaceHippo said:

In LoadoutClasses.hpp there are extra commas on the final array elements on lines 140, 400, 462, and 528. Also, in initServer.sqf, I'm not sure what the "3" in the function call parameters is there for but the only one without it is the one that works so perhaps the problem lies somewhere there.

 
The "3" is a limit for the selected class. It means you can only have 3 players playing that role at the same time.
I'll check out the extra commas, and try without the limit anyway. Thanks!

Share this post


Link to post
Share on other sites

I solved it, it was an error in onPlayerRespawn.sqf.

Wrong code:
switch (_playerRole) do {
    case "Rifleman"; // Should be a colon, not a semicolon
    {
        _loadoutPlayer = [player] execVM "loadouts\Rifleman.sqf";
        player setUnitTrait ["medic",false,false"]; // The quote after false" is a quote too much.
    };

 

Correct code:
switch (_playerRole) do {
    case "Rifleman":
    {
        _loadoutPlayer = [player] execVM "loadouts\Rifleman.sqf";
        player setUnitTrait ["medic",false,false];
    };

And now it works perfectly!

Share this post


Link to post
Share on other sites
Just now, nagyszebi07 said:

Hello,

it doesn't work for me for some reason


To be able to understand what doesn't work, you'll have to provide more information.
What doesnt work, what shows up? What have you tried? Is there an error message?

Share this post


Link to post
Share on other sites

Yes,Description.ext

 

15:18:24 Error context »¿
15:18:24 Warning Message: File mpmissions\__cur_mp.Napf\description.ext, line 28: '.': '易encountered instead of '='
15:18:24 Warning Message: Config : some input after EndOfFile.
15:18:24 Mission Exile.Napf: Missing 'description.ext::Header'

 

 

Share this post


Link to post
Share on other sites
Just now, nagyszebi07 said:

Yes,Description.ext

 

15:18:24 Error context »¿
15:18:24 Warning Message: File mpmissions\__cur_mp.Napf\description.ext, line 28: '.': '易encountered instead of '='
15:18:24 Warning Message: Config : some input after EndOfFile.
15:18:24 Mission Exile.Napf: Missing 'description.ext::Header'

 

 


Looks like an typo in your description.ext, as it says: a symbol instead of = at line 28.

Share this post


Link to post
Share on other sites

You modified description.ext:

 

respawnOnStart=-1;
#include "LoadoutClasses.hpp"

 

My:

respawnOnStart = 0;

 

 

i tried to modify it but it didn't work ( example: respawnOnStart = -1;

 

 

 

Share this post


Link to post
Share on other sites
On 10/24/2019 at 2:16 AM, Nutzgo said:

I solved it, it was an error in onPlayerRespawn.sqf.

Wrong code:
switch (_playerRole) do {
    case "Rifleman"; // Should be a colon, not a semicolon
    {
        _loadoutPlayer = [player] execVM "loadouts\Rifleman.sqf";
        player setUnitTrait ["medic",false,false"]; // The quote after false" is a quote too much.
    };

 

Correct code:
switch (_playerRole) do {
    case "Rifleman":
    {
        _loadoutPlayer = [player] execVM "loadouts\Rifleman.sqf";
        player setUnitTrait ["medic",false,false];
    };

And now it works perfectly!


Hi there.

Actually there are other issues in your onPlayerRespawn.sqf.

At first, the file needs to start in this way or something like this: 

private ["_playerRole","_loadoutPlayer","_items"];

_playerRole = _this select 0;
_loadoutPlayer = _this select 1;
_items = items player;

and then (from setVariable to setUnitTrait):

if ("ToolKit" in _items) then {
	player setUnitTrait ["ACE_IsEngineer",1,true];
} else {
	player setUnitTrait ["ACE_IsEngineer",0,true];
};

In this way, your code is working perfectly without any error.

For new code people who are taking a hard moment with something here, pay attention. @Nutzgo's LoadoutClasses.hpp and description.ext files got some accidental mistakes: in LoadoutClasses.hpp the line "class CfgRespawnInventory..." and all lines come next is garbage in that file. And in description.ext you should call his loadouts like this:

//BASIC CONFIGS
class Header {
	respawnOnStart	= -1; 	// -1=Dont respawn on start. Don't run respawn script on start.
};

// ROLES
#include "LoadoutClasses.hpp"

// INVENTORY OF ROLES (LOADOUTS)
class CfgRespawnInventory {

	#include "loadouts\Rifleman.sqf"
	#include "loadouts\Grenadier.sqf"
	#include "loadouts\MachineGunner.sqf"
	#include "loadouts\Medic.sqf"
	#include "loadouts\Engineer.sqf"
	#include "loadouts\RiflemanAT.sqf"
	#include "loadouts\Scout.sqf"
	#include "loadouts\Sharpshooter.sqf"
	#include "loadouts\Saboteur.sqf"
};

Btw, thanks a lot, @Nutzgo.

Share this post


Link to post
Share on other sites
5 hours ago, thy_ said:

Actually there are other issues in your onPlayerRespawn.sqf.

At first, the file needs to start in this way or something like this: 


private ["_playerRole","_loadoutPlayer","_items"];

_playerRole = _this select 0;
_loadoutPlayer = _this select 1;

This would be wrong, onPlayerRespawn.sqf gets passed [ _newUnit, _oldUnit, _respawn ,_respawnDelay ] as can be seen on the events scripts page.

 

5 hours ago, thy_ said:

and then (from setVariable to setUnitTrait):

No, not according to ACE documentation, it is setVariable.

DOC

Framework function isEngineer

Framework function assignObjectsInList

 

5 hours ago, thy_ said:

in LoadoutClasses.hpp the line "class CfgRespawnInventory..." and all lines come next is garbage in that file

If you talking about invisible characters it is a known forum problem when copy code from a code block.

 

5 hours ago, thy_ said:

And in description.ext you should call his loadouts like this: 

What, No..

  • respawnOnStart should be in the root of the description.ext (Where does Class Header come from?)
  • #include "LoadoutClasses.hpp" already defines CfgRespawnInventory. Creating another should throw an error about it already being defined (by the include).
  • Including sqf scripts into a config class makes no sense at all.

 

 

Share this post


Link to post
Share on other sites
21 hours ago, Larrow said:

This would be wrong, onPlayerRespawn.sqf gets passed [ _newUnit, _oldUnit, _respawn ,_respawnDelay ] as can be seen on the events scripts page.

 

Got you. This is the header of my onPlayerRespawn.sqf now:

// Executed locally by own Arma when player respawns in a multiplayer mission
// _newUnit, _oldUnit, _respawn and _respawnDelay are default and you shouldn't change it!!!
// https://community.bistudio.com/wiki/Event_Scripts#onPlayerRespawn.sqf

params ["_newUnit","_oldUnit","_respawn","_respawnDelay","_itemsUnit", "_helmetUnit"];

_itemsUnit = items player;
_helmetUnit = headgear player;

 

Share this post


Link to post
Share on other sites
12 hours ago, Larrow said:

No, not according to ACE documentation, it is setVariable.

DOC

Framework function isEngineer

Framework function assignObjectsInList


Hm. It's because I am not using ACE configs in my tests. Here we can see what exactly is happening here. And it works perfectly with setUnitTrait and absolutely doesn't with setVariable:

onPlayerRespawn.sqf

(...)

// is armored crew
if ("ToolKit" in _itemsUnit) then {
	player setUnitTrait ["isCrew",1,true];
} else {
	player setUnitTrait ["isCrew",0,true];
};

// is chopper pilot
if (_helmetUnit == "H_PilotHelmetHeli_B") then {
	player setUnitTrait ["isPilot",1,true];
} else {
	player setUnitTrait ["isPilot",0,true];
};

// IMPORTANT: according to ACE documentation, it is setVariable and not setUnitTrait.
// if ("ACE_bloodIV_500" in _itemsUnit) then {
// 		player setVariable  ["ace_medical_medicclass", 1, true];
// } else {
// 		player setVariable  ["ace_medical_medicclass", 0, true];
// };

switch (_oldUnit) do {
	case "blueCrew": {
        _newUnit = [player] execVM "loadouts\blueCrew.sqf";
        player setUnitTrait ["medic",false,false];
    };
	case "blueCrewCommander": {
        _newUnit = [player] execVM "loadouts\blueCrewCommander.sqf";
        player setUnitTrait ["medic",false,false];
    };
    case "blueInfantry": {
        _newUnit = [player] execVM "loadouts\blueInfantry.sqf";
        player setUnitTrait ["medic",false,false];
    };
    case "blueInfantrySL": {
        _newUnit = [player] execVM "loadouts\blueInfantrySL.sqf";
        player setUnitTrait ["medic",true,false];
    };
    case "bluePilot": {
        _newUnit = [player] execVM "loadouts\bluePilot.sqf";
        player setUnitTrait ["medic",false,false];
    };
};

 

Share this post


Link to post
Share on other sites
13 hours ago, Larrow said:
  • respawnOnStart should be in the root of the description.ext (Where does Class Header come from?)


I'm following this, about class Header: https://community.bistudio.com/wiki/Description.ext#Mission_information
EDIT: Oh, I see the issue. The Header class we use only for GameType stuff. 

 

13 hours ago, Larrow said:
  • #include "LoadoutClasses.hpp" already defines CfgRespawnInventory. Creating another should throw an error about it already being defined (by the include).


If you check my message once again, you will notice that I am suggesting remove the whole CfgRespawnInventory from LoadoutClasses.hpp and set that directly in description.ext.

// ROLES
#include "LoadoutClasses.hpp" // <----------------- there is no CfgRespawnInventory into my file because the approaching for me is put it bellow

// INVENTORY OF ROLES (LOADOUTS)
class CfgRespawnInventory {   // <------------------ here.

	#include "loadouts\Rifleman.sqf"
	#include "loadouts\Grenadier.sqf"
	#include "loadouts\MachineGunner.sqf"
	#include "loadouts\Medic.sqf"
	#include "loadouts\Engineer.sqf"
	#include "loadouts\RiflemanAT.sqf"
	#include "loadouts\Scout.sqf"
	#include "loadouts\Sharpshooter.sqf"
	#include "loadouts\Saboteur.sqf"
};

 But if here also you can see an issue, it would be awesome if you let me know. 

Share this post


Link to post
Share on other sites
13 hours ago, Larrow said:
  • Including sqf scripts into a config class makes no sense at all.

 

Hmm... So should I use .hpp to call my loadouts into description.ext as the example below?

description.ext

// INVENTORY OF ROLES (LOADOUTS)
class CfgRespawnInventory {

	#include "loadouts\Rifleman.hpp"
	#include "loadouts\Grenadier.hpp"
	#include "loadouts\MachineGunner.hpp"
	#include "loadouts\Medic.hpp"
	#include "loadouts\Engineer.hpp"
	#include "loadouts\RiflemanAT.hpp"
	#include "loadouts\Scout.hpp"
	#include "loadouts\Sharpshooter.hpp"
	#include "loadouts\Saboteur.hpp"
};

In my tests, I already didn't see any issue in to use .sqf or .hpp into description file, although, be nice again, let me know what is the best way to practice 😉

Share this post


Link to post
Share on other sites
15 hours ago, thy_ said:

you will notice that I am suggesting remove the whole CfgRespawnInventory from LoadoutClasses.hpp and set that directly in description.ext.

Ok that wasn't clear from your post. All you mention is that CfgRespawnInventories had garbage in it.

On 7/17/2020 at 1:23 AM, thy_ said:

 LoadoutClasses.hpp and description.ext files got some accidental mistakes: in LoadoutClasses.hpp the line "class CfgRespawnInventory..." and all lines come next is garbage in that file

Hence my response...

On 7/17/2020 at 6:22 AM, Larrow said:

If you talking about invisible characters it is a known forum problem when copy code from a code block.

 

 

14 hours ago, thy_ said:

Hmm... So should I use .hpp to call my loadouts into description.ext as the example below?

I think there maybe some confusion here. What are in your loadouts\# files, as they were named #.sqf I was presuming they were script files as per the downloads available from @Nutzgo's original post. Which if they are then including them into a config class makes no sense. Or are they...

Spoiler

 class Rifleman
    {
        displayName = $STR_A3_ApexProtocol_class_Rifleman;
        icon = "\A3\ui_f\data\map\VehicleIcons\iconMan_ca.paa";
        show = "side group _this == west";
        role = "Assault";

        weapons[] = {
            "arifle_SPAR_01_khk_F",
            "Rangefinder"
        };

        magazines[] = {
            "30Rnd_556x45_Stanag_red",
            "SmokeShell"
        };

        items[] = {
            "ACE_fieldDressing"
        };

        linkedItems[] = {
            "ItemWatch"
        };

        uniformClass = "U_B_CTRG_Soldier_F";
    };

 

..respawn inventories? In which case they shouldn't really be called #.sqf as it only causes confusion, case in point.

But yes the engine will except any file extension, it just reads them as a text file.

 

 

Share this post


Link to post
Share on other sites

 

8 hours ago, Larrow said:

 

23 hours ago, thy_ said:

Hmm... So should I use .hpp to call my loadouts into description.ext as the example below?

 (...) What are in your loadouts\# files, as they were named #.sqf I was presuming they were script files as per the downloads available from @Nutzgo's original post. (...)

 

I see. I preferred to take the way below:

 

loadouts\blueCrew.hpp

class blueCrew // This is called in description.ext, initServer.sqf and onPlayerRespawn.sqf as well.
	{
		displayName = "Crew / Tripulante";						
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";	
		role = "roleBlueCrew";									

		weapons[] = {
			"rhs_weap_m4",
			"Binocular"
		};
		magazines[] = {
			"rhs_mag_30Rnd_556x45_M855A1_Stanag",
			"rhs_mag_30Rnd_556x45_M855A1_Stanag",
			"rhs_mag_m18_purple" 
		};
		items[] = {
			"ACE_elasticBandage",
			"ACE_elasticBandage",
			"ACE_morphine",
			"ACE_morphine",
			"ACE_tourniquet",
			"ACE_tourniquet",
			"ACE_split",
			"ACE_split",
			"ACE_EarPlugs",
			"ACE_Flashlight_MX991", 
			"ToolKit"
		};
		linkedItems[] = {
			"ItemCompass",
			"ItemWatch",
			"rhsusf_cvc_alt_helmet", 
			"rhsusf_spc_crewman", 
			"TFAR_rf7800str" 
		};
		uniformClass = "rhs_uniform_FROG01_d";
		backpack = "rhsusf_falconii_coy";
	};

Then, in this case, I must use .hpp file to save my loadouts as the example above if I understand right. Just to contextualize: 

 

 Piece of my initServer.sqf

(...)
// PLAYERS LOADOUTS
["Initialize", [true]] call BIS_fnc_dynamicGroups;
[west,"blueCrew"] call bis_fnc_addRespawnInventory;
(...)

Piece of my description.ext

(...)
// ROLES
#include "roles.hpp"
// ROLE LOADOUTS
class CfgRespawnInventory {
#include "loadouts\blueCrew.hpp"
}
(...)

And a piece of my onPlayerRespawn.sqf

(...)
switch (_oldUnit) do {
	case "blueCrew": {
    	_newUnit = [player] execVM "loadouts\blueCrew.hpp";
        player setUnitTrait ["medic",false,false];
    };
(...)

 

Share this post


Link to post
Share on other sites

 

17 hours ago, thy_ said:

_newUnit = [player] execVM "loadouts\blueCrew.hpp";

This makes no sense. How can you call some code( execVM ) on a config class structure( class blueCrew { ). It should scream errors at you.

 

Its the same as saying..

_newUnit = [ player ] spawn {
	class blueCrew {
		displayName = "Crew / Tripulante";						
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";	
		role = "roleBlueCrew";									

		weapons[] = {
			"rhs_weap_m4"
		};
		magazines[] = {
			"rhs_mag_30Rnd_556x45_M855A1_Stanag"
		};
		items[] = {
			"ACE_elasticBandage"
		};
		linkedItems[] = {
			"ItemCompass"
		};
		uniformClass = "rhs_uniform_FROG01_d";
		backpack = "rhsusf_falconii_coy";
	};
};

...you would not expect that to work would you. _newUnit would also just be a scriptHandle not a reference to a unit as the variable name implies.

 

Also...

17 hours ago, thy_ said:

switch (_oldUnit) do { case "blueCrew": {

How can you compare a unit to the string "blueCrew"? You want to compare the units previous loadout name to a string.

 

Share this post


Link to post
Share on other sites

Somehow @Larrow, everything is working with no error visible. Somehow...  

 

As I am not programming, sometimes you're speaking Kubric's monolith language but I am learning to fly and that's totally ok for me. I am tryin' something new during these crazy times that we are living in 2020.

My working example: https://drive.google.com/file/d/1N24fEKMse9n-kcbpBvjwNm0ptQU59vVV/view?usp=sharing (10KB). 

  • You can change your Role and Loadout at the start and next respawn without to go to Role Assignment screen back.
  • Role Assignment Screen exists here just for players to take server slots and nothing more. 
  • If you are wearing crew loadout, you are able to take ground vehicles;
  • If you are wearing chopper pilot loadout, you are able to take air vehicles;

 

If you edit my code for those best practices, or set your mind that you are talking with a newbie and tell me exactly what should I do, I am quite sure I would replay the whole code on my next missions. 

Share this post


Link to post
Share on other sites
On 7/19/2020 at 10:13 PM, thy_ said:

everything is working with no error visible.

As your switch statement is not doing anything, its not picking a case as you cannot compare an OBJECT(unit) to a STRING(blueCrew).

 

MISSION

  • Thanks 1

Share this post


Link to post
Share on other sites
9 hours ago, Larrow said:

MISSION


I sent a beer for cheers!

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

×