Skip to content

SCRIPT.DAT

ProgSys edited this page Jul 13, 2024 · 81 revisions

Contains all the scripts run by the game. Unlike TALK.DAT it handles more of map logic, then dialog.

File structure

Header

Type Size Description
uInt 4 byte Number of scripts
uInt 4 byte Zero

Next there is a list of addresses (4 byte) flowered by a equal length list of Ids (4 byte). Afterwards the binary script data starts.

Commands overview

Each command consists of a op code (byte) flowed by char that indicates the size of the body that contains the arguments.

Name Op Code Arguments Arguments Size Description
Sleep 01 Frames to sleep 2 byte Script sleeps for given amount of frames.
LockUser 05 None 0 byte Takes away control from user.
PlayBGM 91 BGM Index, Volume(0-128) 1 byte, 1 byte Play background music.

Commands detailed overview

Sleep

  • Op Code: 01
  • Construction: 01 02 00 00
  • Arguments: Frames to sleep

Script sleeps for given amount of frames.

LockUser

  • Op Code: 05
  • Construction: 05 00
  • Arguments: None

Disables the control of the camera and game interaction. However the user still can progress throw the dialog.

PlayBGM

  • Op Code: 91
  • Construction: 91 02 00 11
  • Arguments: BGM Index, Volume(0-128)

Will start playing background music (BGM). Index is equivalent to the file name in DATA.DAT, for instance "BGM003" is the castle theme.

Clone this wiki locally