FF7/Field/Script/Opcodes/C3 OFST

From Final Fantasy Inside
< FF7‎ | Field‎ | Script‎ | Opcodes
Revision as of 01:24, 7 September 2006 by my_wiki>Synergy Blades
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Opcode: 0xC3
  • Short name: OFST
  • Long name: Offset Object

Memory layout

0xC3 0 0 T X Y Z S

Arguments

  • const UShort 0: Zero. Has an unusual effect on co-ordinates if non-zero.
  • const UByte T: Type of movement.
  • const Short X: X offset amount, relative to current position.
  • const Short Y: Y offset amount, relative to current position.
  • const Short Z: Z offset amount, relative to current position.
  • const UShort S: Speed of the offset movement, if type is non-zero.

Description

Offsets the field object, belonging to the entity whose script this opcode resides in, by a certain amount. After being offset, the character moves on the walkmesh as per the walkmesh's shape, but at a certain distance away from the normal walkmesh position. Other field objects are unaffected, and their position or movements are maintained on the walkmesh's original position.

The amount to offset is specified relative to the current position. If Type is specified, the object moves gradually from its current point to the offset position; this can be used to simulate movements such as elevators. Any type outside the range in the table will cause the offset not to occur. If the object is set to move gradually, then the speed of offset can be set; the greater the number, the slower the object moves to its target offset.

Script execution may also be halted until the gradual offset has been completed. For this, see OFSTW.

Movement Types

ID Movement Type
0 Instantaneous
1 Linear (Point-to-point)
2 Quadratic (Smoothed)