Code: Difference between revisions
Category: Data Types
Lou Montana (talk | contribs) (Remove String'ed code information, leave it for Code vs. Strings) |
Lou Montana (talk | contribs) m (Add precompiled info back) |
||
| Line 1: | Line 1: | ||
'''Code''' represents data consisting of commands and their parameters. | '''Code''' represents data consisting of commands and their parameters. | ||
The contents of [[SQF Syntax|SQF]] and [[SQS Syntax|SQS]] files | It is defined in script by being wrapped in <sqf inline>{</sqf>/<sqf inline>}</sqf> brackets, and is precompiled by the game engine. | ||
The contents of [[SQF Syntax|SQF]] and [[SQS Syntax|SQS]] files are Code. | |||
Examples: | |||
<sqf> | <sqf> | ||
while { alive player } do { sleep 1; hintSilent format ["Health: %1/100", round ((1 - damage player) * 100)]; }; | while { alive player } do { sleep 1; hintSilent format ["Health: %1/100", round ((1 - damage player) * 100)]; }; | ||
Latest revision as of 17:38, 2 March 2026
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]; };