Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Twiznak

Adding Parameters to EOS

Recommended Posts

Hi everyone. I want to add multiplayer parameters to EOS. I have followed the example found @ https://community.bistudio.com/wiki/Arma_3_Mission_Parameters  

mission\description.ext

Spoiler

class params
{
    class  HGprob//1
    { 
        title = "House Groups Spawn Probability";
        values [] = {"25","50","75","100"};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  PGprob//2
    { 
        title = "Patrol Groups Spawn Probability";
        values [] = {"25","50","75","100"};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  APCprob//3
    { 
        title = "APC Spawn Probability";
        values [] = {"25","50","75","100"};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  Tankprob//4
    { 
        title = "Tank Spawn Probability";
        values [] = {"25","50","75","100"};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  SWprob//5
    { 
        title = "Static Weapon Spawn Probability";
        values [] = {"25","50","75","100"};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  ACHprob//6
    { 
        title = "Attack Helicopter Spawn Probability";
        values [] = {"25","50","75","100"};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  Daytime//7
    { 
        title = "Mission Start Time";
        values [] = {6,12,18,0};
        texts [] = {"Morning","Noon","Evening","Midnight"};
        default = 6;
    };
    class  AIskill//8
    { 
        title = "AI skill Level :: ASR_AI3 and/or VCOM_AI will override";
        values [] = {0,1,2};
        texts [] = {"Recruit","Regular","Veteran"};
        default = 1;
    };
};

 

 I have added params variables to EOS\OpenMe.sqf

Spoiler

null=[["marker_0"],[1,0,HGprob],[1,1,PGprob],[1,0,APCprob],[1,Tankprob],[1,SWprob],[1,0,ACHprob],[0,0,750,EAST,FALSE]] call EOS_Spawn;

 

And it doesn't work. I can't make sense of the error report because I don't know what I am doing. I think I have to list/define the params variables in EOS\Core\Eos_core.sqf & Eos_Launch.sqf but I dont know. I'm lost. Please help me.

Share this post


Link to post
Share on other sites

Hi David. Thanks for responding. In which file(s) would I gather the param values?

example:   

HGprob = ""HGprob" call BIS_fnc_getParamValue;

 

 

Share this post


Link to post
Share on other sites
null=[
    ["marker_0"],
    [1,0,"HGprob" call BIS_fnc_getParamValue],
    [1,1,"PGprob" call BIS_fnc_getParamValue],
    [1,0,"APCprob" call BIS_fnc_getParamValue],
    [1,"Tankprob" call BIS_fnc_getParamValue],
    [1,"SWprob" call BIS_fnc_getParamValue],
    [1,0,"ACHprob" call BIS_fnc_getParamValue],
    [0,0,750,EAST,FALSE]
] call EOS_Spawn;

 

  • Like 1

Share this post


Link to post
Share on other sites

Excellent, thank you. However, My params in the description.ext are off. I am getting this error message

Spoiler

16:51:31 Warning Message: File C:\Users\The\Documents\Arma 3 - Other Profiles\TWIZNAK\missions\EOS_PARAMS_TEST.VR\description.ext, line 5: '/params/HGprob.values': '[' encountered instead of '='
16:51:31 Warning Message: Config : some input after EndOfFile.
16:51:31 Class  destroyed with lock count 1
 

and in the logs there are a lot of these

Spoiler

Attempt to override final function - bis_""many ""

i have corrected my description.ext. I had erroneous quotation marks around the values. Would you please have a look and tell me what I did wrong? 

amended Description.ext

Spoiler

class params
{
    class  HGprob//1
    { 
        title = "House Groups Spawn Probability";
        values [] = {25,50,75,100};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  PGprob//2
    { 
        title = "Patrol Groups Spawn Probability";
        values [] = {25,50,75,100};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  APCprob//3
    { 
        title = "APC Spawn Probability";
        values [] = {25,50,75,100};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  Tankprob//4
    { 
        title = "Tank Spawn Probability";
        values [] = {25,50,75,100};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  SWprob//5
    { 
        title = "Static Weapon Spawn Probability";
        values [] = {25,50,75,100};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
    class  ACHprob//6
    { 
        title = "Attack Helicopter Spawn Probability";
        values [] = {25,50,75,100};
        texts [] = {"25%","50%","75%","100%"};
        default = 25;
    };
};

Thank you.

Share this post


Link to post
Share on other sites

try remove space betwean array definitions and entries

values []  =     --> values[] =

Share this post


Link to post
Share on other sites

I'm afraid that i do not exactly understand what you want to achieve.

But maybe this can lead you in right direction:

Some time ago  i created something similar to this using makros and definitions.hpp. in this case you only need to define things once, and include.

//defines.hpp
#define GVAR_PARAM(NUM)							(paramsArray select NUM)
#define GVAR_DYNAMICSIM 						([false,true] select GVAR_PARAM(2))	
#define GVAR_ESIDE 								([EAST,WEST,INDEPENDENT] select GVAR_PARAM(4))
#define GVAR_EFACTION 							(["OPF_F","OPF_G_F","OPF_T_F","OPF_V_F","BLU_F","BLU_G_F","BLU_GEN_F","BLU_T_F","IND_F","IND_C_F","IND_G_F"] select GVAR_PARAM(5))
...

//description.ext
class Params	{

	class DYNAMIC_SIMULATION {
		//GVAR_PARAM(2)
        title = "Enable arma dynamic simulation system";
        values[] = {0,1};
        texts[] = {"Disable","Enable"};
        default = 1;
	};
	class E_SIDE {
		//GVAR_PARAM(4)
        title = "Enemy Side";
        values[] = {0,1,2};
        texts[] = {"EAST","WEST","RESISTANCE"};
        default = 0; 	
	};
	
	class E_FACTION {
		//GVAR_PARAM(5)
        title = "Enemy Faction";
        values[] = {0,1,2,3,4,5,6,7,8,9,10};
        texts[] = {"OPF_F (EAST)","OPF_G_F (EAST)","OPF_T_F (EAST)","OPF_V_F (EAST)","BLU_F (WEST)","BLU_G_F (WEST)","BLU_GEN_F (WEST)","BLU_T_F (WEST)","IND_F (RESISTANCE)","IND_C_F (RESISTANCE)","IND_G_F (RESISTANCE)"};
		default = 2; 	
	};

	class E_MARKER_OA_SIZE {
		//GVAR_PARAM(35)
	    title = "OA marker size";
        values[] = {50,100,150,200,250,300,350,400,450,500};
        default = 300;
	};
	class E_PATROL_GROUPS_COUNT {
		//GVAR_PARAM(44)
        title = "Inf. patrol groups for each OA";
        values[] = {1,2,3,4,5,6};
        default = 3;
	};
	class E_PATROL_GROUP_UNITS_COUNT {
		//GVAR_PARAM(45)
        title = "Units of inf. patrol group";
        values[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
        default = 13;
	};
};

//script example

//MWF_fnc_patrolSpawn
#include "..\..\defines.hpp"
	params [["_marker","",[""]]];
	private ["_vehclasses","_group","_spawnPos"];
	
	if (E_PATROL_UNITS_CLASSES isEqualTo []) then {
		_vehclasses = [GVAR_EFACTION, "Man", "irrelevant", ["Unarmed", "SpecialOperative", "Crewman"]] call MWF_fnc_getClasses; 
	} else {
		_vehclasses = E_PATROL_UNITS_CLASSES;
	};
		
	for "_i" from 1 to GVAR_PARAM(44) do {

		_vehclasses = [_vehclasses, GVAR_PARAM(45)] call MWF_fnc_arrRandSeq;
		_spawnPos = [getMarkerPos _marker, 0, GVAR_PARAM(35)/2, 10, 0, 0, 0, [], []] call BIS_fnc_findSafePos; 
		_group = [_spawnPos, GVAR_ESIDE, _vehclasses] call BIS_fnc_spawnGroup;
		0 = [_group] spawn MWF_fnc_setEnemySkill;
		{
			0 = [_x] spawn MWF_fnc_enemyAddEh;
			_x addEventHandler ["Reloaded",{(_this select 0) addMagazine ((_this select 3) select 0)}];
		} forEach (units _group);
		0 = [_group, getMarkerPos _marker, GVAR_PARAM(35), 7, "MOVE", "AWARE", "YELLOW", "FULL", "STAG COLUMN", "this call CBA_fnc_searchNearby", [3,6,9]] call CBA_fnc_taskPatrol;
		if (GVAR_DYNAMICSIM) then {_group enableDynamicSimulation true};
	};

 

Share this post


Link to post
Share on other sites

:)

Edited by B_Armaholic_Z_F
it works!

Share this post


Link to post
Share on other sites
Quote

HOW do I define the factions in the definition.hpp?

i already gave you the example

(GVAR_PARAM(5))

GVAR_EFACTION

keep in mind that the missionparams array index starts from 0 like all arrays inherently

Share this post


Link to post
Share on other sites
6 hours ago, davidoss said:

i already gave you the example

(GVAR_PARAM(5))

GVAR_EFACTION

keep in mind that the missionparams array index starts from 0 like all arrays inherently

Yes you did, i'm sorry. I have been playing with it all day and I have a solution. You pointed me in the right direction. You have helped me in the past as well. Thank you very much Davidoss. You rock!

Share this post


Link to post
Share on other sites

×