Arma 2 OA: Multiple Mission Parameters Configuration: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "server.cfg" to "server config")
 
Line 72: Line 72:
* [[Armed Assault:Dedicated Server]]
* [[Armed Assault:Dedicated Server]]
* [[ArmA: Server Side Scripting]]
* [[ArmA: Server Side Scripting]]
* [[Operation Flashpoint:Dedicated Server]]
* [[Operation Flashpoint: Dedicated Server]]
* [[Arma 3: Headless Client]]
* [[Arma 3: Headless Client]]
* [[Arma 3: Server Security]]
* [[Arma 3: Server Security]]

Latest revision as of 17:29, 26 July 2024

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 will not 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