Jump to content
johnnyboy

How to add options/parameters to a mod?

Recommended Posts

I googled this for about 30 minutes and couldn't find a clean step-by-step answer to this.  I think it might require CBA.

Can anyone point me to a clean guide of how to define parameters that allow players to set mod options before running a mission?

I was hoping it was like defining Params in a mission's description.ext, but in the config.cpp instead, but that did not work for me.

 

SOLVED.  I put this code in my mod's init.sqf to use CBA for setting mod options:

// **********************************************************************
// Set global vars based on CBA parameters
// **********************************************************************
missionNameSpace setVariable ["jboy_maxRevivesPerAI",99];
if (getLoadedModsInfo select {_x #1 find "@CBA_A3" >= 0} isNotEqualTo []) then
{
	["jboy_maxRevivesPerAI", "LIST", "Max Revives Per AI unit", "SOG AI", [[5,4,3,2,1,0], ["5", "4", "3", "2", "1", "0"]], 1] call cba_settings_fnc_init;
};

Read the heading of the cba_settings_fnc_init function here to see how to define the parameters and sample calls:

https://github.com/CBATeam/CBA_A3/blob/master/addons/settings/fnc_init.sqf

Share this post


Link to post
Share on other sites

CBA definitely is a good framework for making your own custom addon settings that could be changed server-, mission- and client-side, here's official documentation on that: https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System

 

To my understanding, you would have to set up a bunch of "Server" settings that can be configured on dedicated server or by host.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks @honger I solved this using CBA, thanks to the help of the brilliant @madrussian.  Top post is now updated with the solution.

  • Like 2

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

×