Skip to content

evt.h

Bytecode

typedef Bytecode source

EvtVar

typedef EvtVar source

EVT_CMD_COUNT

#define EVT_CMD_COUNT(argv...) source

helper for calculating command arg counts

EVT_CMD

#define EVT_CMD(opcode, argv...) source

expands to a packed header of the given opcode and arguments with argc calculated automatically

EVT_OP_INTERNAL_FETCH

EVT_OP_INTERNAL_FETCH source

EVT_OP_END

EVT_OP_END source

EVT_OP_RETURN

EVT_OP_RETURN source

EVT_OP_LABEL

EVT_OP_LABEL source

Args: label identifier

EVT_OP_GOTO

EVT_OP_GOTO source

Args: label identifier

EVT_OP_LOOP

EVT_OP_LOOP source

Args: number of repeats (0 = infinite)

EVT_OP_END_LOOP

EVT_OP_END_LOOP source

EVT_OP_BREAK_LOOP

EVT_OP_BREAK_LOOP source

EVT_OP_CONTINUE_LOOP

EVT_OP_CONTINUE_LOOP source

EVT_OP_RETRY_LOOP

EVT_OP_RETRY_LOOP source

EVT_OP_WAIT_FRAMES

EVT_OP_WAIT_FRAMES source

EVT_OP_WAIT_SECS

EVT_OP_WAIT_SECS source

EVT_OP_IF_EQ

EVT_OP_IF_EQ source

Args: a, b

EVT_OP_IF_NE

EVT_OP_IF_NE source

Args: a, b

EVT_OP_IF_LT

EVT_OP_IF_LT source

Args: a, b

EVT_OP_IF_GT

EVT_OP_IF_GT source

Args: a, b

EVT_OP_IF_LE

EVT_OP_IF_LE source

Args: a, b

EVT_OP_IF_GE

EVT_OP_IF_GE source

Args: a, b

EVT_OP_IF_RANGE

EVT_OP_IF_RANGE source

Args: value, min, max

EVT_OP_IF_NOT_RANGE

EVT_OP_IF_NOT_RANGE source

Args: value, min, max

EVT_OP_IF_FLAG

EVT_OP_IF_FLAG source

Args: a, b

EVT_OP_IF_NOT_FLAG

EVT_OP_IF_NOT_FLAG source

Args: a, b

EVT_OP_ELSE

EVT_OP_ELSE source

EVT_OP_END_IF

EVT_OP_END_IF source

EVT_OP_SWITCH

EVT_OP_SWITCH source

Args: expression to test against

EVT_OP_SWITCH_CONST

EVT_OP_SWITCH_CONST source

Args: value to test against

EVT_OP_CASE_EQ

EVT_OP_CASE_EQ source

Args: expression to test for

EVT_OP_CASE_NE

EVT_OP_CASE_NE source

Args: expression to test for

EVT_OP_CASE_LT

EVT_OP_CASE_LT source

Args: expression to test for

EVT_OP_CASE_GT

EVT_OP_CASE_GT source

Args: expression to test for

EVT_OP_CASE_LE

EVT_OP_CASE_LE source

Args: expression to test for

EVT_OP_CASE_GE

EVT_OP_CASE_GE source

Args: expression to test for

EVT_OP_CASE_DEFAULT

EVT_OP_CASE_DEFAULT source

EVT_OP_CASE_OR_EQ

EVT_OP_CASE_OR_EQ source

Args: expression to test for

EVT_OP_CASE_AND_EQ

EVT_OP_CASE_AND_EQ source

Args: expression to test for

EVT_OP_CASE_FLAG

EVT_OP_CASE_FLAG source

Args: expression to test for

EVT_OP_END_CASE_GROUP

EVT_OP_END_CASE_GROUP source

Ends the case block of EVT_OP_CASE_OR_EQ condition(s).

EVT_OP_CASE_RANGE

EVT_OP_CASE_RANGE source

Args: from, to

EVT_OP_BREAK_SWITCH

EVT_OP_BREAK_SWITCH source

EVT_OP_END_SWITCH

EVT_OP_END_SWITCH source

EVT_OP_SET

EVT_OP_SET source

Args: container, expression

EVT_OP_SET_CONST

EVT_OP_SET_CONST source

Args: container, value

EVT_OP_SETF

EVT_OP_SETF source

Args: container, expression

EVT_OP_ADD

EVT_OP_ADD source

Args: container, increment expression | expression, expression, ...

EVT_OP_SUB

EVT_OP_SUB source

Args: container, decrement expression | expression, expression

EVT_OP_MUL

EVT_OP_MUL source

