AI Skill Selector (A&D)

From F2 EN
Jump to: navigation, search

Description

Two selectors are made available in the mission parameters screen that allows players to change the relative skill levels of BLUFOR and OPFOR AI units.

Required files

All the code associated with this component is found in:

  • description.ext
  • init.sqf
  • stringtable.xml
  • f\common\f_setLocalVars.sqf
  • f\common\f_processParamsArray.sqf
  • f\common\f_setAISkillAD.sqf

How to activate

Open the file init.sqf and look for the code segment entitled:

// F2 - AI Skill Selector (A&D)

Edit the following lines, removing the // at the start of each line:

// f_isFriendlyToBLU_RES = 1;
// f_isFriendlyToBLU_CIV = 1;
// [] execVM "f\common\f_setAISkillAD.sqf";

Open the file description.ext and look for the code segment entitled:

// F2 - AI Skill Selector (A&D)

Edit the following lines, removing the // at the start of each line:

// class f_param_AISkill_BLUFOR
// {
// title = "$STR_f_param_AISkill_BLUFOR";
// values[] = {0,1,2,3};
// texts[] = {$STR_f_param_AISkill_Option0 ...
// default = 2;
// code = "f_param_AISkill_BLUFOR = %1";
// };
// class f_param_AISkill_OPFOR
// {
// title = "$STR_f_param_AISkill_OPFOR";
// values[] = {0,1,2,3};
// texts[] = {$STR_f_param_AISkill_Option0 ...
// default = 2;
// code = "f_param_AISkill_OPFOR = %1";
// };

How to use

Available options: BLUFOR AI

By default, the following BLUFOR AI skill options are available:

OptionBLUFOR AI Skill
0Super
1High
2Medium
3Low

Available options: OPFOR AI

By default, the following OPFOR AI skill options are available:

OptionOPFOR AI Skill
0Super
1High
2Medium
3Low

Default selections

The default selections are Medium and Medium.

Changing the default selection: BLUFOR AI

Open the file description.ext and look for the following lines:

class f_param_AISkill_BLUFOR
{
title = "$STR_f_param_AISkill_BLUFOR";
values[] = {0,1,2,3};
texts[] = {$STR_f_param_AISkill_Option0 ...
default = 2;
code = "f_param_AISkill_BLUFOR = %1";
};

Change the value of default to the desired option number (see table above).

Changing the default selection: OPFOR AI

Open the file description.ext and look for the following lines:

class f_param_AISkill_OPFOR
{
title = "$STR_f_param_AISkill_OPFOR";
values[] = {0,1,2,3};
texts[] = {$STR_f_param_AISkill_Option0 ...
default = 2;
code = "f_param_AISkill_OPFOR = %1";
};

Change the value of default to the desired option number (see table above).

Making Independent and/or Civilian sides friendly to OPFOR

The Independent and Civilian sides are defined as friendly or enemy to BLUFOR using two lines in the init.sqf file. The default option is for both sides to to be friendly to BLUFOR. To change the friendly and enemy designations for the Independent and Civilian sides open the file init.sqf and look for the code segment entitled:

// F2 - AI Skill Selector (A&D)

To make the Independent side friendly to OPFOR edit the following line, changing the value f_isFriendlyToBLU_RES to 0 if you want it to be an enemy of BLUFOR, or 1 if you want it to be friendly:

f_isFriendlyToBLU_RES = 1;

To make the Civilian side friendly to OPFOR edit the following line, changing the value f_isFriendlyToBLU_CIV to 0 if you want it to be an enemy of BLUFOR, or 1 if you want it to be friendly:

f_isFriendlyToBLU_CIV = 1;

Setting the skill of dynamically generated units

A key limitation of this component is that it cannot automatically set the skill level of units which are created dynamically during the mission (for example, if you use a script to generate enemies or civilians dynamically). However, you can ensure that the skill level of any dynamically created units is set according to the same level as other units on their side by inserting some code in their Init: line. The code required is different for each side:

SideCode for Init: line
West (USMC, CDF)this setSkill f_skillBLU;
Independent (NAPA)this setSkill f_skillRES;
East (Russian, ChDKZ)this setSkill f_skillOPF;
Civilian (Chernarus, Russia)this setSkill f_skillCIV;

Tips

  • The options have also been translated into English, Czech, German, Polish, Spanish, French and Russian (using text strings contained in the file stringtable.xml); players using copies of ArmA2 released in those languages will automatically see the options in translated form.

Credits

  • Wolf
  • Headspace
  • Fer
  • Messiah2
  • white angel
  • Mike84
  • Donnervogel (translator)
  • Serclaes (translator)
  • Messiah2 (translator)
  • Gaia (translator)
  • FireflyPL (translator)
  • Kanotson (translator)
  • Varry (translator)