1. Architectural Role & Engine Purpose
The QSC ("Q Script Code") format is the reconstructed high-level programming language in I.G.I. 2: Covert Strike. In the sequel, scripts evolved from simple procedural state loops into structured object-oriented behavioral schemas utilizing DefineMagicObj object prototypes.
Naming — read this carefully. QSC stands for "Q Script Code": the
Q is the bare C-style letter used throughout the Innerloop C++ codebase (cf. QSC,
QVM, .qsc). It is not "Quake Script" and not
"Quest Script" — neither name appears in any engine string, header, or tool in the retail files. The
Innerloop QVM bytecode VM was derived from / inspired by the Quake virtual machine,
but the two are not directly related: QVM has its own LOOP container, its own 49-opcode
instruction set, and its own registrar-based native bridging.
Using project-igi-converter, compiled VM v8.5 bytecode (the same LOOP container
used by IGI 1; IGI 2 ships a much richer script catalog) is decompiled into readable QSC source code,
revealing guard patrol trees, sound perception thresholds, alarm triggers, and multi-stage mission objectives.
2. Script Compilation & Object Schema AST Diagram
The IGI 2 script architecture connects compiled classes to native engine entity instances:
3. Tactical AI Event Handling Pipeline Diagram
When sensory triggers occur in the world, the engine raises asynchronous events directly into the QSC event handler:
4. IGI 2 MagicObject Examples (Function-Call Syntax)
In IGI 2, magicobj.qvm (compiled from magicobj.qsc) registers interactive
mesh sub-parts with DefineMagicObj calls. The engine checks every ATTA sub-model name
against this registry at spawn time:
DefineMagicObj("model_id", "model_id", TASKTYPE_XXX);
// Some task types have extra parameters:
DefineMagicObj("614_02_1", "614_02_1", TASKTYPE_AISTATIONARYGUN, "614_03_1", 361, 15, -4, 10000, 15, 15, "tank_turret", 0, 6);
DefineMagicObj("610_02_1", "610_02_1", TASKTYPE_CARDOOR, 0, 30, -118);
DefineMagicObj("700_05_1", "700_05_1", TASKTYPE_HELIDOOR, 1, 0.6, 2.65);
Parent vehicle models (614_01_1, 622_01_1, 700_01_1) are
not listed in magicobj — they are plain parent meshes. Only their ATTA sub-models
(turrets, wheels, rotors, doors) are registered as MagicObjects.
editormagicobj.qvm is a parallel file used by the level editor only — it shipped
empty in the retail game.