Difference between revisions of "Action2/Stations"

From GRFSpecs
Jump to navigationJump to search
m (7 revisions)
m (Bot: Automated text replacement (--= +==))
Line 1: Line 1:
   
 
== Introduction ==
'''''Defining station set-IDs'''''
 
   
=Action 2=
 
   
 
Defining station set-IDs.
 
Defining station set-IDs.
   
-=Introduction=-
 
   
 
For stations, action 2 is used to define set-IDs, similar to the way it works for vehicles.
 
For stations, action 2 is used to define set-IDs, similar to the way it works for vehicles.
   
  +
==Syntax==
-=Format=-
 
   
 
For stations, the data looks as follows:
 
For stations, the data looks as follows:
   
<pre> -+&lt;Sprite-number&gt; * &lt;Length&gt; 02 04 &lt;set-id&gt; &lt;numlittlesets&gt; &lt;numlotssets&gt; &lt;sets...&gt;+-</pre>
+
<Sprite-number> * <Length> 02 04 <set-id> <numlittlesets> <numlotssets> <sets...>
   
  +
{|
||'''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
   
  +
|-
04|B|Stations is feature 4
+
|04||B||Stations is feature 4
   
  +
|-
&lt;set-id&gt;|B|What set-ID this action2 defines
+
|<set-id>||B||What set-ID this action2 defines
   
  +
|-
&lt;numlittlesets&gt;|B|How many different cargo amounts to show when there is little cargo
+
|<numlittlesets>||B||How many different cargo amounts to show when there is little cargo
   
  +
|-
&lt;numlotssets&gt;|B|Same but when there is lots of cargo
+
|<numlotssets>||B||Same but when there is lots of cargo
   
  +
|-
&lt;sets...&gt;|W|Sprite sets for each of the cargo amounts||
+
|<sets...>||W||Sprite sets for each of the cargo amounts
  +
|}
   
  +
==Description==
-=Filling in the terms=-
 
   
 
===Sprite-number===
 
===Sprite-number===
Line 50: Line 58:
 
===numlittlesets, numlotssets===
 
===numlittlesets, numlotssets===
   
Like for vehicles, this decides the graphics set to use depending on the amount of cargo waiting. &nbsp;There are two caveats, though. &nbsp;Firstly, a station can have 12 different cargoes waiting, not just a single one. &nbsp;Secondly, the maximum amount is 4095 for all stations and all cargo types.
+
Like for vehicles, this decides the graphics set to use depending on the amount of cargo waiting. There are two caveats, though. Firstly, a station can have 12 different cargoes waiting, not just a single one. Secondly, the maximum amount is 4095 for all stations and all cargo types.
   
 
Regarding the first issue, the amount of cargo this refers to depends on the action3 that triggered this action2:
 
Regarding the first issue, the amount of cargo this refers to depends on the action3 that triggered this action2:
* if the cargo type matched exactly, it's the amount of the matching cargo (e.g. the action3 said &quot;for coal, use this action2&quot;)
+
* if the cargo type matched exactly, it's the amount of the matching cargo (e.g. the action3 said "for coal, use this action2")
 
* if the default was used, it's the amount of all cargo types added together
 
* if the default was used, it's the amount of all cargo types added together
 
* if the station is displayed for construction, the maximum amount is shown
 
* if the station is displayed for construction, the maximum amount is shown
   
Regarding the second issue, TTDPatch introduces the distinction between &quot;little&quot; and &quot;lots of&quot; cargo. &nbsp;The amount where this occurs is set by property 10, which is zero by default. &nbsp;But if set to a non-zero value, for example 200, then the range 0 to 199 is divided by numlittlesets, and the remaining range 200 to 4095 is divided by numlotssets. &nbsp;If property 10 is zero, the &quot;little&quot; sets are never used, and so numlittlesets may be zero. &nbsp;numlotssets must never be zero, however.
+
Regarding the second issue, TTDPatch introduces the distinction between "little" and "lots of" cargo. The amount where this occurs is set by property 10, which is zero by default. But if set to a non-zero value, for example 200, then the range 0 to 199 is divided by numlittlesets, and the remaining range 200 to 4095 is divided by numlotssets. If property 10 is zero, the "little" sets are never used, and so numlittlesets may be zero. numlotssets must never be zero, however.
   
 
===sets===
 
===sets===
Line 63: Line 71:
 
The sets from the most recent action1 to use for this set-ID, for each stage of numlittlesets and numlotssets, i.e. in total numlittlesets+numlotssets entries.
 
The sets from the most recent action1 to use for this set-ID, for each stage of numlittlesets and numlotssets, i.e. in total numlittlesets+numlotssets entries.
   
-=Notes=-
+
===Notes===
   
 
Do not skip an action2 using either action7 or action9 (unless those skip the whole file). Action2 must not be skipped or the patch will most likely crash. Skip or modify action3 instead.
 
Do not skip an action2 using either action7 or action9 (unless those skip the whole file). Action2 must not be skipped or the patch will most likely crash. Skip or modify action3 instead.
   
-=Example=-
+
==Example==
   
 
<span style='color:#808080'>Something to go here</span>
 
<span style='color:#808080'>Something to go here</span>

Revision as of 23:05, 14 June 2011

Introduction

Defining station set-IDs.


For stations, action 2 is used to define set-IDs, similar to the way it works for vehicles.

Syntax

For stations, the data looks as follows:

<Sprite-number> * <Length> 02 04 <set-id> <numlittlesets> <numlotssets> <sets...>
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
04 B Stations is feature 4
<set-id> B What set-ID this action2 defines
<numlittlesets> B How many different cargo amounts to show when there is little cargo
<numlotssets> B Same but when there is lots of cargo
<sets...> W Sprite sets for each of the cargo amounts

Description

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

Set-id

The set-ID that you want to define for this set. You can choose any value between 00 and FF, and you can reuse them within a grf file at a later point (if being equal to an existing set ID, the existing one is overwritten and the new one is used).

numlittlesets, numlotssets

Like for vehicles, this decides the graphics set to use depending on the amount of cargo waiting. There are two caveats, though. Firstly, a station can have 12 different cargoes waiting, not just a single one. Secondly, the maximum amount is 4095 for all stations and all cargo types.

Regarding the first issue, the amount of cargo this refers to depends on the action3 that triggered this action2:

  • if the cargo type matched exactly, it's the amount of the matching cargo (e.g. the action3 said "for coal, use this action2")
  • if the default was used, it's the amount of all cargo types added together
  • if the station is displayed for construction, the maximum amount is shown

Regarding the second issue, TTDPatch introduces the distinction between "little" and "lots of" cargo. The amount where this occurs is set by property 10, which is zero by default. But if set to a non-zero value, for example 200, then the range 0 to 199 is divided by numlittlesets, and the remaining range 200 to 4095 is divided by numlotssets. If property 10 is zero, the "little" sets are never used, and so numlittlesets may be zero. numlotssets must never be zero, however.

sets

The sets from the most recent action1 to use for this set-ID, for each stage of numlittlesets and numlotssets, i.e. in total numlittlesets+numlotssets entries.

Notes

Do not skip an action2 using either action7 or action9 (unless those skip the whole file). Action2 must not be skipped or the patch will most likely crash. Skip or modify action3 instead.

Example

Something to go here