Args: container, multiply expression | expression, expression, ...

EVT_OP_DIV

EVT_OP_DIV source

Integer division. Args: container, divisor expression | dividend expression, divisor expression

EVT_OP_MOD

EVT_OP_MOD source

Args: container, divisor expression | dividend expression, divisor expression

EVT_OP_ADDF

EVT_OP_ADDF source

Args: container, increment expression | expression, expression, ...

EVT_OP_SUBF

EVT_OP_SUBF source

Args: container, decrement expression | expression, expression

EVT_OP_MULF

EVT_OP_MULF source

Args: container, multiply expression | expression, expression, ...

EVT_OP_DIVF

EVT_OP_DIVF source

Args: container, divisor expression | dividend expression, divisor expression

EVT_OP_NEG

EVT_OP_NEG source

Args: container | container, expression

EVT_OP_NEGF

EVT_OP_NEGF source

Args: container | container, expression

EVT_OP_ABS

EVT_OP_ABS source

Args: container | container, expression

EVT_OP_ABSF

EVT_OP_ABSF source

Args: container | container, expression

EVT_OP_SIGN

EVT_OP_SIGN source

Args: container | container, expression

EVT_OP_SIGNF

EVT_OP_SIGNF source

Args: container | container, expression

EVT_OP_MIN

EVT_OP_MIN source

Args: container, expression | expression, expression, ...

EVT_OP_MINF

EVT_OP_MINF source

Args: container, expression | expression, expression, ...

EVT_OP_MAX

EVT_OP_MAX source

Args: container, expression | expression, expression, ...

EVT_OP_MAXF

EVT_OP_MAXF source

Args: container, expression | expression, expression, ...

EVT_OP_CLAMP

EVT_OP_CLAMP source

Args: container, min, max | container, expression, min, max

EVT_OP_CLAMPF

EVT_OP_CLAMPF source

Args: container, min, max | container, expression, min, max

EVT_OP_USE_BUF

EVT_OP_USE_BUF source

Args: s32*

EVT_OP_BUF_READ

EVT_OP_BUF_READ source

Args: container, ...

EVT_OP_BUF_PEEK

EVT_OP_BUF_PEEK source

Args: container, index

EVT_OP_USE_FBUF

EVT_OP_USE_FBUF source

Identical to USE_BUFFER. Args: fixed-point s32*

EVT_OP_FBUF_READ

EVT_OP_FBUF_READ source

Args: container, ...

EVT_OP_FBUF_PEEK

EVT_OP_FBUF_PEEK source

Args: container, index

EVT_OP_MEM_GET

EVT_OP_MEM_GET source

Args: memory type, container, base address, index

EVT_OP_MEM_SET

EVT_OP_MEM_SET source

Args: memory type, base address, index, value

EVT_OP_USE_ARRAY

EVT_OP_USE_ARRAY source

Args: *s32

EVT_OP_USE_FLAGS

EVT_OP_USE_FLAGS source

Args: *s32

EVT_OP_MALLOC_ARRAY

EVT_OP_MALLOC_ARRAY source

Allocates a new array. Args: length, s32*

EVT_OP_BITWISE_AND

EVT_OP_BITWISE_AND source

Args: container, expression to bitwise AND with

EVT_OP_BITWISE_AND_CONST

EVT_OP_BITWISE_AND_CONST source

Args: container, value to bitwise AND with

EVT_OP_BITWISE_OR

EVT_OP_BITWISE_OR source

Args: container, expression to bitwise OR with

EVT_OP_BITWISE_OR_CONST

EVT_OP_BITWISE_OR_CONST source

Args: container, value to bitwise OR with

EVT_OP_CALL

EVT_OP_CALL source

Args: *function, ...

EVT_OP_EXEC

EVT_OP_EXEC source

Args: EvtScript*, ...

EVT_OP_EXEC_GET_ID

EVT_OP_EXEC_GET_ID source

Args: EvtScript*, container, ...

EVT_OP_EXEC_WAIT

EVT_OP_EXEC_WAIT source

Spawns a script and waits for it to return before continuing. Args: EvtScript*, ...

EVT_OP_BIND_TRIGGER

EVT_OP_BIND_TRIGGER source

Args: EvtScript*, trigger flags, s32 target, has interact prompt, Trigger* out

EVT_OP_UNBIND

EVT_OP_UNBIND source

Unbinds any triggers bound to this script.

EVT_OP_KILL_SCRIPT

EVT_OP_KILL_SCRIPT source

Args: ScriptID

EVT_OP_JUMP

EVT_OP_JUMP source

Args: EvtScript*

EVT_OP_SET_PRIORITY

