Arma 2 OA: Multiple Mission Parameters Configuration

From Bohemia Interactive Community
Revision as of 19:04, 27 April 2018 by KC Grimes (talk | contribs) (Remove incorrect category of ArmA: Multiplayer)
Jump to navigation Jump to search

</syntaxhighlight>

Arma 2: Operation Arrowhead - multiple mission parameters configuration

Starting rev.72235 (22.7.2010) the Operation Arrowhead should be able not only to use multiple mission parameters, but also configure their defaults in server.cfg config file.

Below is a short example of how it was tested when implemented. Feel free to rewrite this part of article, as I only want to stop speculations how these parameters are to be configured. This should be considered as a documentation just after implementation.

// description.ext file: definition of parameters with their defaults. 
// These default values can be overwritten in the server.cfg, as shown in the following list
titleParam1 = "Secretary dress";
valuesParam1[] = {0, 1, 2, 3};
defValueParam1 = 0;
textsParam1[] = {"Bikini", "Miniskirt", "Tunic", "Jeans"};

titleParam2 = "Secretary age";
valuesParam2[] = {18, 20, 26, 30, 35, 80};
defValueParam2 = 26;
textsParam2[] = {"18", "20", "26", "30", "35", "Baba Jaga"};

class Params 
{
	class Name
	{
		title = "Secretary name";
		values[] = {0, 1, 2, 3};
		texts[] = {"Iveta", "Mila", "Misa", "Bara"};
		default = 3;
	};
	class WorkPlace
	{
		title = "Secretary place";
		values[] = {0, 1};
		texts[] = {"Prague","Mnisek"};
		default = 1;
	};
	class Friend
	{
		title = "Her friend"
		values[] = {0, 1};
		texts[] = {"None","Bebul"};
		default = 1;
	};
};

Inside server.cfg one can define the param1 and param2 values along with new, named parameters inside class Params, using each parameter class name to assign the corresponding parameter the value.

The paramsArray cannot be used inside server.cfg config file (or you can use it, but the engine has never read it :) ).
class Missions
{
	class CanBeAnything // name for the mission, can be anything
	{
		template = "parametersTest.Desert_E";	// omit the .pbo suffix
		difficulty = "regular";			// difficulty: recruit, regular, veteran & mercenary as specified in *.Arma2profile
		param1 = 2;				// dress
		param2 = 26;				// age
		class Params
		{
			Name = 2;
			WorkPlace = 0;
			Friend = 1;
		};
	};
};

See Also