Action2/Only Callback Failure

From GRFSpecs
< Action2
Revision as of 13:03, 13 November 2020 by Frosch (talk | contribs) (fix link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

The features

  • Sound Effects
  • Signals

have no regular Action2 to assign graphics. However, Action2 is still needed to make callbacks fail.

Syntax

<Sprite-number> * <Length> 01 <feature> 01 00
<Sprite-number> * <Length> 02 <feature> <set-id> 01 00 00 00

This syntax consists of both an Action1 and the actual Action2. See the detailed description below.

Element Size Description
<Sprite-number> dec A sequential sprite number
<length> dec The total number of bytes used in this action
<set-id> B What set-ID this action2 defines

Description

The syntax to use is the syntax of the regular Action2 referencing Action1 spritesets. However:

  • Every Action2 must reference at least one spriteset, so we must also define one via Action1.
  • Every Action1 must define at least one spriteset, but spritesets may contain zero sprites.

Above syntax specifies two pseudo sprites. First an Action1 defining 1 spriteset with 0 sprites, then the Action2 referencing only that single spriteset.

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

set-id

This defines the ID of the current action 2. This ID will later be referred to by action 3, or a variational/random action 2.

You can reuse action 2 IDs, and there's no restriction on the order in which they are defined.