Alchemy
Loading...
Searching...
No Matches

objcmd.h File Reference

Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs them. More...

Go to the source code of this file.

Macros

#define SC_LABEL(n)
 Branch destination.
#define SC_TO(n)
#define SC_TOP   0
 Script start.
#define SC_FOREVER   0xffff
#define SC_WAIT(n)
 Wait n frames.
#define SC_SYNC   0x01
 Wait for arrival.
#define SC_POS(x, y, z)
 Set position.
#define SC_MOVE(x, y, z)
 Move toward the target.
#define SC_MOVE_BY(x, y, z)
 Move by a relative offset.
#define SC_FACE_LINK   0x05
 Face the linked object.
#define SC_MOVE_LINK   0x06
 Move to the linked object.
#define SC_MOVE_LOCAL(a, b)
#define SC_WANDER(a, b, c)
 Wander.
#define SC_WANDER_HOME(a, b, c)
#define SC_APPROACH_LINK   0x0a
#define SC_CAMERA   0x0b
 Follow the leader.
#define SC_LOOP(n, to)
 Repeat up to n times.
#define SC_JUMP(to)
#define SC_IF(to)
 Branch if the result is true.
#define SC_IFNOT(to)
 Branch if the result is false.
#define SC_END   0x10
 Return to the main script.
#define SC_FLAG_CHECK(f)
#define SC_FLAG_ON(f)
#define SC_FLAG_OFF(f)
#define SC_FLAG_REV(f)
#define SC_SET(w, v)
 Write a work value.
#define SC_ADD(w, v)
#define SC_CMP(w, v)
#define SC_PLAYER   0x18
 Player input control.
#define SC_KEYS   0x19
#define SC_WORLD   0x1a
 World map control.
#define SC_FREE   0x1b
 Release.
#define SC_ARG(v)
#define SC_NOP(v)
#define SC_SE(n)
 Sound effect.
#define SC_BASE   0x1f
 Restart from the next word.
#define SC_B54_OFF   0x20
#define SC_B54_ON   0x21
#define SC_CALL(fn)
#define SC_KEY_COUNT   0x23

Enumerations

enum  ScriptWork {
  SW_SCRIPT = 0x00 , SW_CURSOR = 0x01 , SW_FACING = 0x03 , SW_X = 0x05 ,
  SW_Y = 0x06 , SW_Z = 0x07 , SW_RADIUS = 0x08 , SW_SCALE_X = 0x09 ,
  SW_SCALE_Y = 0x0a , SW_VELOCITY_X = 0x0c , SW_VELOCITY_Y = 0x0d , SW_VELOCITY_Z = 0x0e ,
  SW_SPEED = 0x0f , SW_ACCEL = 0x10 , SW_TARGET_X = 0x11 , SW_TARGET_Y = 0x12 ,
  SW_TARGET_Z = 0x13 , SW_BOUNCE = 0x14 , SW_GRAVITY = 0x15 , SW_GROUND = 0x16 ,
  SW_MOTION = 0x1a , SW_ARRIVAL = 0x1b , SW_RESULT = 0x1c , SW_SNAP = 0x1d ,
  SW_COLLISION = 0x1e , SW_STEERING = 0x1f , SW_PAUSED = 0x20 , SW_REPEAT = 0x21 ,
  SW_WAIT = 0x22 , SW_HOOK = 0x26
}
 Script work values for SC_SET, SC_ADD and SC_CMP. More...

Detailed Description

Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs them.

Each macro expands to the words of one command. Coordinates are 16.16 fixed point (PIXELS).

Definition in file objcmd.h.

Macro Definition Documentation

◆ SC_LABEL

#define SC_LABEL ( n)
Value:
(s32)(0x80000000 | (n) << 16)
signed int s32
Definition types.h:14

Branch destination.

Definition at line 11 of file objcmd.h.

◆ SC_TO

#define SC_TO ( n)
Value:
(s32)(0xc0000000 | (n) << 16)

Definition at line 12 of file objcmd.h.

◆ SC_TOP

#define SC_TOP   0

Script start.

Definition at line 13 of file objcmd.h.

◆ SC_FOREVER

#define SC_FOREVER   0xffff

Definition at line 14 of file objcmd.h.

Referenced by Script_RepeatOrJump().

◆ SC_WAIT

#define SC_WAIT ( n)
Value:
0x00, (n)

Wait n frames.

Definition at line 16 of file objcmd.h.

◆ SC_SYNC

#define SC_SYNC   0x01

Wait for arrival.

Definition at line 17 of file objcmd.h.

◆ SC_POS

#define SC_POS ( x,
y,
z )
Value:
0x02, (x), (y), (z)

Set position.

Definition at line 18 of file objcmd.h.

◆ SC_MOVE

#define SC_MOVE ( x,
y,
z )
Value:
0x03, (x), (y), (z)

Move toward the target.

Definition at line 19 of file objcmd.h.

◆ SC_MOVE_BY

#define SC_MOVE_BY ( x,
y,
z )
Value:
0x04, (x), (y), (z)

Move by a relative offset.

Definition at line 20 of file objcmd.h.

◆ SC_FACE_LINK

#define SC_FACE_LINK   0x05

Face the linked object.

Definition at line 21 of file objcmd.h.

◆ SC_MOVE_LINK

#define SC_MOVE_LINK   0x06

