Code

From Bohemia Interactive Community
Revision as of 17:38, 2 March 2026 by Lou Montana (talk | contribs) (Add precompiled info back)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Category: Data Types

Code represents data consisting of commands and their parameters. It is defined in script by being wrapped in {/} brackets, and is precompiled by the game engine.

The contents of SQF and SQS files are Code.

Examples:

while { alive player } do { sleep 1; hintSilent format ["Health: %1/100", round ((1 - damage player) * 100)]; }; unit addEventHandler ["Killed", { systemChat format ["%1 is dead", name (_this select 0)]; }]; onMapSingleClick { systemChat format ["You clicked at %1", _pos]; };


See Code vs. Strings for more information on code/string data typing.