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

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "</syntaxhighlight> === Arma 2: Operation Arrowhead - multiple mission parameters configuration === Starting rev.72235 (22.7.2010) the Operation Arrowhead should be able not on...")
 
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
</syntaxhighlight>
=== {{arma2oa}} - multiple mission parameters configuration ===
=== 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.
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.
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.


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


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


class Params  
class Params
{
{
class Name
class Name
{
{
title = "Secretary name";
title = "Secretary name";
values[] = {0, 1, 2, 3};
values[] = { 0, 1, 2, 3 };
texts[] = {"Iveta", "Mila", "Misa", "Bara"};
texts[] = { "Iveta", "Mila", "Misa", "Bara" };
default = 3;
default = 3;
};
};
Line 44: Line 44:
</syntaxhighlight>
</syntaxhighlight>


Inside ''server.cfg'' one can define the <tt>param1</tt> and <tt>param2</tt> values along with new, named parameters inside ''class Params'', using each parameter ''class name'' to assign the corresponding parameter the value.
Inside ''server.cfg'' one can define the {{hl|param1}} and {{hl|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 :) ).
:The '''paramsArray''' cannot be used inside ''server.cfg'' config file (or you can use it, but the engine will not read it :) ).
<syntaxhighlight lang="c">
<syntaxhighlight lang="cpp">
class Missions
class Missions
{
{
Line 52: Line 52:
{
{
template = "parametersTest.Desert_E"; // omit the .pbo suffix
template = "parametersTest.Desert_E"; // omit the .pbo suffix
difficulty = "regular"; // difficulty: recruit, regular, veteran & mercenary as specified in *.Arma2profile
difficulty = "regular"; // difficulty: recruit, regular, veteran & mercenary as specified in *.Arma2profile
param1 = 2; // dress
param1 = 2; // dress
param2 = 26; // age
param2 = 26; // age
class Params
class Params
{
{
Line 64: Line 64:
};
};
</syntaxhighlight>
</syntaxhighlight>
== See Also ==
* [[Arma 3: Server Config File|server config]]
* [[ArmA: Server configuration|Server Configuration]]
* [[Armed Assault:Dedicated Server]]
* [[ArmA: Server Side Scripting]]
* [[Operation Flashpoint: Dedicated Server]]
* [[Arma 3: Headless Client]]
* [[Arma 3: Server Security]]
* [[Arma 3: Mission voting]]
* [[Arma: Mission rotation]]
* [[Arma 2 Mission Rotation]]
[[Category:Arma 2: Multiplayer|Server.cfg]]

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