Jump to content
  • 0

Custom CfgVehicles.hpp?


Grahame

Question

I'm trying to load a custom CfgVehicles.hpp in my mission PBO but for some reason it causes the server to fail to load properly. I have successfully added other customizations but this one has stumped me. FYI, what I'm trying to do is restore the vanilla UAV spawns but have them summon AI armed with CUP weaponry rather than their 2035 equivalents which are not used on my server.

I copied the original CfgVehicles.hpp to epoch.Altis\epochz_config and modified the lines for the three Epoch soldier classes as follows:

class I_Soldier_base_F;


    class I_Soldier_EPOCH : I_Soldier_base_F
    {
        author = "$STR_A3_Bohemia_Interactive";
        _generalMacro = "I_Soldier_EPOCH";
        scope = 2;
        displayName = "Epoch Militia Soldier";
        cost = 90000;
        camouflage = 1.2;
        uniformClass = "U_I_CombatUniform_shortsleeve";
        weapons[] = { "CUP_smg_MP5A5", "CUP_hgun_M9", "Throw", "Put" };
        respawnWeapons[] = { "CUP_smg_MP5A5", "CUP_hgun_M9", "Throw", "Put" };
        Items[] = { "FAK" };
        RespawnItems[] = { "FAK" };
        magazines[] = { "CUP_30Rnd_9x19_MP5", "CUP_30Rnd_9x19_MP5", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        respawnMagazines[] = { "CUP_30Rnd_9x19_MP5", "CUP_30Rnd_9x19_MP5", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        linkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
        respawnLinkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
    };
    class I_Soldier2_EPOCH : I_Soldier_base_F
    {
        author = "$STR_A3_Bohemia_Interactive";
        _generalMacro = "I_Soldier2_EPOCH";
        scope = 2;
        displayName = "Epoch Militia Guerilla";
        cost = 90000;
        camouflage = 1.2;
        uniformClass = "U_IG_Guerilla2_1";
        weapons[] = { "CUP_arifle_AKM", "CUP_hgun_M9", "Throw", "Put" };
        respawnWeapons[] = { "CUP_arifle_AKM", "CUP_hgun_M9", "Throw", "Put" };
        Items[] = { "FAK" };
        RespawnItems[] = { "FAK" };
        magazines[] = { "CUP_30Rnd_762x39_AK47_M", "CUP_30Rnd_762x39_AK47_M", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        respawnMagazines[] = { "CUP_30Rnd_762x39_AK47_M", "CUP_30Rnd_762x39_AK47_M", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        linkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
        respawnLinkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
    };
    class I_Soldier3_EPOCH : I_Soldier_base_F
    {
        author = "$STR_A3_Bohemia_Interactive";
        _generalMacro = "I_Soldier3_EPOCH";
        scope = 2;
        displayName = "Epoch Militia Ghillie";
        cost = 90000;
        camouflage = 1.4;
        uniformClass = "U_I_GhillieSuit";
        weapons[] = { "CUP_srifle_DMR", "CUP_hgun_M9", "Throw", "Put" };
        respawnWeapons[] = { "CUP_srifle_DMR", "CUP_hgun_M9", "Throw", "Put" };
        Items[] = { "FAK" };
        RespawnItems[] = { "FAK" };
        magazines[] = { "CUP_20Rnd_762x51_DMR", "CUP_20Rnd_762x51_DMR", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        respawnMagazines[] = { "CUP_20Rnd_762x51_DMR", "CUP_20Rnd_762x51_DMR", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        linkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
        respawnLinkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
    };

I then added an include for this file at the bottom of my mission's description.ext as follows:

 

// Custom CfgEpochClient settings
    #include "epochz_config\CfgEpochClient.hpp"
    #include "epochz_config\CfgPricing.hpp"
    #include "epochz_config\CfgVehicles.hpp"
    #include "CfgEpochClient\Altis.hpp"

I re-PBOed the mission file with Eliteness, as per normal and uploaded back to the server. On restart though the server fails to start, the last lines in the RPT file being:

 

12:11:39 Attempt to override final function - rscunitinfo_script
12:11:39 Attempt to override final function - rscunitinfo_script
12:11:40 String STR_CUP_DN_FFAR not found
12:11:41 VoteThreshold must be in 0..1 range. Defaulting to 0.5
12:11:41 Initializing Steam server - Game Port: 2302, Steam Query Port: 2303

The rcsunitinfo lines are always in the RPT and there are a lot more of them that follow the loading of my server's mods. In a normal load, which happens if I remove the new include line, I should next see:

12:16:22 Attempt to override final function - rscunitinfo_script
12:16:22 Attempt to override final function - rscunitinfo_script
12:16:23 String STR_CUP_DN_FFAR not found
12:16:24 VoteThreshold must be in 0..1 range. Defaulting to 0.5
12:16:24 Initializing Steam server - Game Port: 2302, Steam Query Port: 2303
12:16:24 Starting mission:
12:16:24  Mission file: epoch (__cur_mp)
12:16:24  Mission world: Altis
12:16:24  Mission directory: mpmissions\__cur_mp.Altis\

Any help would be appreciated.

Cheers,

Grahame.
 

Edited by Grahame
Adding spoiler, I hope
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi there, Grahame.

Im pretty sure you cannot apply any new "object-oriented" classes, even on top of exisiting ones (base class). I dont remember the reference of that exactly, but i think its because core are not loading assets post-init. That includes CfgMagazines, CfgWeapons, CfgVehicles, etc.

Thats the reason why people develop .pbo mods.

Correct me if im wrong.

Link to comment
Share on other sites

  • 0

Thanks for the reply. I have subsequently used the search function (doh!) and see that this is a well-reported problem.

However, I'm glad I've brought it up again since it allows me to explore the issue further. Subsequent research on BI's forums suggested a possible workaround and I was wondering whether the following idea will work?

Basically I've created a new PBO (cup_ai.pbo) in @epochhive with the following config.cpp:

Spoiler

class CfgPatches
{
    class cup_ai
    {
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Characters_F","A3_epoch_config"};
    };
};
class CfgVehicles
{
    class I_Soldier_base_F;
    class I_Soldier_EPOCH : I_Soldier_base_F
    {
        author = "$STR_A3_Bohemia_Interactive";
        _generalMacro = "I_Soldier_EPOCH";
        scope = 2;
        displayName = "Epoch Militia Soldier";
        cost = 90000;
        camouflage = 1.2;
        uniformClass = "U_I_CombatUniform_shortsleeve";
        weapons[] = { "CUP_smg_MP5A5", "CUP_hgun_M9", "Throw", "Put" };
        respawnWeapons[] = { "CUP_smg_MP5A5", "CUP_hgun_M9", "Throw", "Put" };
        Items[] = { "FAK" };
        RespawnItems[] = { "FAK" };
        magazines[] = { "CUP_30Rnd_9x19_MP5", "CUP_30Rnd_9x19_MP5", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        respawnMagazines[] = { "CUP_30Rnd_9x19_MP5", "CUP_30Rnd_9x19_MP5", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        linkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
        respawnLinkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
    };
    class I_Soldier2_EPOCH : I_Soldier_base_F
    {
        author = "$STR_A3_Bohemia_Interactive";
        _generalMacro = "I_Soldier2_EPOCH";
        scope = 2;
        displayName = "Epoch Militia Guerilla";
        cost = 90000;
        camouflage = 1.2;
        uniformClass = "U_IG_Guerilla2_1";
        weapons[] = { "CUP_arifle_AKM", "CUP_hgun_M9", "Throw", "Put" };
        respawnWeapons[] = { "CUP_arifle_AKM", "CUP_hgun_M9", "Throw", "Put" };
        Items[] = { "FAK" };
        RespawnItems[] = { "FAK" };
        magazines[] = { "CUP_30Rnd_762x39_AK47_M", "CUP_30Rnd_762x39_AK47_M", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        respawnMagazines[] = { "CUP_30Rnd_762x39_AK47_M", "CUP_30Rnd_762x39_AK47_M", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        linkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
        respawnLinkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
    };
    class I_Soldier3_EPOCH : I_Soldier_base_F
    {
        author = "$STR_A3_Bohemia_Interactive";
        _generalMacro = "I_Soldier3_EPOCH";
        scope = 2;
        displayName = "Epoch Militia Ghillie";
        cost = 90000;
        camouflage = 1.4;
        uniformClass = "U_I_GhillieSuit";
        weapons[] = { "CUP_srifle_DMR", "CUP_hgun_M9", "Throw", "Put" };
        respawnWeapons[] = { "CUP_srifle_DMR", "CUP_hgun_M9", "Throw", "Put" };
        Items[] = { "FAK" };
        RespawnItems[] = { "FAK" };
        magazines[] = { "CUP_20Rnd_762x51_DMR", "CUP_20Rnd_762x51_DMR", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        respawnMagazines[] = { "CUP_20Rnd_762x51_DMR", "CUP_20Rnd_762x51_DMR", "CUP_15Rnd_9x19_M9", "CUP_15Rnd_9x19_M9" };
        linkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
        respawnLinkedItems[] = { "V_24_EPOCH", "H_89_EPOCH", "ItemMap", "ItemCompass", "ItemWatch", "EpochRadio0" };
    };
};

I also added cup_ai to the whitelisted patches just in case (not sure whether that was necessary...

Restarted server and everything seems to load okay. Won't be able to verify whether the militia AI classes have actually taken the changes until I get home tonight.

Anyone know whether I'm on the right track?

Cheers,

Grahame.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...