This AI is still in early stages of development.
out.ASSERT
- Aubergine
Notes
This requires the hackAssert() function in Warzone 3.2 or above. If that function is not available, it will fall back to just throwing a Javascript error which will still be logged but won't cause a game assert.
The value of config will be evaluated to determine if it is truthy or falsey:
- truthy – nothing will happen, the game will continue as normal
- falsey – a 'game assert' is thrown, followed by a Javascript Error
When a 'game assert' is thrown, a game error will be logged. If a debugger is connected to the game, Warzone will halt and allow you to inspect game state via the debugger, otherwise the game will continue.
If the (optional) self parameter is specified, the message associated with the assertion will be prefixed with the filename and version defined in the Self Descriptor Object.
Example
out("This should be true", null, out.ASSERT, true); // does nothing out("This should be true", null, out.ASSERT, false); // throws game assert & JS error
Availability STABLE
Requires:
- Warzone 3.2 or above
- Util API
Reverts to out.ERROR on earlier versions of Warzone.
See also
Related constants:
- 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.CONSOLE — Output message to console().
- out.DEBUG — Output message to debug().
- out.DEFAULT — Outputs the message via out.HOST or out.CONSOLE depending on Warzone version.
- out.ERROR — Outputs the message as an exception.
- out.HOST — Outputs the message to the game host via in-game chat .
- out.RETURN — Returns the message to the calling script.