-
Notifications
You must be signed in to change notification settings - Fork 0
execVM
ffredyk edited this page Jul 23, 2026
·
1 revision
Code Execution
Unary — execVM <filePath>.
execVM <string> // path to .sqf file
Reads an .sqf file from disk, compiles it, and spawns it asynchronously on the current scheduler. Returns a ScriptHandle. This is the primary way to load and execute external script files.
- Reads the file content from the given path.
- Compiles the source text into a
Codevalue using the SQ# compiler. - Spawns the compiled code as a new fiber on the current scheduler.
- Returns a
ScriptHandle.
Equivalent to spawn compile (readFile _path) but as a single efficient operation.
_handle = execVM "scripts\init.sqf";_handle = execVM "scripts\setup.sqf";
await _handle;
systemChat "Setup complete";{
_handles pushBack (execVM _x);
} forEach [
"scripts\ai.sqf",
"scripts\spawns.sqf",
"scripts\loot.sqf"
];if (!isNil { execVM "optional\addon.sqf" }) then {
// file exists and was spawned
};Creates fiber on the current scheduler. File reading is synchronous (blocks briefly). The spawned code runs on the current scheduler.
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo