Difference between revisions of "Action2/Single Set"

From GRFSpecs
Jump to navigationJump to search
m (7 revisions)
m (Bot: Automated text replacement (--= +==))
Line 1: Line 1:
   
 
== Introduction ==
'''''Defining set-IDs for cargos'''''
 
   
 
=Action 2=
 
=Action 2=
Line 6: Line 6:
 
Defining set-IDs for cargoes, railtypes and airports.
 
Defining set-IDs for cargoes, railtypes and airports.
   
-=Introduction=-
 
   
 
The only graphics associated to cargoes is their icon that is shown in the station window, therefore the action2 you need isn't too complicated.
 
The only graphics associated to cargoes is their icon that is shown in the station window, therefore the action2 you need isn't too complicated.
Line 14: Line 13:
 
The only graphics associated with airports is their preview sprite. The default size for the preview sprite is 230x140. The airport build GUI will automatically scale if you have a smaller or larger image, but it will probably look best if you make sure it is no larger than the default size.
 
The only graphics associated with airports is their preview sprite. The default size for the preview sprite is 230x140. The airport build GUI will automatically scale if you have a smaller or larger image, but it will probably look best if you make sure it is no larger than the default size.
   
  +
==Syntax==
-=Format=-
 
   
<pre>-+&lt;Sprite-number&gt; * &lt;Length&gt; 02 0B/10 &lt;set-id&gt; 01 00 &lt;set&gt;+-</pre>
+
<Sprite-number> * <Length> 02 0B/10 <set-id> 01 00 <set>
   
  +
{|
||'''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 action2
+
|02||B||Defines action2
   
  +
|-
0B/10|B|Sprites are used for feature 0B - cargoes, or feature 10 - rail types
+
|0B/10||B||Sprites are used for feature 0B - cargoes, or feature 10 - rail types
   
  +
|-
&lt;set-id&gt;|B|What set-ID this action2 defines
+
|<set-id>||B||What set-ID this action2 defines
   
  +
|-
01|B|A literal 01 byte
+
|01||B||A literal 01 byte
   
  +
|-
00|B|A literal 00 byte
+
|00||B||A literal 00 byte
   
  +
|-
&lt;set&gt;|W|Number of set to use from the last action 1||
+
|<set>||W||Number of set to use from the last action 1
  +
|}
   
 
You may note that this is the same as the action2 entry for vehicles, but with num_loadtypes=1 and num_loadingtypes=0, and only one set number.
 
You may note that this is the same as the action2 entry for vehicles, but with num_loadtypes=1 and num_loadingtypes=0, and only one set number.
   
  +
==Description==
-=Filling in the terms=-
 
   
 
===Sprite-number===
 
===Sprite-number===

Revision as of 22:59, 14 June 2011

Introduction

Action 2

Defining set-IDs for cargoes, railtypes and airports.


The only graphics associated to cargoes is their icon that is shown in the station window, therefore the action2 you need isn't too complicated.

The graphics associated with railtypes are somewhat more complicated, but all their logic is in variational action2s and the action3; the standard action2 is again not complicated.

The only graphics associated with airports is their preview sprite. The default size for the preview sprite is 230x140. The airport build GUI will automatically scale if you have a smaller or larger image, but it will probably look best if you make sure it is no larger than the default size.

Syntax

<Sprite-number> * <Length> 02 0B/10 <set-id> 01 00 <set>
Element Size Description
<Sprite-number> dec A sequential sprite number
<length> dec The total number of bytes used in this action
02 B Defines action2
0B/10 B Sprites are used for feature 0B - cargoes, or feature 10 - rail types
<set-id> B What set-ID this action2 defines
01 B A literal 01 byte
00 B A literal 00 byte
<set> W Number of set to use from the last action 1

You may note that this is the same as the action2 entry for vehicles, but with num_loadtypes=1 and num_loadingtypes=0, and only one set number.

Description

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

Set

A WORD value, the number of the sprite set to be used. (Don't forget that sprite set numbering starts from zero)