Difference between revisions of "Action2"

From GRFSpecs
Jump to navigationJump to search
m (13 revisions)
m (Bot: Automated text replacement (--= +==))
Line 1: Line 1:
   
  +
== Introduction ==
'''''Define graphics set IDs'''''
 
   
 
=Action 2=
 
=Action 2=
Line 6: Line 6:
 
Defining graphics set IDs.
 
Defining graphics set IDs.
   
-=Introduction=-
+
==Introduction==
   
 
Action 2 is used to group sets of sprites from the previous [[Action1|action 1]] together, and make them accessible by a variational or random action2 (chain) or an action3.
 
Action 2 is used to group sets of sprites from the previous [[Action1|action 1]] together, and make them accessible by a variational or random action2 (chain) or an action3.
   
-=Format=-
+
==Format==
   
 
In general, the data looks as follows:
 
In general, the data looks as follows:
   
<pre> -+&lt;Sprite-number&gt; * &lt;Length&gt; 02 &lt;feature&gt; &lt;set-id&gt; &lt;num-ent1&gt; &lt;num-ent2&gt; &lt;entries...&gt;+-</pre>
+
<pre> -+<Sprite-number> * <Length> 02 <feature> <set-id> <num-ent1> <num-ent2> <entries...>+-</pre>
   
  +
{|
||'''Element'''|[[GRFActionsDetailed|'''Size''']]|'''Description'''
+
!'''Element'''!![[GRFActionsDetailed!!'''Size''']]!!'''Description'''
   
  +
|-
&lt;Sprite-number&gt;|dec|A sequential sprite number
+
|<Sprite-number>||dec||A sequential sprite number
   
  +
|-
&lt;length&gt;|dec|The total number of bytes used in this action
+
|<length>||dec||The total number of bytes used in this action
   
  +
|-
02|B|Defines action 02
+
|02||B||Defines action 02
   
  +
|-
&lt;feature&gt;|B|For what type of feature should the following sprites be used?
+
|<feature>||B||For what type of feature should the following sprites be used?
   
  +
|-
&lt;set-id&gt;|B|What set-ID this action 2 defines
+
|<set-id>||B||What set-ID this action 2 defines
   
  +
|-
&lt;num-ent1&gt;|B|First number of entries, depends on feature
+
|<num-ent1>||B||First number of entries, depends on feature
   
  +
|-
&lt;num-ent2&gt;|B|Second number of entries, depends on feature
+
|<num-ent2>||B||Second number of entries, depends on feature
   
  +
|-
&lt;entries...&gt;|W|Entry numbers, depends on the feature||
+
|<entries...>||W||Entry numbers, depends on the feature
  +
|}
   
-=Filling in the terms=-
+
==Filling in the terms==
   
 
===Sprite-number===
 
===Sprite-number===
Line 76: Line 86:
 
==set-id==
 
==set-id==
   
This defines the ID of the current action 2. &nbsp;This ID will later be referred to by [[Action3|action 3]], or a variational/random action 2.
+
This defines the ID of the current action 2. This ID will later be referred to by [[Action3|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.
 
You can reuse action 2 IDs, and there's no restriction on the order in which they are defined.
Line 88: Line 98:
 
This is the list of action 1 sets to use, first num-ent1 for the first range, then num-ent2 entries for the second range.
 
This is the list of action 1 sets to use, first num-ent1 for the first range, then num-ent2 entries for the second range.
   
-=Notes=-
+
==Notes==
   
 
Do not skip an action 2 using [[Action9|action 9]] (unless it skips the whole file). Action 2 must not be skipped by action 9 or the patch will most likely crash. Skip or modify [[Action3|action 3]] instead. Skipping an action 2 with an [[Action7|action 7]] has no effect.
 
Do not skip an action 2 using [[Action9|action 9]] (unless it skips the whole file). Action 2 must not be skipped by action 9 or the patch will most likely crash. Skip or modify [[Action3|action 3]] instead. Skipping an action 2 with an [[Action7|action 7]] has no effect.
   
-=Feature specific formats=-
+
==Feature specific formats==
   
 
Some features and/or num-ent1 values have a special format. These are detailed on the pages listed below.
 
Some features and/or num-ent1 values have a special format. These are detailed on the pages listed below.
Line 98: Line 108:
 
{toc}
 
{toc}
   
-=Example=-
+
==Example==
   
 
<span style='color:#808080'>Something to go here</span>
 
<span style='color:#808080'>Something to go here</span>

Revision as of 22:30, 14 June 2011

Introduction

Action 2

Defining graphics set IDs.

Introduction

Action 2 is used to group sets of sprites from the previous action 1 together, and make them accessible by a variational or random action2 (chain) or an action3.

Format

In general, the data looks as follows:

 -+<Sprite-number> * <Length> 02 <feature> <set-id> <num-ent1> <num-ent2> <entries...>+-
Element [[GRFActionsDetailed Size]] Description
<Sprite-number> dec A sequential sprite number
<length> dec The total number of bytes used in this action
02 B Defines action 02
<feature> B For what type of feature should the following sprites be used?
<set-id> B What set-ID this action 2 defines
<num-ent1> B First number of entries, depends on feature
<num-ent2> B Second number of entries, depends on feature
<entries...> W Entry numbers, depends on the feature

Filling in the terms

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

feature

This sets the type of feature that you wish to change. Set it to:

00 for trains

01 for road vehicles

02 for ships

03 for planes

04 for stations

05 for canals/rivers

06 for bridges

07 for houses

09 for industry tiles

0A for industries

0B for cargos

0F for objects

10 for rail types (since OpenTTD r19056)

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.

num-ent1, num-ent2

Each feature has two different graphics ranges, but their exact meaning differs from feature to feature. For example, for vehicles, the first set is used while moving, and the second while loading/unloading in a station.

entries

This is the list of action 1 sets to use, first num-ent1 for the first range, then num-ent2 entries for the second range.

Notes

Do not skip an action 2 using action 9 (unless it skips the whole file). Action 2 must not be skipped by action 9 or the patch will most likely crash. Skip or modify action 3 instead. Skipping an action 2 with an action 7 has no effect.

Feature specific formats

Some features and/or num-ent1 values have a special format. These are detailed on the pages listed below.

{toc}

Example

Something to go here