Fr3eMan 16 Posted February 25, 2019 Hi all! I'm trying to implement a script for automatic selection of mod in game. The mission normally have to start on vanilla version, but in case of server is starting with some specific mod, automatically the mission select/convert the vanilla objects to the mod objects. I know some scripters already implement some different solutions in their own mission, but my question is if already exist a customizable script tamplate, easy to implement in a custom mission. In case do not already exist a customizable template , anybody has any suggestion for the best solution to implement? 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 Hello there Fr3eMan ! It's possible to do this , but what exacly you want to succeed ? Spawn obects , units ? Write more about what exacly application the script will have . 1 Share this post Link to post Share on other sites
Fr3eMan 16 Posted February 25, 2019 Have to work for arsenal objects, units, vehicles and also groups. For example, on mission start the initialization feel the presence of activated mod on server side, the script check the kind of mods present and on base a specific priority list or selected on start mission by the player, the script start the mission spawning the objects selected(arsenal objects, unit, vehicles or groups). So the arsenal object with classlist name "arifle_MX_F" (vanilla) have to be substitute with the class object "rhs_weap_m16a4" (RHSUSAF mod), and so on for unit, vehicles and groups. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 4 minutes ago, Fr3eMan said: So the arsenal object with classlist name "arifle_MX_F" (vanilla) have to be substitute with the class object "rhs_weap_m16a4" (RHSUSAF mod), and so on for unit, vehicles and groups. Mod detection : You can use this code and add your code where instead : whitelisted Arsenal : For the spawned units , it's about the spawn script that you are using. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 But what exacly will be with the mission that you want , are you using a spawn script and which ? Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 30 minutes ago, GEORGE FLOROS GR said: Mod detection : in the initServer.sqf Share this post Link to post Share on other sites
Spatsiba 89 Posted February 25, 2019 Something like private _units = [Class1, class2, class3]; if (isClass(configfile >> "CfgPatches" >> "cool_infantry")) then { //Find this one in the config for the mod you're using _units = [cool_class1, cool_class2, cool_class3]; }; Share this post Link to post Share on other sites
Fr3eMan 16 Posted February 25, 2019 1 hour ago, GEORGE FLOROS GR said: But what exacly will be with the mission that you want , are you using a spawn script and which ? I check your code GF_Mod_Check and I understand that working with the check of configfile check, and i suppose is the most simple solution for activate the mod filter. So adding the code in the initServer.sqf if I also insert some arrays connected with the different mod classlist to be called on the virtual arsenal when spawn on map. In the same way will change the vanilla classlist objets/groups with mod classlist objets/groups. 1 hour ago, GEORGE FLOROS GR said: whitelisted Arsenal : I usually spawn by script the arsenal in game 😉 Recently I created a function for this use in game (is under testing). 31 minutes ago, Spatsiba said: Something like private _units = [Class1, class2, class3]; if (isClass(configfile >> "CfgPatches" >> "cool_infantry")) then { //Find this one in the config for the mod you're using _units = [cool_class1, cool_class2, cool_class3]; }; I think so. 1 Share this post Link to post Share on other sites
Fr3eMan 16 Posted February 25, 2019 One of the most useful sample I find is that is implemented on KP Liberation , in the kp_liberation_config.sqf are defined the lists of objects to be spawn in base of the mod presence, than the functions F_checkClass.sqf and F_filterMods.sqf select the spawning objects in game. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 3 minutes ago, Fr3eMan said: implemented on KP Liberation I don't know about the KP Liberation , but as i see it's already this implemented. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 Is this mission that you want to work with or just for an example ? Share this post Link to post Share on other sites
Fr3eMan 16 Posted February 25, 2019 Just now, GEORGE FLOROS GR said: Is this mission that you want to work with or just for an example ? Just a sample, this already work... My starting question was if already exiting a script template mission shared in the community with this implementation. Before starting to write form zero a script, I want to be sure anybody else alredy did and I than can use it. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 I have a new script that is an atomatic spawner system and by the way it's about to update . There are a lot of scipts , easy to read and reedit with a lot of examples and it is also very easy to add custom classnames in order to use different mod . So you can combne with the Mod Check and all together. Check here if you want : Just if you do like the scripts , hold on also for the update , because there will be in the code some major fixes. 1 Share this post Link to post Share on other sites
Fr3eMan 16 Posted February 25, 2019 7 minutes ago, GEORGE FLOROS GR said: I have a new script that is an atomatic spawner system and by the way it's about to update . There are a lot of scipts , easy to read and reedit with a lot of examples and it is also very easy to add custom classnames in order to use different mod . So you can combne with the Mod Check and all together. Working also with arsenal objects? Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 36 minutes ago, Fr3eMan said: Working also with arsenal objects? The script is an automatic Unit spawner. It's not a mission. Share this post Link to post Share on other sites
Fr3eMan 16 Posted February 26, 2019 8 hours ago, GEORGE FLOROS GR said: The script is an automatic Unit spawner. It's not a mission. Ok is just units spawner. Share this post Link to post Share on other sites
gc8 977 Posted February 26, 2019 I'm doing the same thing for my mission where I want the vanilla (or Apex) stuff replaced by some mod like RHS, unsung, etc. The way I did this for static weapons was that I put all the weapons each in their own category. Then if I want let's say "Gun1" to be replaced with "Gun1_RHS" I look for the category of Gun1 and then I can replace that with the gun from same category but from different mod. Not sure if I explained that clearly , maybe it's just better to show example how I registered the guns in classes: Spoiler class CtiStaticWeaponsApex { class east { class HmgHigh { class O_HMG_01_high_F {}; }; class HmgLow { class O_HMG_01_F {}; class O_HMG_01_A_F {}; }; class HgmgHigh { class O_GMG_01_high_F {}; }; class Hgmg { class O_GMG_01_F {}; class O_GMG_01_A_F {}; }; class ATHigh { class O_static_AT_F {}; }; class AAHigh { class O_static_AA_F {}; }; }; class west { class HmgHigh { class B_HMG_01_high_F {}; }; class HmgLow { class B_HMG_01_F {}; class B_T_HMG_01_F {}; }; class HgmgHigh { class B_GMG_01_high_F {}; }; class Hgmg { class B_GMG_01_F {}; class B_GMG_01_A_F {}; }; class ATHigh { class B_static_AT_F {}; class B_T_Static_AT_F {}; }; class AAHigh { class B_static_AA_F {}; class B_T_Static_AA_F {}; }; }; class guer { class HmgHigh { class I_HMG_01_high_F {}; }; class HmgLow { class I_HMG_01_F {}; class I_HMG_01_A_F {}; }; class HgmgHigh { class I_GMG_01_high_F {}; }; class Hgmg { class I_GMG_01_F {}; class I_GMG_01_A_F {}; }; class ATHigh { class I_static_AT_F {}; }; class AAHigh { class I_static_AA_F {}; }; }; }; Then if I want "I_HMG_01_F" to be replaced I just get the category of "I_HMG_01_F" from mod A (HmgLow) and replace it from same category (HmgLow) from mod B Hope that helps 1 Share this post Link to post Share on other sites