Page MenuHomeFeedback Tracker

createUnit (array) creates AI with skill 1 by default
Closed, ResolvedPublic


createUnit (array) always creates AI units with skill 1, which is not a sane default.

I suggest it should use editor default 0.5 or use a random value between 0.1 and 1. {F21377}


Legacy ID
Steps To Reproduce

Run attached repro mission; skill is hint'ed.

Event Timeline

Fireball edited Additional Information. (Show Details)
Fireball set Category to Scripting.
Fireball set Reproducibility to Always.
Fireball set Severity to None.
Fireball set Resolution to Fixed.
Fireball set Legacy ID to 2364644491.May 7 2016, 3:59 PM

"I suggest it should use editor default 0.5 or use a random value between 0.1 and 1."

I think it is more rational to default to editor. A random value can lead to confusion imo.

Or apply another parameter for mission designers so it will be set while calling the function.

The parameter is difficulty setting. AI skill should be set according to difficulty in configure -> game -> difficulty -> AI unit skill

It is all there no need to reinvent the wheel.

not sure if still valid (not reason to think otherwise)

"Note: Currently, the precision is derived from a skill as follows:

precision = skill*1.8-0.8

The result is clamped into 0.1 ... 1.0 range.

(The "skill" here is the combined skill which is a result of a unit skill as given in the editor and the skill given in the difficulty settings.)

Precision affects AI abilities aimingAccuracy and aimingShake, all other abililities (including aimingSpeed) are affected by a skill (see" - Suma
2y ago (here -

basically meaning we should consider the value defined by the player via difficulty menu different from the one set for a mission in editor. I think it is reasonable for the mission editor dinamically spawning a unit to assume an editor skill which will likewise be further modified by player settings.

(in any case Bohemia as revealed in the forum they are addressing this issue supposedly in a wider form)

oukej added a subscriber: oukej.May 7 2016, 3:59 PM

Mass-closing resolved issues updated only last year - assuming fixed correctly.