Difference between revisions of "Action10"

From GRFSpecs
Jump to navigationJump to search
m (6 revisions)
(version tags)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
==Introduction==
 
  +
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 49}}
'''''Define GOTO label for action 7/9'''''
 
 
=Action 10=
 
 
 
Define GOTO label for action 7/9
 
Define GOTO label for action 7/9
   
 
To eliminate having to change all action 7/9 entries after adding sprites to a .grf file, you can define labels using this action 10. Additionally, this is the only way to skip more than 255 sprites at once.
-=Description=-
 
   
  +
== Syntax ==
To eliminate having to change all action 7/9 entries after adding sprites to a .grf file, you can define labels using this action 10.  Additionally, this is the only way to skip more than 255 sprites at once.
 
 
Available since 2.0.1 alpha 49.
 
 
-=Format=-
 
   
 
The data looks as follows:
 
The data looks as follows:
   
<pre>-+&lt;sprite-number&gt; * &lt;length&gt; 10 &lt;label&gt; <nowiki><nowiki>[&lt;comment&gt;]</nowiki></nowiki>+-</pre>
+
<pre><sprite-number> * <length> 10 <label> [<comment>]</pre>
 
||'''Element'''|[[GRFActionsDetailed|'''Size''']]|'''Description'''
 
 
&lt;sprite-number&gt;|dec|A sequential sprite number
 
 
&lt;length&gt;|dec|The total number of bytes in the action
 
 
10|B|Action 10
 
 
&lt;label&gt;|B|Which label to define
 
   
  +
{|
&lt;comment&gt;|V|Optional comment, ignored by TTDPatch||
 
 
!Element !![[GRFActionsDetailed|Size]] !! Description
  +
|-
 
|<sprite-number> ||dec ||A sequential sprite number
  +
|-
 
|<length> ||dec ||The total number of bytes in the action
  +
|-
 
|10 ||B ||Action 10
  +
|-
 
|<label> ||B ||Which label to define
  +
|-
 
|<comment> || V ||Optional comment, ignored by TTDPatch
  +
|}
   
 
== Description ==
-=Filling in the terms=-
 
   
===sprite-number===
+
=== sprite-number ===
   
 
The current sprite number.
 
The current sprite number.
   
===length===
+
=== length ===
   
 
The total number of bytes in this action 7 or 9.
 
The total number of bytes in this action 7 or 9.
   
===label===
+
=== label ===
   
 
This sets the number of the label to define. It may range from E0 to FF (allowing 32 labels per grf file).
 
This sets the number of the label to define. It may range from E0 to FF (allowing 32 labels per grf file).
Line 46: Line 41:
 
If two labels are defined with the same number, only the last definition counts.
 
If two labels are defined with the same number, only the last definition counts.
   
  +
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 70}}
Since 2.0.1 alpha 70, the label may have any number (instead of just E0..FF). In addition, duplicate labels are handled differently, see [[Action7#num-sprites|action 7]] for details.
+
Since TTDPatch 2.0.1 alpha 70, the label may have any number (instead of just E0..FF). In addition, duplicate labels are handled differently, see [[Action7#num-sprites|action 7]] for details.

Latest revision as of 18:15, 6 August 2011

Introduction

Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (2.0.1 alpha 49)2.5 Define GOTO label for action 7/9

To eliminate having to change all action 7/9 entries after adding sprites to a .grf file, you can define labels using this action 10. Additionally, this is the only way to skip more than 255 sprites at once.

Syntax

The data looks as follows:

<sprite-number> * <length> 10 <label> [<comment>]
Element Size Description
<sprite-number> dec A sequential sprite number
<length> dec The total number of bytes in the action
10 B Action 10
<label> B Which label to define
<comment> V Optional comment, ignored by TTDPatch

Description

sprite-number

The current sprite number.

length

The total number of bytes in this action 7 or 9.

label

This sets the number of the label to define. It may range from E0 to FF (allowing 32 labels per grf file).

If two labels are defined with the same number, only the last definition counts.

Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (2.0.1 alpha 70)2.5 Since TTDPatch 2.0.1 alpha 70, the label may have any number (instead of just E0..FF). In addition, duplicate labels are handled differently, see action 7 for details.