Anonymous

Changes

From Final Fantasy Inside

FF7/Field/Script/Opcodes/C2 LADER

3,158 bytes added, 00:37, 7 September 2006
no edit summary
* Opcode: '''0xC2'''
* Short name: '''LADER'''
* Long name: Ladder

==== Memory layout ====
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0xC2
! width="40" | ''0''
! width="40" | ''0''
! width="40" | ''X''
! width="40" | ''Y''
! width="40" | ''Z''
! width="40" | ''I''
! width="40" | ''K''
! width="40" | ''A''
! width="40" | ''D''
! width="40" | ''S''
|}

==== Arguments ====

* '''const UShort''' ''0'': Zero. Has an unusual effect on co-ordinates if non-zero.
* '''const Short''' ''X'': X-coordinate of the end of the ladder.
* '''const Short''' ''Y'': Y-coordinate of the end of the ladder.
* '''const Short''' ''Z'': Z-coordinate of the end of the ladder.
* '''const UShort''' ''I'': ID of the walkmesh triangle found at the end of the ladder.
* '''const UByte''' ''K'': The keys used to move the character on the ladder.
* '''const UByte''' ''A'': Animation ID for the field object's movement animation.
* '''const UByte''' ''D'': Direction the character faces when climbing the ladder.
* '''const UByte''' ''S'': Speed of the animation whilst climbing the ladder.

==== Description ====

Causes the character to climb a ladder; that is, switching from standard walkmesh movement, to climbing along a line connecting two points on the walkmesh.

The coordinates specify the end-point of the ladder; the current position of the character is used as the start point. The ID of the walkmesh triangle must be specified; this is the triangle the character will step onto after reaching the end point of the ladder. The '''K''' value specifies the keys used to move the character across the ladder; keys outside the range found in the table will cause unpredictable behaviour. The animation ID specifies an offset into the field object's animation list; this animation is played at the speed specified by '''S''' whilst the character climbs. Finally, the '''D''' argument is a direction value in the game's standard direction format, which orients the character on the ladder.

This opcode is used as part of the character's entity, rather than in a seperate entity, as with a [[FF7/Field/Script/Opcodes/D0 LINE|LINE]]. A LINE is used to set the start point of the ladder on the walkmesh. When this LINE is crossed by the player, a script in the LINE then uses a [[FF7/Field/Script/Opcodes/04 PREQ|PREQ]] (or one of its variants), calling the script in the party leader that defines the LADER, causing the character to begin its climbing position.

To set up a two-way ladder, two LINEs are used at either end, with different values for the LADER arguments, such as differing end points.

==== Key IDs ====

{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" width="40" | ID
! style="background:rgb(204,204,204)" width="100" | Key: Towards the end point
! style="background:rgb(204,204,204)" width="100" | Key: Towards the start point
|-
| align="center" | 0
| Down
| Up
|-
| align="center" | 1
| Up
| Down
|-
| align="center" | 2
| Right
| Left
|-
| align="center" | 3
| Left
| Right
|-
|}