I would recommend you join us in using the openttdcoop build system for grfs - you'll be able to lift quite a bit of FISH code, and you'll get a bit more help and support with problems.
Code: Select all
// PAX capacity is handled if missing.
// Freight capacity isn't - helps show up errors and omissions with individual ships (compile will fail).
#ifndef THIS_PAX_CAPACITY
#define THIS_PAX_CAPACITY 00 80 // // define without escapes and setting 80 to make it a cb result
#endif
// warning about default result being same as earlier - can be valid when freight capacity == PAX capacity
//@@WARNING DISABLE 100
-1 * 70 02 02 E1 // set refitted capacity according to cargo class
85 47 10 \w1 // var 47 in format ccccwwtt where I want cccc; mask for just bit 0 (PAX class)
\b1 // range
THIS_PAX_CAPACITY \wx01 \wx01 // PAX class
THIS_FREIGHT_CAPACITY // default
//@@WARNING ENABLE 100
-1 * 0 02 02 E0 //
81 10 00 FF
01 // range
E1 00 0D 0D // new capacity
A0 00 // default (end cb36 checks using ID for applying graphics)
#undef THIS_PAX_CAPACITY
#undef THIS_FREIGHT_CAPACITY
Compiled, it looks like this (this is all the nfo for a Ferry in FISH, except smoke + some strings):
Code: Select all
1498 * 51 00 02 \b18 01 72 // Action 0
00 \w01-01-1970 // date of introduction
03 \b35 // vehicle life in years
06 0F // climate availability - use 0F for all, 00 none (to hide vehicle)
07 \b30 // loading speed
08 FF // use new graphics
09 01 // refittable (0 = no, 1 = yes)
0A \b50 // cost factor (purchase cost)
0B \b48 // speed in mph * 3.2
0C 00 // cargo type
0D \w218 // capacity
0F \b83 // running cost factor
10 05 // sound effect (4=cargo ship, 5=passenger ship)
11 00 00 00 00 // cargo types available for refitting
12 00 // callbacks
17 02 // miscellaneous flags (inc. use 2CC)
18 FF 00 // refittable cargo classes
19 00 01 // non-refittable cargo classes
1A \d01-01-1870 // long format introduction date
1499 * 19 04 02 7F 01 72
01 2F
"Tiree Ferry" 00
1500 * 4 01 02 \b01 08
// buy menu sprites
1501 * 1 00
1502 * 1 00
1503 * 1 00
1504 * 1 00
1505 * 1 00
1506 * 1 00
1507 sprites/graphics/vehicle_ferry_small.pcx 620 29 01 22 116 -36 -10
1508 * 1 00
1509 * 9 02 02 B0 // buy menu
01 // number loaded states
01 // loading states
00 00 // loaded sprites
00 00 // loading sprites
1510 * 4 01 02 \b4 08
// \w00 default unloaded - not moving (no wash)
1511 sprites/graphics/vehicle_ferry_small.pcx 20 10 01 89 28 -14 -54
1512 sprites/graphics/vehicle_ferry_small.pcx 60 10 01 66 113 -61 -28
1513 sprites/graphics/vehicle_ferry_small.pcx 186 10 01 48 138 -36 -29
1514 sprites/graphics/vehicle_ferry_small.pcx 328 10 01 66 113 -10 -28
1515 sprites/graphics/vehicle_ferry_small.pcx 454 10 01 89 28 -14 -54
1516 sprites/graphics/vehicle_ferry_small.pcx 494 10 01 66 113 -55 -26
1517 sprites/graphics/vehicle_ferry_small.pcx 620 10 01 48 138 -36 -29
1518 sprites/graphics/vehicle_ferry_small.pcx 762 10 01 66 113 0 -24
// \w01 default unloaded - moving (wash)
1519 sprites/graphics/vehicle_ferry_small.pcx 20 110 01 89 28 -14 -54
1520 sprites/graphics/vehicle_ferry_small.pcx 60 110 01 66 113 -61 -28
1521 sprites/graphics/vehicle_ferry_small.pcx 186 110 01 48 138 -36 -29
1522 sprites/graphics/vehicle_ferry_small.pcx 328 110 01 66 113 -10 -28
1523 sprites/graphics/vehicle_ferry_small.pcx 454 110 01 89 28 -14 -54
1524 sprites/graphics/vehicle_ferry_small.pcx 494 110 01 66 113 -55 -26
1525 sprites/graphics/vehicle_ferry_small.pcx 620 110 01 48 138 -36 -29
1526 sprites/graphics/vehicle_ferry_small.pcx 762 110 01 66 113 0 -24
// \w02 default loaded - not moving (no wash)
1527 sprites/graphics/vehicle_ferry_small.pcx 20 510 01 89 28 -14 -54
1528 sprites/graphics/vehicle_ferry_small.pcx 60 510 01 66 113 -61 -28
1529 sprites/graphics/vehicle_ferry_small.pcx 186 510 01 48 138 -36 -29
1530 sprites/graphics/vehicle_ferry_small.pcx 328 510 01 66 113 -10 -28
1531 sprites/graphics/vehicle_ferry_small.pcx 454 510 01 89 28 -14 -54
1532 sprites/graphics/vehicle_ferry_small.pcx 494 510 01 66 113 -55 -26
1533 sprites/graphics/vehicle_ferry_small.pcx 620 510 01 48 138 -36 -29
1534 sprites/graphics/vehicle_ferry_small.pcx 762 510 01 66 113 0 -24
// \w03 default loaded - moving (wash)
1535 sprites/graphics/vehicle_ferry_small.pcx 20 610 01 89 28 -14 -54
1536 sprites/graphics/vehicle_ferry_small.pcx 60 610 01 66 113 -61 -28
1537 sprites/graphics/vehicle_ferry_small.pcx 186 610 01 48 138 -36 -29
1538 sprites/graphics/vehicle_ferry_small.pcx 328 610 01 66 113 -10 -28
1539 sprites/graphics/vehicle_ferry_small.pcx 454 610 01 89 28 -14 -54
1540 sprites/graphics/vehicle_ferry_small.pcx 494 610 01 66 113 -55 -26
1541 sprites/graphics/vehicle_ferry_small.pcx 620 610 01 48 138 -36 -29
1542 sprites/graphics/vehicle_ferry_small.pcx 762 610 01 66 113 0 -24
1543 * 13 02 02 B1 // default cargos - not moving
02 // number loaded states
02 // number loading states
\w00 \w02 // loaded sprites
\w00 \w02 // loading sprites
1544 * 11 02 02 B2 // default cargos - moving
02 // number loaded states
01 // number loading states
\w01 \w03 // loaded sprites
\w01 // loading sprites (n/a if moving)
1545 * 14 02 02 A0 // choose sprites according to vehicle speed
81 B4 00 FF //
01 // range
B1 00 00 00 // not moving (speed == 0)
B2 00 // moving (speed != 0)
// warning about default result being same as earlier - can be valid when freight capacity == PAX capacity
//@@WARNING DISABLE 100
1546 * 17 02 02 E1 // set refitted capacity according to cargo class
85 47 10 \w1 // var 47 in format ccccwwtt where I want cccc; mask for just bit 0 (PAX class)
\b1 // range
DA 80 \wx01 \wx01 // PAX class
7F 80 // default
//@@WARNING ENABLE 100
1547 * 14 02 02 E0 //
81 10 00 FF
01 // range
E1 00 0D 0D // new capacity
A0 00 // default (end cb36 checks using ID for applying graphics)
// handle callbacks etc - use separate varaction 2s for 'real' vehicles and buy menu - shared cb chain, different graphics IDs
1548 * 14 02 02 C0
81 0C 00 FF
01 // range
E0 00 36 36 // change vehicle properties
A0 00 // default
1549 * 14 02 02 C1 // buy menu
81 0C 00 FF //handle callbacks for buy menu
\b1 // range
A3 80 23 23 // text for vehicle window (unless using varact 2 chain, simply return ID of D0 text)
B0 00 //otherwise go to next action 2 ID
1550 * 10 03 02 01 72 // Action 3
01 // number of cargo types to support
FF C1 00 // buy menu sprites
C0 00 // default sprites