Mission Parameters – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "Category:Arma 3: Editing Server admin / host can customize multiplayer missions in ROLE ASSIGNMENT menu using parameters prepared by the mission designer. == Manual Para...")
 
m (Fix category)
 
(65 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Category:Arma 3: Editing]]
#REDIRECT [[Mission Parameters]]
 
Server admin / host can customize multiplayer missions in ROLE ASSIGNMENT menu using parameters prepared by the mission designer.
 
== Manual Params ==
Params are defined in [[description.ext]].
class Params
{
class AISkill
{
title = "AI Skill"; {{codecomment|// Param name visible in the list}}
values[] = {0.2,0.6,1}; {{codecomment|// Description of each selectable item}}
texts[] = {"Recruit","Regular","Veteran"}; {{codecomment|// Item values, can be only integers; the array has to have the same number of elements as 'texts'}}
default = 0.6; {{codecomment|// Default value; must be listed in 'values' array, otherwise 0 is used}}
};
class Daytime
{
title = "Time";
texts[] = {"Morning","Day","Evening","Night"};
values[] = {6,12,18,0};
default = 12;
function = "BIS_fnc_paramDaytime"; {{codecomment|// (Optional) [[Functions_Library_(Arma_3)|Function]] [[call]]ed upon mission start, selected value is passed as an argument}}
};
class ViewDistance
{
title = "View distance (in metres)";
values[] = {500,1000,2000,5000};
{{codecomment|// When 'texts' are missing, values will be displayed directly instead}}
default = 1000;
file = "setViewDistance.sqf"; {{codecomment|// (Optional) Script [[call]]ed upon mission start, selected value is passed as an argument}}
};
};
 
Selected values are stored in '''paramsArray''' array, accessible anytime during the mission on any connected computer. Their order is the same as is in description.cfg (for example, params above would result in [12,1] if default values were kept).
 
'''Example (can be used in [[init.sqf]]):'''
if ([[isServer]]) then {
_skill = paramsArray [[select]] 0;
{
_x [[setSkill]] _skill;
} [[forEach]] [[allUnits]];
};
 
'''setViewDistance.sqf:'''
[[setViewDistance]] ([[_this]] select 0);
 
 
 
== Predefined Params ==

Latest revision as of 23:21, 24 June 2022

Redirect to: