This AI is still in early stages of development.
difficultyScale()
- Aubergine
Owned by Aubergine
Select a value based on difficulty level...
Syntax
var value = difficultyScale( easy, medium[, hard[, insane]] );
Parameters
Parameter | Type | Mandatory | Notes | API Version | |
---|---|---|---|---|---|
easy | Variant | The value to use for EASY difficulty. | 1.12 | ||
medium | Variant | The value to use for MEDIUM difficulty. | 1.12 | ||
hard | Variant | The value to use for HARD difficulty. Default: medium value | 1.12 | ||
insane | Variant | The value to use for INSANE difficulty. Default: hard value | 1.12 |
Return value
Value | Type | Notes | API Version |
---|---|---|---|
<value> | Variant | The value associated with the scripts difficulty setting. | 1.12 |
<error> | Error | Mandatory parameters missing, or difficulty setting not recognised. | 1.12 |
Example
Display current difficulty in console
console( "Difficulty: " + difficultyScale( "Easy", "Medium", "Hard", "Insane" ) );
Set different mission time limit depending on difficulty setting
setMissionTime( difficultyScale( 10, 7, 5, 4 ) * MINS );
Contents
Jump to:
See also
Related articles:
- difficulty – JS API global that defines difficulty associated with your script or current game
- Difficulty Levels – summary of difficulty levels for campaign vs. other game modes
Globals
Topics:
- Native — Allows access to JS API natives that have been replaced or removed by the Define API...
- toArray() — Convert an array-like object in to an array...
- now — Return current universal time expressed as milliseconds since midnight, January 1, 1970.
- out() — Message output handler.
- out.HOST — Outputs the message to the game host via in-game chat .
- out.DEFAULT — Outputs the message via out.HOST or out.CONSOLE depending on Warzone version.
- out.ERROR — Outputs the message as an exception.
- out.DEBUG — Output message to debug().
- out.CONSOLE — Output message to console().
- out.ASSERT — Asserts whether config is truthy, and if not throws a game assert and a Javascript error...
- out.CHAT — Outputs the message to allies of the script player via in-game chat.
- out.RETURN — Returns the message to the calling script.
- difficultyScale() — Select a value based on difficulty level...
- global — A global reference to the global object...