EVT_OP_SET_PRIORITY source

Args: priority

EVT_OP_SET_TIMESCALE

EVT_OP_SET_TIMESCALE source

Args: timescale

EVT_OP_SET_GROUP

EVT_OP_SET_GROUP source

Args: group

EVT_OP_BIND_ITEM_PROMPT

EVT_OP_BIND_ITEM_PROMPT source

Args: EvtScript*, trigger flags, s32 target, ItemList*, tattle msg, has interact prompt

EVT_OP_SUSPEND_GROUP

EVT_OP_SUSPEND_GROUP source

Args: group

EVT_OP_RESUME_GROUP

EVT_OP_RESUME_GROUP source

Args: group

EVT_OP_SUSPEND_OTHERS

EVT_OP_SUSPEND_OTHERS source

Args: group

EVT_OP_RESUME_OTHERS

EVT_OP_RESUME_OTHERS source

Args: group

EVT_OP_SUSPEND_SCRIPT

EVT_OP_SUSPEND_SCRIPT source

Args: ScriptID

EVT_OP_RESUME_SCRIPT

EVT_OP_RESUME_SCRIPT source

Args: ScriptID

EVT_OP_IS_SCRIPT_RUNNING

EVT_OP_IS_SCRIPT_RUNNING source

Args: ScriptID, container

EVT_OP_THREAD

EVT_OP_THREAD source

EVT_OP_END_THREAD

EVT_OP_END_THREAD source

EVT_OP_CHILD_THREAD

EVT_OP_CHILD_THREAD source

Parallel threads are killed as soon as the parent script returns.

EVT_OP_END_CHILD_THREAD

EVT_OP_END_CHILD_THREAD source

EVT_OP_AWAIT_CHILDREN

EVT_OP_AWAIT_CHILDREN source

EVT_OP_AWAIT_SCRIPT

EVT_OP_AWAIT_SCRIPT source

Args: ScriptID

EVT_OP_DEBUG_PRINT_VAR

EVT_OP_DEBUG_PRINT_VAR source

Args: expression

EVT_OP_DEBUG_BREAKPOINT

EVT_OP_DEBUG_BREAKPOINT source

EVT_OP_EXPECT_ARGS

EVT_OP_EXPECT_ARGS source

EVT_OP_FINALLY

EVT_OP_FINALLY source

EVT_OP_EVAL

EVT_OP_EVAL source

Args: container, *function, ...

EVT_OP_EVALF

EVT_OP_EVALF source

Args: container, *function, ...

EVT_OP_INVOKE

EVT_OP_INVOKE source

Args: *function, ...

EVT_OP_INVOKEF

EVT_OP_INVOKEF source

Args: *function, ...

EVT_OP_IF_EVAL

EVT_OP_IF_EVAL source

Args: *function, ...

EVT_OP_IF_NOT_EVAL

EVT_OP_IF_NOT_EVAL source

Args: *function, ...

EVT_OP_IF_EVALF

EVT_OP_IF_EVALF source

Args: *function, ...

EVT_OP_IF_NOT_EVALF

EVT_OP_IF_NOT_EVALF source

Args: *function, ...

EVT_OP_LERP

EVT_OP_LERP source

Args: container, start, end, duration, easing

EVT_OP_END_LERP

EVT_OP_END_LERP source

EvtMemType

enum EvtMemType source

EvtCurrentScript

extern struct Evt * EvtCurrentScript source

the script currently being executed by evt_execute_next_command, or nullptr

ApiStatus

typedef ApiStatus source

return type of script API functions

EventCommandResults

enum EventCommandResults source

stop executing without automatically advancing to the next command

EVT_CMD_RESULT_YIELD
EVT_CMD_RESULT_CONTINUE
EVT_CMD_RESULT_ERROR

EvtTerminationState

enum EvtTerminationState source
EVT_TERMINATION_NONE
EVT_TERMINATION_AWAITING_CHILDREN

the script is not terminating

EVT_TERMINATION_FINALIZING

waiting for its children to finish terminating

EVT_TERMINATION_DESTROY_PENDING

Finally block is running

EventGroupFlags

enum EventGroupFlags source

EventPriority

enum EventPriority source

EventStateFlags

enum EventStateFlags source
EVT_FLAG_ACTIVE
EVT_FLAG_PAUSED

paused through suspend_group_script / resume_group_script

EVT_FLAG_BLOCKED_BY_CHILD
EVT_FLAG_RUN_IMMEDIATELY

don't wait for next update_scripts call

EVT_FLAG_THREAD
EVT_FLAG_SUSPENDED

doesn't affect child