Open MajorBarf opened 2 years ago
Hi,
Factions also need to be included in CfgFactions.cpp. Take a look at that file and follow the same pattern with your new faction.
To create a dependency for a faction you need to add a patches
array to the config. Take a look at this example. The variables in this list must be variables that exist in the mod the faction depends on. You can find them using the config viewer.
Thanks for the quick response, but I have already done that as you can see below. (Sorry, I typed "config\factions.cpp" in the original issue when I actually meant "config\CfgFactions.cpp")
The other things I had to guess in the faction file I originally posted was the "addon" and "era" settings at the top. "WS" is the folder in which the Western Sahara extension installs itself (where all the ebo & bisign files are) so I asume that is what goes in the "addon" value. The "era" one is guess because that is what the NATO, FIA etc. factions use and they show up OK.
Thanks for any help you can provide.
/* Copyright (C) 2018 D. Ottavio
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
<https://www.gnu.org/licenses/>.
*/
class CfgFactions {
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
};
Ah, I think the issue is you don't have patches
defined. This is used to determine if the addon/mod is loaded. Factions are only included if all the config variables defined in patches
are loaded. Take look at the example I posted above.
Thanks for your prompt reply. So I started the Combat Den scenario and found my way to the "CfgFactionClasses" section in the config viewer. There was an entry in there called "IND_TURA_lxWS" (as well as "BLU_TURA_lxWS" & "OPFOR_TURA_lxWS") with the following values against it:
displayName = "Tura"; flag = "\lxws\data_f_lxws\img\Flags\flag_Argana_CO.paa"; icon = "\lxws\data_f_lxws\img\ui\cfgFactionClasses_Tura_ca.paa"; priority = 3; side = 2;
So I amended my cpp file so that it starts like this:
class Tura : Faction { name = "Tura"; side = SIDE_GUER; addon = "WS"; patches[] = { "IND_TURA_lxWS" }; era = ERA_2034; ammoBox = "Box_IND_Ammo_F"; cargoBox = "I_CargoNet_01_ammo_F"; climateDenyList[] = { "Tropic","Wood","Winter" }; flagTexture = "\lxws\data_f_lxws\img\Flags\flag_Argana_CO.paa"; fullMoonOnly = 1;
But I am still not having any luck with this. After each change, I've closed Arma and the launcher, deleted the mission folder and rebuilt it using "build.py". I then restart Arma, select the scenario and it opens the CBA_A3 screen where I click on "configure addons". The faction selection dropdowns only show Random, NATO, CSAT etc., not the Tura.
There is an entry in the config viewer for "CfgAddons", which then had "PreloadAddons" and below that "A3_lxWS" with the following value. Should I be using one or more of the values here? list[] = {"Characters_f_lxWS","Characters_f_lxWS_headgear","data_f_lxWS","dubbing_F_lxWS","EditorPreviews_F_lxWS","functions_f_lxWS","Language_f_lxWS","Missions_F_lxWS","Missions_F_lxWS_Data","Missions_F_lxWS_Video","animals_f_lxWS","animals_F_lxWS_camel","anims_F_lxWS","music_f_lxWS","Rocks_F_lxWS","Shield_F_lxWS","sounds_f_lxWS","structures_F_lxWS","structures_F_lxWS_Civ","structures_F_lxWS_Civ_InfoBoards","structures_F_lxWS_Commercial","structures_F_lxWS_Cultural","structures_F_lxWS_Cultural_Fortress","structures_F_lxWS_Cultural_Statues","structures_F_lxWS_Decals","structures_F_lxWS_Decals_Horizontal","structures_F_lxWS_Furniture","structures_F_lxWS_Furniture_A2","structures_F_lxWS_Furniture_Misc","structures_F_lxWS_HouseA","structures_F_lxWS_HouseC","structures_F_lxWS_HouseK","structures_F_lxWS_HouseL","structures_F_lxWS_Industrial","structures_F_lxWS_Industrial_Agriculture","structures_F_lxWS_Industrial_Mining","structures_F_lxWS_Items","structures_F_lxWS_Items_Food","structures_F_lxWS_Items_Misc","structures_F_lxWS_Mil","structures_F_lxWS_Mil_Fortificaton","structures_F_lxWS_Misc","structures_F_lxWS_Misc_Powerlines","structures_F_lxWS_Misc_Runways","structures_F_lxWS_Pavements","structures_F_lxWS_Rail","structures_F_lxWS_Tents","structures_F_lxWS_Tower","Vegetation_F_lxWS","Vehicles_F_lxWS","Vehicles_F_lxWS_APC_Wheeled_01","Vehicles_F_lxWS_Offroad_01","Vehicles_F_lxWS_Truck_02","Vehicles_F_lxWS_zu23","walls_f_lxWS","walls_f_lxWS_PalmFence","Weapons_F_lxWS","Weapons_F_lxWS_Ammoboxes","Weapons_F_lxWS_Camera","Weapons_F_lxWS_Rifles","Air_F_lxWS","Air_F_lxWS_Heli_Light_02","map_wsahara_data_lxWS","map_wsahara_data_layers_lxWS","map_wsahara_lxWS","map_wsahara_scenes_f_lxWS"};
Sorry if I am being incredibly stupid, but I am obviously missing something here! I did wonder about the "era" but because that is what the standard factions use, it seems like the right value. I have also tried "fullMoonOnly" with both 0 and 1 in case that makes any difference.
Which terrain are you loading the faction into? I would try removing the climateDeny
list to make sure you're not trying to start the faction in one of those terrains.
The factions are loaded from this function. You can add some logging to this function to see if you're hitting any that is blocking your new faction from being loaded.
One other thing you can try is take an existing faction and create a copy of it with a new name and see that works. For example, take AAF config create a copy and rename the class to Aaf2 and `name = "AAF2". Reload, and see if that duplicate faction shows up in Altis. If you can load this duplicate faction then you can probably rule out there is something about your setup causing the issue and it's just your config.
I'm using the Western Sahara DLC that was recently issued by Rotators Collective and sold through Bohemia. It's a desert so I can't see it being anything but "Arid". I've tried removing the climateDeny as you suggested but that doesn't make any difference.
I've also done a copy of the FIA faction, called it FIA2 and changed the faction name. Then added it to the CfgFactions.cpp and rebuilt the scenario. It doesn't show up in the list.
I'll try doing some logging and get back to you with the results. Thanks.
I've successfully added the Sefrou Ramal terrain (from the Western Sahara extension) as per your guide on the wiki. But I am having problems adding the Tura from that extension as a new faction. Using the existing faction cpp files as examples, I constructed the attached file and added it to the config\factions.cpp. But when I start the scenario, this does not show as one of the factions in the settings. There is just the standard NATO, CSAT, AAF, FIA & random choices.
I'll admit that this is all new to me, so I may be missing something obvious. Please can you take a look? If I can get this working, I'd like to do an ION faction. And then I'd like to move onto Madrigal from the Operation Trebuchet mod and add some Halo factions (which then means asking how you declare dependencies in these files?).
/* Copyright (C) 2019 D. Ottavio
*/
class Tura : Faction { addon = "WS"; ammoBox = "Box_IND_Ammo_F"; cargoBox = "I_CargoNet_01_ammo_F"; climateDenyList[] = { "Tropic", "Wood", "Winter" }; era = ERA_2034; flagTexture = "\A3\Data_F\Flags\Flag_Green_CO.paa"; fullMoonOnly = 1; name = "Tura"; side = SIDE_GUER;
};