AI Skill Selector (coop)

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 friendly and enemy AI units.

Required files

All the code associated with this component is found in:

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

How to activate

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

// F2 - AI Skill Selector (coop)

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

// f_isFriendlyBLU = 1;
// f_isFriendlyRES = 1;
// f_isFriendlyOPF = 0;
// f_isFriendlyCIV = 1;
// [] execVM "f\common\f_setAISkill.sqf";

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

// F2 - AI Skill Selector (coop)

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

// class f_param_AISkill_Friendly
// {
// title = "$STR_f_param_AISkill_Friendly";
// values[] = {0,1,2,3};
// texts[] = {$STR_f_param_AISkill_Option0 ...
// default = 2;
// code = "f_param_AISkill_Friendly = %1";
// };
// class f_param_AISkill_Enemy
// {
// title = "$STR_f_param_AISkill_Enemy";
// values[] = {0,1,2,3};
// texts[] = {$STR_f_param_AISkill_Option0 ...
// default = 2;
// code = "f_param_AISkill_Enemy = %1";
// };

How to use

Available options: Friendly AI

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

OptionFriendly AI Skill
0Super
1High
2Medium
3Low

Available options: Enemy AI

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

OptionEnemy AI Skill
0Super
1High
2Medium
3Low

Default selections

The default selections are Medium and Medium.

Changing the default selection: Friendly AI

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

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

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

Changing the default selection: Enemy AI

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

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

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

Changing which side is friendly

To change the friendly and enemy designations for each side open the file init.sqf and look for the code segment entitled:

// F2 - AI Skill Selector (coop)

Edit the following line, changing the value f_isFriendlyBLU to 1 if you want the side west to be friendly, or 0 if you want west to be enemy:

f_isFriendlyBLU = 1;

Repeat this step for the variables f_isFriendlyRES (the resistance side), f_isFriendlyOPF (the east side) and f_isFriendlyCIV (the civilian side).

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)