Move to the linked object.

Definition at line 22 of file objcmd.h.

◆ SC_MOVE_LOCAL

#define SC_MOVE_LOCAL ( a,
b )
Value:
0x07, (a), (b)

Definition at line 23 of file objcmd.h.

◆ SC_WANDER

#define SC_WANDER ( a,
b,
c )
Value:
0x08, (a), (b), (c)

Wander.

Definition at line 24 of file objcmd.h.

◆ SC_WANDER_HOME

#define SC_WANDER_HOME ( a,
b,
c )
Value:
0x09, (a), (b), (c)

Definition at line 25 of file objcmd.h.

◆ SC_APPROACH_LINK

#define SC_APPROACH_LINK   0x0a

Definition at line 26 of file objcmd.h.

◆ SC_CAMERA

#define SC_CAMERA   0x0b

Follow the leader.

Definition at line 27 of file objcmd.h.

◆ SC_LOOP

#define SC_LOOP ( n,
to )
Value:
0x0c, (n), (to)

Repeat up to n times.

Definition at line 28 of file objcmd.h.

◆ SC_JUMP

#define SC_JUMP ( to)
Value:
0x0d, (to)

Definition at line 29 of file objcmd.h.

◆ SC_IF

#define SC_IF ( to)
Value:
0x0e, (to)

Branch if the result is true.

Definition at line 30 of file objcmd.h.

◆ SC_IFNOT

#define SC_IFNOT ( to)
Value:
0x0f, (to)

Branch if the result is false.

Definition at line 31 of file objcmd.h.

◆ SC_END

#define SC_END   0x10

Return to the main script.

Definition at line 32 of file objcmd.h.

Referenced by ObjectDispatch_WaitForValue16().

◆ SC_FLAG_CHECK

#define SC_FLAG_CHECK ( f)
Value:
0x11, (f)

Definition at line 33 of file objcmd.h.

◆ SC_FLAG_ON

#define SC_FLAG_ON ( f)
Value:
0x12, (f)

Definition at line 34 of file objcmd.h.

◆ SC_FLAG_OFF

#define SC_FLAG_OFF ( f)
Value:
0x13, (f)

Definition at line 35 of file objcmd.h.

◆ SC_FLAG_REV

#define SC_FLAG_REV ( f)
Value:
0x14, (f)

Definition at line 36 of file objcmd.h.

◆ SC_SET

#define SC_SET ( w,
v )
Value:
0x15, (w), (v)

Write a work value.

Definition at line 37 of file objcmd.h.

◆ SC_ADD

#define SC_ADD ( w,
v )
Value:
0x16, (w), (v)

Definition at line 38 of file objcmd.h.

◆ SC_CMP

#define SC_CMP ( w,
v )
Value:
0x17, (w), (v)

Definition at line 39 of file objcmd.h.

◆ SC_PLAYER

#define SC_PLAYER   0x18

Player input control.

Definition at line 40 of file objcmd.h.

◆ SC_KEYS

#define SC_KEYS   0x19

Definition at line 41 of file objcmd.h.

◆ SC_WORLD

#define SC_WORLD   0x1a

World map control.

Definition at line 42 of file objcmd.h.

◆ SC_FREE

#define SC_FREE   0x1b

Release.

Definition at line 43 of file objcmd.h.

◆ SC_ARG

#define SC_ARG ( v)
Value:
0x1c, (v)

Definition at line 44 of file objcmd.h.

◆ SC_NOP

#define SC_NOP ( v)
Value:
0x1d, (v)

Definition at line 45 of file objcmd.h.

◆ SC_SE

#define SC_SE ( n)
Value:
0x1e, (n)

Sound effect.

Definition at line 46 of file objcmd.h.

◆ SC_BASE

#define SC_BASE   0x1f

Restart from the next word.

Definition at line 47 of file objcmd.h.

◆ SC_B54_OFF

#define SC_B54_OFF   0x20

Definition at line 48 of file objcmd.h.

◆ SC_B54_ON

#define SC_B54_ON   0x21

Definition at line 49 of file objcmd.h.

◆ SC_CALL

#define SC_CALL ( fn)
Value:
0x22, (s32)(fn)

Definition at line 50 of file objcmd.h.

◆ SC_KEY_COUNT

#define SC_KEY_COUNT   0x23

Definition at line 51 of file objcmd.h.

Enumeration Type Documentation

◆ ScriptWork

enum ScriptWork

Script work values for SC_SET, SC_ADD and SC_CMP.

Enumerator
SW_SCRIPT 
SW_CURSOR 
SW_FACING 
SW_X 
SW_Y 
SW_Z 
SW_RADIUS 
SW_SCALE_X 
SW_SCALE_Y 
SW_VELOCITY_X 
SW_VELOCITY_Y 
SW_VELOCITY_Z 
SW_SPEED 
SW_ACCEL 
SW_TARGET_X 
SW_TARGET_Y 
SW_TARGET_Z 
SW_BOUNCE 
SW_GRAVITY 
SW_GROUND 
SW_MOTION 
SW_ARRIVAL 
SW_RESULT 
SW_SNAP 
SW_COLLISION 
SW_STEERING 
SW_PAUSED 
SW_REPEAT 
SW_WAIT 
SW_HOOK 

Definition at line 54 of file objcmd.h.