Skip to content

Argument files: <arg.h>

Natives for event argument files loaded with load_arg.

Natives are built-in engine functions declared with NATIVE(...). Argument files run once when load_arg loads them and build the scene's integer and float argument lists.

Declared in sdk/arg.h and sdk/helpers/arg.h. See C Language, SDK, and Patches for SDK syntax and API Reference for all headers. Generated by dc2tk api-docs from the SDK's headers; change the headers, not this page.

Natives

Native Number What it does
VM_ARGS 0 Stores all its arguments (ints, floats and strings, in order) as one argument record under the next record id, then adds 1 to that id.
set_arg_record_id 1 Sets the id that the next add_arg_record call stores its record under; ids start at 0.

VM_ARGS

extern void add_arg_record VM_ARGS(any value, ...) NATIVE(0);

Stores all its arguments (ints, floats and strings, in order) as one argument record under the next record id, then adds 1 to that id. Event natives called with a single record id read their arguments from the matching record.

Original name: _DATA.

set_arg_record_id

extern void set_arg_record_id(int next_id) NATIVE(1);

Sets the id that the next add_arg_record call stores its record under; ids start at 0.

Original name: _ID_OFFSET.

Helpers

Inline helper functions that wrap common sequences of native calls.

Helper What it does
add_actor_place_records Adds the two records that place an actor: its position (actor, x, y, z), then its yaw as (actor, 0.0, yaw, 0.0).

add_actor_place_records

Adds the two records that place an actor: its position (actor, x, y, z), then its yaw as (actor, 0.0, yaw, 0.0).

static inline void add_actor_place_records(int actor, float x, float y, float z, float yaw)
{
    add_arg_record(actor, x, y, z);
    add_arg_record(actor, 0.0, yaw, 0.0);
}

Programs

Program entry-point numbers started by the engine (enum program). Register an entry point in a script with PROGRAM(name, function);.

Program Number When it runs
build_args 100 The only program the engine runs in an argument script: _LOAD_ARG loads the file and CEventScriptArg::BuildArgData runs program 100 once to build the event's argument lists (event_func.cpp script_run_id).