What`s wrong in my GRF?

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

What`s wrong in my GRF?

Post by Mpet »

Hello! I`m getting my first steps in GRF coding and I have one problem... I want to create articulated loco and refit screen with 9 different liveries like a WAS plane set. I write GRF and I have my loco in game but no refit screen is avialable. And i really don`t understand why... :( Somebody can help me to find my mistake? :bow:

Here is my code:

Code: Select all

    3 * 70	 00 00 1B 01 00 00 A0 2D 03 0F 04 28 06 07 05 00 09 5A 00 0B 6A 13 0D 8A 0E 3C 4C 00 00 12 FD 13
	 00 14 00 16 B4 17 37 18 0A 19 2B 1A 1B 1E 10 21 00 1F 31 24 00 22 34 27 02 28 00 00 29 00 00 1D 01 00 00 00 1C 0B
    4 * 4	 01 00 02 08
    5 sprites/allinone.pcx 6 6 01 23 7 -3 -8
   .....
   20 sprites/allinone.pcx 490 6 09 19 20 -5 -10
   21 * 9	 02 00 00 01 01 00 00 00 00
   22 * 9	 02 00 01 01 01 01 00 01 00
   23 * 14	 02 00 F1 81 41 00 FF 01 00 00 00 00 01 00
   24 * 4	 01 00 02 08
   25 sprites/allinone.pcx 6 44 01 23 7 -3 -8
   ....
   40 sprites/allinone.pcx 490 44 09 19 20 -5 -10
   41 * 9	 02 00 00 01 01 00 00 00 00
   42 * 9	 02 00 01 01 01 01 00 01 00
   43 * 14	 02 00 F2 81 41 00 FF 01 00 00 00 00 01 00
   44 * 4	 01 00 02 08
   45 sprites/allinone.pcx 6 83 01 23 7 -3 -8
   .....
   60 sprites/allinone.pcx 490 83 09 19 20 -5 -10
   61 * 9	 02 00 00 01 01 00 00 00 00
   62 * 9	 02 00 01 01 01 01 00 01 00
   63 * 14	 02 00 F3 81 41 00 FF 01 00 00 00 00 01 00
   64 * 4	 01 00 02 08
   65 sprites/allinone.pcx 6 120 01 23 7 -3 -8
  .....
  159 sprites/allinone.pcx 442 272 01 15 32 -16 -11
  160 sprites/allinone.pcx 490 272 09 19 20 -5 -10
  161 * 9	 02 00 00 01 01 00 00 00 00
  162 * 9	 02 00 01 01 01 01 00 01 00
  163 * 14	 02 00 F8 81 41 00 FF 01 00 00 00 00 01 00
  164 * 4	 01 00 02 08
  165 sprites/allinone.pcx 6 309 01 23 7 -3 -8
  166 sprites/allinone.pcx 22 309 09 19 20 -13 -11
  .....
  178 sprites/allinone.pcx 410 309 09 19 20 -14 -10
  179 sprites/allinone.pcx 442 309 01 15 32 -16 -11
  180 sprites/allinone.pcx 490 309 09 19 20 -5 -10
  181 * 9	 02 00 00 01 01 00 00 00 00
  182 * 9	 02 00 01 01 01 01 00 01 00
  183 * 14	 02 00 F9 81 41 00 FF 01 00 00 00 00 01 00
  .....
  206 sprites/allinone.pcx 675 6 01 1 1 0 0
  207 sprites/allinone.pcx 524 6 01 12 56 -28 -7
  208 sprites/allinone.pcx 707 6 01 1 1 0 0
  209 * 9	 02 00 12 01 01 00 00 00 00
  210 * 9	 02 00 13 01 01 01 00 01 00
  211 * 9	 02 00 14 01 01 02 00 02 00
  212 * 46	 02 00 20 81 F2 00 FF 08 F1 00 00 00 F2 00 01 01 F3 00 02 02 F4 00 03 03 F5 00 04 04 F6 00 05 05 F7 00 06 06 F8 00 07 07 F9 00 08 08 F1 00
  213 * 14	 02 00 21 81 10 00 FF 01 00 FF 01 01 FF FF
  214 * 14	 02 00 22 81 41 00 FF 01 02 FF 00 11 03 FF
//!!Warning (100): Default ID appears earlier in sprite.
  215 * 14	 02 00 23 81 40 00 FF 01 34 FF 00 01 34 FF
  216 * 46	 02 00 24 81 F2 00 FF 09 50 80 00 00 51 80 01 01 52 80 02 02 53 80 03 03 54 80 04 04 55 80 05 05 56 80 06 06 57 80 07 07 58 80 08 08 FF FF
  217 * 26	 02 00 25 81 0C 00 FF 04 21 00 16 16 22 00 11 11 23 00 10 10 24 00 19 19 20 00
  218 * 10	 03 00 01 00 01 FF 14 00 25 00
  219 * 101	 04 00 9F 0A "PР [grey\blue1]" 00 " [blue]" 00 " [green1]" 00 " [grey]" 00
	 " [grey\blue2]" 00 " [green2]" 00 " [green3]" 00
	 " [green4]" 00 " [green5]" 00 00
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

give me aprox 30 minutes, and i will give you some nicely commented code :D


edit:
Names first:

Code: Select all

-1 * 0  04 00 7F \b1 \wxD000 "Livery1" 00
-1 * 0  04 00 7F \b1 \wxD001 "Livery2" 00
-1 * 0  04 00 7F \b1 \wxD002 "Livery3" 00
-1 * 0  04 00 7F \b1 \wxD003 "Livery4" 00
-1 * 0  04 00 7F \b1 \wxD004 "Livery5" 00
-1 * 0  04 00 7F \b1 \wxD005 "Livery6" 00
-1 * 0  04 00 7F \b1 \wxD006 "Livery7" 00
-1 * 0  04 00 7F \b1 \wxD007 "Livery8" 00
-1 * 0  04 00 7F \b1 \wxD008 "Livery9" 00
Then gfx

Code: Select all

-1 * 0  01 00 \b18 04/08 // (04 if its 4 views per sprite, 08 if its 8 views per sprite)
<real sprites for the engine, livery1>
<real sprites for the tender, livery1>

<real sprites for the engine, livery2>
<real sprites for the tender, livery2>

<real sprites for the engine, livery3>
<real sprites for the tender, livery3>
etc

-1 * 0  02 00 10 01 01 \w0 \w0 // Action2 for the engine, livery1
-1 * 0  02 00 20 01 01 \w1 \w1 // Action2 for the tender, livery1

-1 * 0  02 00 11 01 01 \w2 \w2 // Action2 for the engine, livery2
-1 * 0  02 00 21 01 01 \w3 \w3 // Action2 for the tender, livery2

...


-1 * 0  02 00 18 01 01 \w16 \w16 // Action2 for the engine, livery9
-1 * 0  02 00 28 01 01 \w17 \w17 // Action2 for the tender, livery9
Now, to select the different livery GFX we need a varaction2, variable F2, this one for the engine

Code: Select all

-1 * 0  02 00 C0 81 F2 00 FF 09
                    10 00 \b0 \b0 // Add "action2ID" 10 (aka cargoid) for the first livery
                    11 00 \b1 \b1 // 11 for the second,
                    ETC
                    18 00 \b8 \b8 // Last one
                    FF FF         // Terminate
The tender needs something similar:

Code: Select all

-1 * 0  02 00 C1 81 F2 00 FF 09
                    20 00 \b0 \b0 // Add "action2ID" 20 (aka cargoid) for the first livery
                    21 00 \b1 \b1 // 21 for the second,
                    ETC
                    28 00 \b8 \b8 // Last one
                    FF FF         // Terminate
You also need to add in the names in the refit-list, half the point, right? :)
-1 * 0 02 00 C2 81 F2 00 FF 09
00 80 \b0 \b0 // Add textID D000 (i.e. 00 80) for the first livery
01 80 \b1 \b1 // "" D001 (i.e. 01 80) "
ETC
08 80 \b9 \b9 // Last one
FF FF
[/code]

Then add tender to the articulation-information, assumeing the tender is vehicleID 25. When i code, i always define the tender as a separate vehicleID. Many might disagree with me, but this ensures that any vehicle (also above 127) can be used in combination with an articulation.

Code: Select all

-1 * 0  02 00 C3 81 10 00 FF 01 // Varaction2, extra callback info
                    25 80 01 01 // Add vehicle id 25 at position 01 in the train
                    FF FF       // Terminate
Now we can do the "proper" callbacks for the two parts:
Engine first:

Code: Select all

-1 * 0  02 00 CE 81 0C 00 FF 02 // two callbacks
                    C2 00 19 19 // callback19, the names
                    C3 00 16 16 // The articulation
                    C0 00       // apply gfx
Then the tender:

Code: Select all

-1 * 0  02 00 CF 81 0C 00 FF 01 // 1 callback
                    C3 00 16 16 // The articulation
                    C1 00       // apply gfx
Now for the action3:

Code: Select all

-1 * 0  03 00 01 <vehicleID> 00 FF 00
-1 * 0  03 00 81 25          00 FF 00      

Note:
not tested, just taked out of my mind, so there _might_ be a bug
Last edited by DJ Nekkid on 03 Dec 2010 15:22, edited 1 time in total.
Member of the
ImageImage
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

Oh it would be cool! :D
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: What`s wrong in my GRF?

Post by maquinista »

If You want, I cand send You the code of a EMU with lots of liveries and graphics that doesn't turn 180º at the end of line. It would be interesting if You plan to code a asymmetric EMU, with the pantographs in the first car.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

Thanks DJ Nekkid! :) I try it and at this moment unsuccessfully. I have a Kirby Paul Tank in menu (he have 00 ID how and my loco) :lol:
What doing this code?:

Code: Select all

-1 * 0  03 00 01 <vehicleID> 00 FF 00
-1 * 0  03 00 81 25          00 FF 00 
Are you sure about these FF`s?

I change first FF to CE and now I have first section of MY loco but coupled wuth nice armoured van. =))) Armoured van has ID 25...

Upd: I change all 25 ID`s to my 00 ID and last FF to CF. Now I have my loco, but again without refit screen...
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

no, its supposed to be:

Code: Select all

-1 * 0  03 00 01 <engine-vehicleID> 00 CE 00
-1 * 0  03 00 81 <tender-vehicle-ID> 00 CF 00 
what this is...

well, action3's attach the graphics and callbacks and all to the vehicle ID
the second one is the socalled "livery override", and it attach the gfx (etc) to the tender

ps.
Remember to add the proper callbacks to the action0's as well
Member of the
ImageImage
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: What`s wrong in my GRF?

Post by maquinista »

I have read your PM. I will publish these code here. This code was made from almost scratch, because It's very different from the original code written by death. He did a great work, but I was unable to improve this train without a total rewrite of their code.

Note that when the train reach at the end of line, the "locomotive" shows the rear car sprites, and the rear car shows the "locomotive" sprites. Also, most of liveries shows always the same middle wagon, but some of them uses two liveries when it reach to the end of line and the train runs backwards.

Everyone can use this code freely, because I have written it, and I allows their usage under Your favourite license. You can change the number of liveries, and replace the sprites to use in your asymmetric (M-R-Rc) EMUs.

Train properties with action 0:

Code: Select all

   87 * 69	 00 00 1A 01 3E 00 0C 4D 02 20 03 28 04 FF 06 07
07 FF 05 00 08 01 09 8C 00 0B 06 02
0E "<L" 00 00 12 FD 13 00 14 37 15 00 16 2C
   19 29    1B 07 02    1C 01    1D 00 00 00 00    1E 21    1F 2A    23 17    27 06    28 01 00    29 00 00 //Caperucita 440 emu
Strings, there are more than these strings (used by other trains), but this train doesn't use more:

Code: Select all

// 48h text strings
//English
  158 * 2174	 04 00 FF 4B 00 D0
 " (milk)" 00
 " (liquid)" 00
 8B "NOTE: " 98 "Only Regional Passengers Cars and Mail Coaches can be attatched." 00
 8B "NOTE: " 98 "Only Long Distance Cars and Mail Coaches can be attatched." 0D "Recomended: M-R-R-R-R-M also M-R-R-R could be used." 00
 8B "NOTE: " 98 "No wagon can be attatched." 00
 " (olive-oil)" 00
 "This train only allows to attach Regional Passengers Cars" 00
 "This train only allows to attach Long Distance Passengers Cars" 00
 "This train doesn't allows to attach wagons" 00
 "This train only allows to attach Talgo Passengers Cars" 00
 " Regional" 00        // 0Ah
 " Regional Refurbished" 00
 " Commuter" 00
 " Commuter Refurbished" 00
 " Regional 2005" 00
 " Regional Refurbished blue" 00
 " Regional Refurbished 2005" 00       // 10h
 " Commuter Refurbished 2005" 00
 " Regional orange band" 00
 " Regional orange front" 00
 " Regional inclined bands" 00
 " Regional yellow front" 00
 " Original" 00           //  16h
(...)
And the Action 1/2/3 for the sprites:

Code: Select all

//tren 440 EMU
 4792 * 4	 01 00 4A 08
//Locomotive
 4793 sprites/440-470.pcx   0   0 01 23 8 -3 -10
 4794 sprites/440-470.pcx  10   0 09 16 22 -13 -8
 4795 sprites/440-470.pcx  34   0 01 15 32 -15 -9
 4796 sprites/440-470.pcx  68   0 09 18 22 -5 -9
 4797 sprites/440-470.pcx  92   0 01 24 8 -3 -11
 4798 sprites/440-470.pcx 102   0 09 18 22 -13 -10
 4799 sprites/440-470.pcx 126   0 01 15 32 -15 -9
 4800 sprites/440-470.pcx 160   0 09 16 22 -5 -7
//Locomotive backwards
 4801 sprites/440-470.pcx  92   25 01 23 8 -3 -10
 4802 sprites/440-470.pcx 102   25 09 16 22 -13 -8
 4803 sprites/440-470.pcx 126   25 01 15 32 -15 -9
 4804 sprites/440-470.pcx 160   25 09 18 22 -5 -9
 4805 sprites/440-470.pcx   0   25 01 24 8 -3 -11
 4806 sprites/440-470.pcx  10   25 09 18 22 -13 -10
 4807 sprites/440-470.pcx  34   25 01 15 32 -15 -9
 4808 sprites/440-470.pcx  68   25 09 16 22 -5 -7
// Rear wagon
 4809 sprites/440-470.pcx   0   50 01 23 8 -3 -10
 4810 sprites/440-470.pcx  10   50 09 16 22 -13 -8
 4811 sprites/440-470.pcx  34   50 01 12 32 -15 -6
 4812 sprites/440-470.pcx  68   50 09 16 22 -5 -7
 4813 sprites/440-470.pcx  92   50 01 23 8 -3 -10
 4814 sprites/440-470.pcx 102   50 09 16 22 -13 -8
 4815 sprites/440-470.pcx 126   50 01 12 32 -15 -6
 4816 sprites/440-470.pcx 160   50 09 16 22 -5 -7
 // Rear wagon backwards
 4817 sprites/440-470.pcx  92   75 01 23 8 -3 -10
 4818 sprites/440-470.pcx 102   75 09 16 22 -13 -8
 4819 sprites/440-470.pcx 126   75 01 12 32 -15 -6
 4820 sprites/440-470.pcx 160   75 09 16 22 -5 -7
 4821 sprites/440-470.pcx   0   75 01 23 8 -3 -10
 4822 sprites/440-470.pcx  10   75 09 16 22 -13 -8
 4823 sprites/440-470.pcx  34   75 01 12 32 -15 -6
 4824 sprites/440-470.pcx  68   75 09 16 22 -5 -7
 // middle wagon (normal and backwards)
 4825 sprites/440-470.pcx   0  100 01 23 8 -3 -10
 4826 sprites/440-470.pcx  10  100 09 16 22 -13 -8
 4827 sprites/440-470.pcx  34  100 01 12 32 -15 -6
 4828 sprites/440-470.pcx  68  100 09 16 22 -5 -7
 4829 sprites/440-470.pcx  92  100 01 23 8 -3 -10
 4830 sprites/440-470.pcx 102  100 09 16 22 -13 -8
 4831 sprites/440-470.pcx 126  100 01 12 32 -15 -6
 4832 sprites/440-470.pcx 160  100 09 16 22 -5 -7

// Commuter original
 // locomotive normal
 4833 sprites/440-470.pcx   0  125 01 23 8 -3 -10
 4834 sprites/440-470.pcx  10  125 09 16 22 -13 -8
 4835 sprites/440-470.pcx  34  125 01 15 32 -15 -9
 4836 sprites/440-470.pcx  68  125 09 18 22 -5 -9
 4837 sprites/440-470.pcx  92  125 01 24 8 -3 -11
 4838 sprites/440-470.pcx 102  125 09 18 22 -13 -10
 4839 sprites/440-470.pcx 126  125 01 15 32 -15 -9
 4840 sprites/440-470.pcx 160  125 09 16 22 -5 -7
 // locomotive backwards
 4841 sprites/440-470.pcx  92  150 01 23 8 -3 -10
 4842 sprites/440-470.pcx 102  150 09 16 22 -13 -8
 4843 sprites/440-470.pcx 126  150 01 15 32 -15 -9
 4844 sprites/440-470.pcx 160  150 09 18 22 -5 -9
 4845 sprites/440-470.pcx   0  150 01 24 8 -3 -11
 4846 sprites/440-470.pcx  10  150 09 18 22 -13 -10
 4847 sprites/440-470.pcx  34  150 01 15 32 -15 -9
 4848 sprites/440-470.pcx  68  150 09 16 22 -5 -7
 // Rear wagon normal
 4849 sprites/440-470.pcx   0  175 01 23 8 -3 -10
 4850 sprites/440-470.pcx  10  175 09 16 22 -13 -8
 4851 sprites/440-470.pcx  34  175 01 12 32 -15 -6
 4852 sprites/440-470.pcx  68  175 09 16 22 -5 -7
 4853 sprites/440-470.pcx  92  175 01 23 8 -3 -10
 4854 sprites/440-470.pcx 102  175 09 16 22 -13 -8
 4855 sprites/440-470.pcx 126  175 01 12 32 -15 -6
 4856 sprites/440-470.pcx 160  175 09 16 22 -5 -7
 // Rear wagon backwards
 4857 sprites/440-470.pcx  92  200 01 23 8 -3 -10
 4858 sprites/440-470.pcx 102  200 09 16 22 -13 -8
 4859 sprites/440-470.pcx 126  200 01 12 32 -15 -6
 4860 sprites/440-470.pcx 160  200 09 16 22 -5 -7
 4861 sprites/440-470.pcx   0  200 01 23 8 -3 -10
 4862 sprites/440-470.pcx  10  200 09 16 22 -13 -8
 4863 sprites/440-470.pcx  34  200 01 12 32 -15 -6
 4864 sprites/440-470.pcx  68  200 09 16 22 -5 -7
 // middle wagon (only normal)
 4865 sprites/440-470.pcx   0  225 01 23 8 -3 -10
 4866 sprites/440-470.pcx  10  225 09 16 22 -13 -8
 4867 sprites/440-470.pcx  34  225 01 12 32 -15 -6
 4868 sprites/440-470.pcx  68  225 09 16 22 -5 -7
 4869 sprites/440-470.pcx  92  225 01 23 8 -3 -10
 4870 sprites/440-470.pcx 102  225 09 16 22 -13 -8
 4871 sprites/440-470.pcx 126  225 01 12 32 -15 -6
 4872 sprites/440-470.pcx 160  225 09 16 22 -5 -7

// R1
 // locomotive normal
 4873 sprites/440-470.pcx   0  250 01 23 8 -3 -10
 4874 sprites/440-470.pcx  10  250 09 16 22 -13 -8
 4875 sprites/440-470.pcx  34  250 01 15 32 -15 -9
 4876 sprites/440-470.pcx  68  250 09 18 22 -5 -9
 4877 sprites/440-470.pcx  92  250 01 24 8 -3 -11
 4878 sprites/440-470.pcx 102  250 09 18 22 -13 -10
 4879 sprites/440-470.pcx 126  250 01 15 32 -15 -9
 4880 sprites/440-470.pcx 160  250 09 16 22 -5 -7
 // locomotive backwards
 4881 sprites/440-470.pcx  92  275 01 23 8 -3 -10
 4882 sprites/440-470.pcx 102  275 09 16 22 -13 -8
 4883 sprites/440-470.pcx 126  275 01 15 32 -15 -9
 4884 sprites/440-470.pcx 160  275 09 18 22 -5 -9
 4885 sprites/440-470.pcx   0  275 01 24 8 -3 -11
 4886 sprites/440-470.pcx  10  275 09 18 22 -13 -10
 4887 sprites/440-470.pcx  34  275 01 15 32 -15 -9
 4888 sprites/440-470.pcx  68  275 09 16 22 -5 -7
 // Rear wagon normal
 4889 sprites/440-470.pcx   0  300 01 23 8 -3 -10
 4890 sprites/440-470.pcx  10  300 09 16 22 -13 -8
 4891 sprites/440-470.pcx  34  300 01 12 32 -15 -6
 4892 sprites/440-470.pcx  68  300 09 16 22 -5 -7
 4893 sprites/440-470.pcx  92  300 01 23 8 -3 -10
 4894 sprites/440-470.pcx 102  300 09 16 22 -13 -8
 4895 sprites/440-470.pcx 126  300 01 12 32 -15 -6
 4896 sprites/440-470.pcx 160  300 09 16 22 -5 -7
 // Rear wagon backwards
 4897 sprites/440-470.pcx  92  325 01 23 8 -3 -10
 4898 sprites/440-470.pcx 102  325 09 16 22 -13 -8
 4899 sprites/440-470.pcx 126  325 01 12 32 -15 -6
 4900 sprites/440-470.pcx 160  325 09 16 22 -5 -7
 4901 sprites/440-470.pcx   0  325 01 23 8 -3 -10
 4902 sprites/440-470.pcx  10  325 09 16 22 -13 -8
 4903 sprites/440-470.pcx  34  325 01 12 32 -15 -6
 4904 sprites/440-470.pcx  68  325 09 16 22 -5 -7
 // middle wagon (normal and backwards)
 4905 sprites/440-470.pcx   0  350 01 23 8 -3 -10
 4906 sprites/440-470.pcx  10  350 09 16 22 -13 -8
 4907 sprites/440-470.pcx  34  350 01 12 32 -15 -6
 4908 sprites/440-470.pcx  68  350 09 16 22 -5 -7
 4909 sprites/440-470.pcx  92  350 01 23 8 -3 -10
 4910 sprites/440-470.pcx 102  350 09 16 22 -13 -8
 4911 sprites/440-470.pcx 126  350 01 12 32 -15 -6
 4912 sprites/440-470.pcx 160  350 09 16 22 -5 -7
// Commuter middle wagon reversed
 4913 sprites/440-470.pcx  92  225 01 23  8 -3 -10
 4914 sprites/440-470.pcx 102  225 09 16 22 -13 -8
 4915 sprites/440-470.pcx 126  225 01 12 32 -15 -6
 4916 sprites/440-470.pcx 160  225 09 16 22 -5  -7
 4917 sprites/440-470.pcx   0  225 01 23  8 -3 -10
 4918 sprites/440-470.pcx  10  225 09 16 22 -13 -8
 4919 sprites/440-470.pcx  34  225 01 12 32 -15 -6
 4920 sprites/440-470.pcx  68  225 09 16 22  -5 -7

// R2
 4921 sprites/440-470.pcx   0  375 01 23 8 -3 -10
 4922 sprites/440-470.pcx  10  375 09 16 22 -13 -8
 4923 sprites/440-470.pcx  34  375 01 15 32 -15 -9
 4924 sprites/440-470.pcx  68  375 09 18 22 -5 -9
 4925 sprites/440-470.pcx  92  375 01 24 8 -3 -11
 4926 sprites/440-470.pcx 102  375 09 18 22 -13 -10
 4927 sprites/440-470.pcx 126  375 01 15 32 -15 -9
 4928 sprites/440-470.pcx 160  375 09 16 22 -5 -7
There are lots of more PCX sprites, I have the complete code attached,

Code: Select all

 5385 * 9	 02 00 00 01 01 00 00 00 00 // Original colours
 5386 * 9	 02 00 01 01 01 01 00 01 00
 5387 * 9	 02 00 02 01 01 02 00 02 00
 5388 * 9	 02 00 03 01 01 03 00 03 00
 5389 * 9	 02 00 04 01 01 04 00 04 00

 5390 * 9	 02 00 05 01 01 05 00 05 00 // commuter original
 5391 * 9	 02 00 06 01 01 06 00 06 00
 5392 * 9	 02 00 07 01 01 07 00 07 00
 5393 * 9	 02 00 08 01 01 08 00 08 00
 5394 * 9	 02 00 09 01 01 09 00 09 00
 5395 * 9	 02 00 0F 01 01 0F 00 0F 00

 5396 * 9	 02 00 0A 01 01 0A 00 0A 00 // Regional R1
 5397 * 9	 02 00 0B 01 01 0B 00 0B 00
 5398 * 9	 02 00 0C 01 01 0C 00 0C 00
 5399 * 9	 02 00 0D 01 01 0D 00 0D 00
 5400 * 9	 02 00 0E 01 01 0E 00 0E 00

 5401 * 9	 02 00 10 01 01 10 00 10 00 // Regional R2
 5402 * 9	 02 00 11 01 01 11 00 11 00
 5403 * 9	 02 00 12 01 01 12 00 12 00
 5404 * 9	 02 00 13 01 01 13 00 13 00
 5405 * 9	 02 00 14 01 01 14 00 14 00

 5406 * 9	 02 00 15 01 01 15 00 15 00 // Regional delta
 5407 * 9	 02 00 16 01 01 16 00 16 00
 5408 * 9	 02 00 17 01 01 17 00 17 00
 5409 * 9	 02 00 18 01 01 18 00 18 00
 5410 * 9	 02 00 19 01 01 19 00 19 00
 5411 * 9	 02 00 1F 01 01 1F 00 1F 00

 5412 * 9	 02 00 1A 01 01 1A 00 1A 00 // Regional experimental
 5413 * 9	 02 00 1B 01 01 1B 00 1B 00
 5414 * 9	 02 00 1C 01 01 1C 00 1C 00
 5415 * 9	 02 00 1D 01 01 1D 00 1D 00
 5416 * 9	 02 00 1E 01 01 1E 00 1E 00
There are more action 2 like these.
And now, the rest of action 2 and the action 3 for regional cars and the "locomotive".
Attachments
440 emucode.txt
Sourcecode for this EMU train.
(46.45 KiB) Downloaded 168 times
440-470.pcx
Sprites
(170.67 KiB) Downloaded 166 times
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

Thanks maquinista!
Remember to add the proper callbacks to the action0's as well
Do you mean "Callback flags bit mask"? I set it on 30. Right?

So I change 25 to 00 (my loco ID. If I use any another he couple as a tender some objects from standard OTTD graphics like a armoured van - ID 25) here:

Code: Select all

  179 * 14	 02 00 C3 81 10 00 FF 01 00 FF 01 01 FF FF
  ......
  183 * 7	 03 00 81 00 00 CF 00 
Now I have correctly working loco, but again he is not have refitting screen! :cry: I really don`t understand why.

Final code:

Code: Select all

    2 * 17	 04 00 9F 01 00 D0 "grey-blue1" 00
    3 * 11	 04 00 9F 01 01 D0 "blue" 00 
    4 * 13	 04 00 9F 01 02 D0 "green1" 00
    5 * 11	 04 00 9F 01 03 D0 "grey" 00
    6 * 17	 04 00 9F 01 04 D0 "grey-blue2" 00
    7 * 13	 04 00 9F 01 05 D0 "green2" 00
    8 * 13	 04 00 9F 01 06 D0 "green3" 00
    9 * 13	 04 00 9F 01 07 D0 "green4" 00
   10 * 13	 04 00 9F 01 08 D0 "green5" 00
   11 * 58	 04 00 07 01 00 C3 9E D0 92 D0 9B "-8 'Р" 92 "РёР»С" 8C "гелС" 8C "Рј' "
	 "(С" 8D "лекС" 82 D1 80 "РѕРІРѕР·)" 00
   12 * 70	 00 00 1B 01 00 00 A0 2D 03 0F 04 28 06 07 05 00 09 5A 00 0B 6A 13 0D 8A 0E 3C 4C 00 00 12 FD 13
	 00 14 00 16 B4 17 37 18 0A 19 2B 1A 1B 1E 30 21 00 1F 31 24 00 22 34 27 02 28 00 00 29 00 00 1D 00 00 00 00 1C 0B
   13 * 4	 01 00 12 08
   14 sprites/allinone.pcx 6 6 01 23 7 -3 -8
   15 sprites/allinone.pcx 22 6 09 19 20 -13 -11
  .....................................................................
  156 sprites/allinone.pcx 442 309 01 15 32 -16 -11
  157 sprites/allinone.pcx 490 309 09 19 20 -5 -10
  158 * 9	 02 00 10 01 01 00 00 00 00
  159 * 9	 02 00 20 01 01 01 00 01 00
  160 * 9	 02 00 11 01 01 02 00 02 00
  161 * 9	 02 00 21 01 01 03 00 03 00
  162 * 9	 02 00 12 01 01 04 00 04 00
  163 * 9	 02 00 22 01 01 05 00 05 00
  164 * 9	 02 00 13 01 01 06 00 06 00
  165 * 9	 02 00 23 01 01 07 00 07 00
  166 * 9	 02 00 14 01 01 08 00 08 00
  167 * 9	 02 00 24 01 01 09 00 09 00
  168 * 9	 02 00 15 01 01 0A 00 0A 00
  169 * 9	 02 00 25 01 01 0B 00 0B 00
  170 * 9	 02 00 16 01 01 0C 00 0C 00
  171 * 9	 02 00 26 01 01 0D 00 0D 00
  172 * 9	 02 00 17 01 01 0E 00 0E 00
  173 * 9	 02 00 27 01 01 0F 00 0F 00
  174 * 9	 02 00 18 01 01 10 00 10 00
  175 * 9	 02 00 28 01 01 11 00 11 00
  176 * 46	 02 00 C0 81 F2 00 FF 09 10 00 00 00 11 00 01 01 12 00 02 02 13 00 03 03 14 00 04 04 15 00 05 05 16 00 06 06 17 00 07 07 18 00 08 08 FF FF
  177 * 46	 02 00 C1 81 F2 00 FF 09 20 00 00 00 21 00 01 01 22 00 02 02 23 00 03 03 24 00 04 04 25 00 05 05 26 00 06 06 27 00 07 07 28 00 08 08 FF FF
  178 * 46	 02 00 C2 81 F2 00 FF 09 00 80 00 00 01 80 01 01 02 80 02 02 03 80 03 03 04 80 04 04 05 80 05 05 06 80 06 06 07 80 07 07 08 80 08 08 FF FF
  179 * 14	 02 00 C3 81 10 00 FF 01 00 FF 01 01 FF FF
  180 * 18	 02 00 CE 81 0C 00 FF 02 C2 00 19 19 C3 00 16 16 C0 00
  181 * 14	 02 00 CF 81 0C 00 FF 01 C3 00 16 16 C1 00
  182 * 7	 03 00 01 00 00 CE 00
  183 * 7	 03 00 81 00 00 CF 00 	
Why?? Suicidal things! :)
Maybe some mistake in Action0?
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

Mpet wrote:Do you mean "Callback flags bit mask"? I set it on 30. Right?
Property 1E ... I usually just set it to FF (everything is enabled), so i dont have to bugtrace it afterwards... (but 30 will work in this case)

And to quote the guys i thought NFO of, break it down abit, much easier to read, and much easier to spot bugs...

And here is (probably) working code with the engine haveing vehicleID 01, and the tender 00:

Code: Select all


  176 * 46    02 00 C0 81 F2 00 FF 09        // Engine gfx
                                10 00 00 00 
                                11 00 01 01 
                                12 00 02 02 
                                13 00 03 03 
                                14 00 04 04 
                                15 00 05 05 
                                16 00 06 06 
                                17 00 07 07 
                                18 00 08 08 
                                FF FF
  177 * 46    02 00 C1 81 F2 00 FF 09        // Tender gfx
                                20 00 00 00 
                                21 00 01 01 
                                22 00 02 02 
                                23 00 03 03 
                                24 00 04 04 
                                25 00 05 05 
                                26 00 06 06 
                                27 00 07 07 
                                28 00 08 08 
                                FF FF
  178 * 46    02 00 C2 81 F2 00 FF 09        // names
                                00 80 00 00 
                                01 80 01 01 
                                02 80 02 02 
                                03 80 03 03 
                                04 80 04 04 
                                05 80 05 05 
                                06 80 06 06 
                                07 80 07 07 
                                08 80 08 08 
                                FF FF
  179 * 14    02 00 C3 81 10 00 FF 01        // Articulation info
                                00 80 01 01  // Add vehicleID 00 at position 1 
                                FF FF        // Terminate
  
// Callbacks engine
  180 * 18    02 00 CE 81 0C 00 FF 02 
                                C2 00 19 19  // Callback 19, names
                                C3 00 16 16  // Callback 16, articulation
                                C0 00        // attach gfx
// Callbacks Tender
  181 * 14    02 00 CF 81 0C 00 FF 01 
                                C3 00 19 19  // Names
                                C1 00        // attach gfx
  182 * 7    03 00 01 01 00 CE 00            // Action0, for trains, one train,       vehicle ID, 0 additional cargos, use CE 00 for "default" 
  183 * 7    03 00 81 00 00 CF 00            // Action0, for trains, livery override, vehicle ID, 0 additional cargos, use CF 00 for "default"
Member of the
ImageImage
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

If I make it I have rubbish Kirby Paul Tank... :cry:
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

Now, this code might be abit more then you were looking for, but this is the code for the BR class 466 from the BROS-set (far from finished all in all).

The reason the code i wrote earlier might not work is because i tend to makesome autogenerated code from a template, and it selects the parts it needs etc... And it all is sort of psuedo-code before it turns into real code; but here goes:

Code: Select all


// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>>
// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4	 3F 00 00 00

    // Action 8: define GRF version (07), GRFID (number), Name and Description.
    1 * 50	 08 07 "TST" 00 "TEST grf by DJ Nekkid" 00 "TEST grf by DJ Nekkid" 00

    // Action 0 - Tender
    2 * 79	 00 00 \b30 01 00
// Game related props 
  02 \b01			// Reliability Decay
  03 \b20		// Vehicle Life/Years
  04 \b20		// Model Life/Years
  05 \b0		// Track type; 00 Rail, 01 Mono, 02 Mlev
  06 \b0			// Climate availability
  07 \b00	// Loading Speed - Not needed in most cases
  08 \b00	// AI Pax optimized

// Physical properties
  00 \w1920-01-01               // Intro year \wyyyy-mm-dd
  2A \d1950-01-01		// Introyear in days after year 0, with leapyears, except every 400 yrs (year*365,24)
  09 \wxffff		// Speed (word)
  0B \w0000		// Power in HP (word)
  1F \b000		// Tractive effort
  16 \b000            // Weight/Tons
  24 \b0       // Highbyte on engines weighing >255 tons
  20 20                         // Air Drag

// Economical properties
  14 \b0      // Cargo Capacity
  15 \b0		// Cargo Type
  1D \d0		// Refit bitmask
  28 \w0      // New cargo classes
  29 \wxFFFF   // New NOT Cargo classes
  0D \b25             // RUN Cost Factor
  0E \dx4C30            // RUN cost Base
  17 \b25             // Cost Factor
  1C \b0		// Refit cost

// Misc
  12 FD	// Use new grapics
  19 28     // Traction type (maglev, rail, monorail)
  13 00          // Dualhead? 00/01 (should "always" be 00)
  1E FF         // Callbacks
  21 00      // Shorter vehicle
  27 00              // 01 tilt + 02 2cc + 04 xMU


// Action 0
    3 * 79	 00 00 \b30 01 \b*89
// Game related props 
  02 \b01 // Reliability Decay
  03 \b35 // Vehicle Life/Years
  04 \b255 // Model Life/Years
  05 \b2 // Track type; 00 Rail, 01 Mono, 02 Mlev
  06 0F // Climate availability
  07 \b10 // Loading Speed - Not needed in most cases
  08 00 // AI Pax optimized

// Physical properties
  00 \w1920-01-01 // Intro year \wyyyy-mm-dd
  2A \d1991-1-1 // Introyear in days after year 0, with leapyears, except every 400 yrs (year*365,24)
  09 \w120 // Speed (word)
  0B \w804 // Power in HP (word)
//1B THIS_ENG_WAG_HP            // Power in HP on attached wagons
  1F \b49 // Tractive effort
  16 \b72 // Weight/Tons
  24 \b0 // Highbyte on engines weighing >255 tons
  20 20 // Air Drag

// Economical properties
  14 \b86 // Cargo Capacity
  15 00 // Cargo Type
  1D \dx0 // Refit bitmask
  28 \wx01 // New cargo classes
  29 \wxFFFE // New NOT Cargo classes
  0D \b0 // RUN Cost Factor
  0E \dx4C30 // RUN cost Base
  17 \b0 // Cost Factor
  1C 00 // Refit cost

// Misc
  12 FD // Use new grapics
  19 28 // Traction type (maglev, rail, monorail)
  13 00 // Dualhead? 00/01 (should "always" be 00)
  1E FF // Callbacks
  21 0 // Shorter vehicle
  27 02 // 01 tilt + 02 2cc + 04 xMU

    4 * 4	 01 00 \b2 08

    5 sprites/gfx/class466/network_southeast.png 01 01 01 24 08 -03 -12 //	1
    6 sprites/gfx/class466/network_southeast.png 10 01 01 20 22 -14 -12 //	1
    7 sprites/gfx/class466/network_southeast.png 33 01 01 16 32 -16 -12
    8 sprites/gfx/class466/network_southeast.png 66 01 01 20 22 -06 -12
    9 sprites/gfx/class466/network_southeast.png 89 01 01 24 08 -03 -12
   10 sprites/gfx/class466/network_southeast.png 98 01 01 20 22 -14 -12
   11 sprites/gfx/class466/network_southeast.png 121 01 01 16 32 -16 -12
   12 sprites/gfx/class466/network_southeast.png 154 01 01 20 22 -06 -12


   13 sprites/gfx/class466/southeastern.png 01 01 01 24 08 -03 -12
   14 sprites/gfx/class466/southeastern.png 10 01 01 20 22 -14 -12
   15 sprites/gfx/class466/southeastern.png 33 01 01 16 32 -16 -12
   16 sprites/gfx/class466/southeastern.png 66 01 01 20 22 -06 -12
   17 sprites/gfx/class466/southeastern.png 89 01 01 24 08 -03 -12
   18 sprites/gfx/class466/southeastern.png 98 01 01 20 22 -14 -12
   19 sprites/gfx/class466/southeastern.png 121 01 01 16 32 -16 -12
   20 sprites/gfx/class466/southeastern.png 154 01 01 20 22 -06 -12
  //	1										
 // Action2 for unit1												
   21 * 9	 02 00 11 01 01 \w0 \w0 //											
   22 * 9	 02 00 12 01 01 \w1 \w1 //											
 // Change GFX for Unit based on livery1		160										
   23 * 18	 02 00 A0 81 F2 00 FF \b2
  11 00 \b0 \b0
  12 00 \b1 \b1
 FF FF

   24 * 4	 01 00 \b2 08

   25 sprites/gfx/class466/network_southeast.png 01 32 01 24 08 -03 -12 //	2
   26 sprites/gfx/class466/network_southeast.png 10 32 01 20 22 -14 -12 //	1
   27 sprites/gfx/class466/network_southeast.png 33 32 01 16 32 -16 -12
   28 sprites/gfx/class466/network_southeast.png 66 32 01 20 22 -06 -12
   29 sprites/gfx/class466/network_southeast.png 89 32 01 24 08 -03 -12
   30 sprites/gfx/class466/network_southeast.png 98 32 01 20 22 -14 -12
   31 sprites/gfx/class466/network_southeast.png 121 32 01 16 32 -16 -12
   32 sprites/gfx/class466/network_southeast.png 154 32 01 20 22 -06 -12


   33 sprites/gfx/class466/southeastern.png 01 32 01 24 08 -03 -12
   34 sprites/gfx/class466/southeastern.png 10 32 01 20 22 -14 -12
   35 sprites/gfx/class466/southeastern.png 33 32 01 16 32 -16 -12
   36 sprites/gfx/class466/southeastern.png 66 32 01 20 22 -06 -12
   37 sprites/gfx/class466/southeastern.png 89 32 01 24 08 -03 -12
   38 sprites/gfx/class466/southeastern.png 98 32 01 20 22 -14 -12
   39 sprites/gfx/class466/southeastern.png 121 32 01 16 32 -16 -12
   40 sprites/gfx/class466/southeastern.png 154 32 01 20 22 -06 -12
  //	1										
 // Action2 for unit2												
   41 * 9	 02 00 11 01 01 \w0 \w0 //											
   42 * 9	 02 00 12 01 01 \w1 \w1 //											
 // Change GFX for Unit based on livery2		161										
   43 * 18	 02 00 A1 81 F2 00 FF \b2
  11 00 \b0 \b0
  12 00 \b1 \b1
 FF FF


// Purchase list sprite :D
   44 * 4	 01 00 01 01
//          XP  YP  CP  YS  XS   X   Y
   45 sprites/gfx/class466/plist.png 01 01 01 12 60 -29 -08
   46 * 9	 02 00 F0 01 01 \w0 \w0


// =======================================================
// S-E-T  W-A-G-O-N  G-R-A-P-H-I-C-S (based on pos in train)
// =======================================================
// Add P-list-sprite
   47 * 14	 02 00 03 82 41 10 FF 01 // 
                      F0 00 00 00 // P-list if 0 
                      A0 00 // Use gfx if not


// ================================================
// S-E-T   W-A-G-O-N   L-E-N-G-T-H-S (for callback 11)
// ================================================
   48 * 12	 02 00 04 81 41 80 FF 00 \b1 \b0
                               0 80

// ================================================
// L-I-V-E-R-Y   N-A-M-E-S (for callback 19)
// ================================================
   49 * 18	 02 00 01 81 F2 00 FF \b2
                         \b71 80 \b0 \b0
                         \b91 80 \b1 \b1
                          FF FF

// =====================================
// C-A-N-N-O-T   A-T-T-A-C-H   S-T-U-F-F
// =====================================
// Check if it is an allowable ID
   50 * 18	 02 00 F0 81 C6 00 FF \b2
                            FF 80 \b88 \b88 // First allowable ID
                          FF 80 \b*89 \b*89 // Allow self
  \b1 80 // Disallow everything else

   51 * 14	 02 00 02 82 40 10 FF 01 // Check how many units in the train
                 \b0 80 \b7 FF // If between "max length" and 256 units, it gives an error message 
                                      F0 00 // Else; it checks if its an allowed ID 


// ====================================================
// A-R-T-I-C-U-L-A-T-I-O-N   I-N-F-O-R-M-A-T-I-O-N '10'
// ====================================================
   52 * 14	 02 00 00 81 10 00 FF 01 // 1 different IDs to add
               00 80 01 \b1 // add that id, that number of times   
                             FF FF // terminate

// ==============================================================================
// A-D-J-U-S-T   P-U-R-C-H-A-S-E / R-U-N-N-I-N-G  C-O-S-T-S / C-A-P-A-C-A-T-I-E-S
// ==============================================================================
//Low cost when standing still, for use in the '10'
   53 * 14	 02 00 08 82 B4 00 FF 01 // 1 case
                            \b20 80 00 00 // Standing still cost 
                            \w33199 // RUN cost

// Adjust the capacity in the different parts (i.e head and wagons)
   54 * 14	 02 00 09 81 41 08 FF 01 // Change the last head
              \b86 80 00 00 // Last Head
              \b86 80 // All other wagons
// CB36 info
   55 * 22	 02 00 05 81 10 00 FF \b3 // For the purchaselist
                    \w33199 0D 0D // Change running cost
                    \w32939 14 14 // Change capacity
                    \w32952 17 17 // Change purchase cost
                    03 00 // attach gfx

   56 * 22	 02 00 06 81 10 00 FF \b3 // Main cb36 info
              08 00 0D 0D // Change running costs based on speed 
                 09 00 14 14 // Change capacity
                    \w32952 17 17 // Change purchase cost
                    03 00 // attach gfx
// Change between Normal and P-list
   57 * 14	 02 00 07 82 41 10 FF 01 // Check how many times the Vehicle ID appears
              05 00 00 00 // P-list if 0 length 
              06 00 // Use normal if not 0 length


// =========================================================================================
// F-I-N-A-L   C-A-L-L-B-A-C-K   A-N-D   G-F-X   A-T-T-A-C-H-M-E-N-T --- T-H-E   E-N-G-I-N-E
// =========================================================================================

   58 * 30	 02 00 FF 81 0C 00 FF \b05
              00 00 16 16 // articulate
              01 00 19 19 // Names
              02 00 1D 1D // cannot attach
            \b217 80 23 23 // p-list text callback
              07 00 36 36 // Change Action0 props
              03 00 // attach graphics

// =========================================================================================
// F-I-N-A-L   C-A-L-L-B-A-C-K   A-N-D   G-F-X   A-T-T-A-C-H-M-E-N-T --- T-H-E   W-A-G-O-N
// =========================================================================================
   59 * 22	 02 00 FE 81 0C 00 FE \b03
              04 00 11 11 // Wagon Length
              01 00 19 19 // Names
              07 00 36 36 // Change Action0 props
              A1 00 // attach graphics

// Action3
   60 * 7	 03 00 01 \b*89 00 FF 00 // Normal
   61 * 7	 03 00 81 00 00 FE 00 // Livery Override

// Action 4's
// Engine Name
   62 * 15	 04 00 7F \b1 \b*89 "Class 466" 00
// Engine purchase list text
   63 * 73	 04 00 FF \b1 \b217 D0 "\n" "Loading speed: " 8A "Medium" "\n" 98 "Unit Length: " 8A "2" " Cars" "\n" 98 "Max Length: " 8A "8" " Cars" 00
Attached is a zip with the gfx files, along with the code, all it lacks is the livery names
Attachments
sprites.zip
(12.94 KiB) Downloaded 166 times
Member of the
ImageImage
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

Loco working nice but again no refit screen... :( :( :(

Code:

Code: Select all

    2 * 17	 04 00 9F 01 00 D0 "grey-blue1" 00
    3 * 11	 04 00 9F 01 01 D0 "blue" 00 
    4 * 13	 04 00 9F 01 02 D0 "green1" 00
    5 * 11	 04 00 9F 01 03 D0 "grey" 00
    6 * 17	 04 00 9F 01 04 D0 "grey-blue2" 00
    7 * 13	 04 00 9F 01 05 D0 "green2" 00
    8 * 13	 04 00 9F 01 06 D0 "green3" 00
    9 * 13	 04 00 9F 01 07 D0 "green4" 00
   10 * 13	 04 00 9F 01 08 D0 "green5" 00
    // Action 0 - Tender
   11 * 72	 00 00 1C 01 00
// Game related props 
  02 01		// Reliability Decay
  03 0F		// Vehicle Life/Years
  04 28		// Model Life/Years
  05 00		// Track type; 00 Rail, 01 Mono, 02 Mlev
  06 07		// Climate availability
  07 10 	// Loading Speed - Not needed in most cases
  08 00 	// AI Pax optimized

// Physical properties
  00 A0 2D               // Intro year \wyyyy-mm-dd
  09 5A 00		// Speed (word)
  0B 00 00		// Power in HP (word)
  1F 00		// Tractive effort
  16 00            // Weight/Tons
  24 00       // Highbyte on engines weighing >255 tons
  20 20                         // Air Drag

// Economical properties
  14 00      // Cargo Capacity
  1D 00	00 00 00	// Refit bitmask
  28 00 00      // New cargo classes
  29 00 00  // New NOT Cargo classes
  0D 8A             // RUN Cost Factor
  0E 3C 4C 00 00         // RUN cost Base
  17 37             // Cost Factor
  1C 00		// Refit cost

// Misc
  12 FD	// Use new grapics
  19 28     // Traction type (maglev, rail, monorail)
  13 00          // Dualhead? 00/01 (should "always" be 00)
  1E FF         // Callbacks
  21 00      // Shorter vehicle
  27 00              // 01 tilt + 02 2cc + 04 xMU


// Action 0
   12 * 74	 00 00 1D 01 73
// Game related props 
  02 01 // Reliability Decay
  03 0F // Vehicle Life/Years
  04 28 // Model Life/Years
  05 00 // Track type; 00 Rail, 01 Mono, 02 Mlev
  06 07 // Climate availability
  07 10 // Loading Speed - Not needed in most cases
  08 00 // AI Pax optimized

// Physical properties
  00 A0 2D // Intro year \wyyyy-mm-dd
  09 5A 00 // Speed (word)
  0B 6A 13 // Power in HP (word)
  16 B4 // Weight/Tons
  24 00 // Highbyte on engines weighing >255 tons
  20 20 // Air Drag
  1F 31 // Tractive effort

// Economical properties
  14 00 // Cargo Capacity
  15 00 // Cargo Type
  1D 00 00 00 00 // Refit bitmask
  28 00 00 // New cargo classes
  29 00 00 // New NOT Cargo classes
  0D 8A // RUN Cost Factor
  0E 3C 4C 00 00 // RUN cost Base
  17 37 // Cost Factor
  1C 0B // Refit cost

// Misc
  12 FD // Use new grapics
  19 28 // Traction type (maglev, rail, monorail)
  13 00 // Dualhead? 00/01 (should "always" be 00)
  1E FF // Callbacks
  21 00 // Shorter vehicle
  27 00 // 01 tilt + 02 2cc + 04 xMU

   13 * 4	 01 00 02 08
   14 sprites/allinone.pcx 6 6 01 23 7 -3 -8
   15 sprites/allinone.pcx 22 6 09 19 20 -13 -11
   16 sprites/allinone.pcx 54 6 01 15 32 -13 -11
   17 sprites/allinone.pcx 102 6 09 19 20 -6 -10
   18 sprites/allinone.pcx 134 6 01 26 7 -3 -11
   19 sprites/allinone.pcx 150 6 09 19 20 -14 -9
   20 sprites/allinone.pcx 186 6 01 15 32 -16 -11
   21 sprites/allinone.pcx 234 6 09 19 20 -5 -11

   22 sprites/allinone.pcx 6 44 01 23 7 -3 -8
   23 sprites/allinone.pcx 22 44 09 19 20 -13 -11
   24 sprites/allinone.pcx 54 44 01 15 32 -13 -11
   25 sprites/allinone.pcx 102 44 09 19 20 -6 -10
   26 sprites/allinone.pcx 134 44 01 26 7 -3 -11
   27 sprites/allinone.pcx 150 44 09 19 20 -14 -9
   28 sprites/allinone.pcx 186 44 01 15 32 -16 -11
   29 sprites/allinone.pcx 234 44 09 19 20 -5 -11
  //	1										
 // Action2 for unit1												
   30 * 9	 02 00 11 01 01 00 00 00 00 //											
   31 * 9	 02 00 12 01 01 01 00 01 00 //											
 // Change GFX for Unit based on livery1		160										
   32 * 18	 02 00 A0 81 F2 00 FF 02
  11 00 00 00
  12 00 01 01
 FF FF

   33 * 4	 01 00 02 08
   34 sprites/allinone.pcx 266 6 01 26 7 -3 -10
   35 sprites/allinone.pcx 282 6 09 19 20 -13 -10
   36 sprites/allinone.pcx 314 6 01 15 32 -13 -11
   37 sprites/allinone.pcx 362 6 09 19 20 -6 -11
   38 sprites/allinone.pcx 394 6 01 23 7 -3 -8
   39 sprites/allinone.pcx 410 6 09 19 20 -14 -10
   40 sprites/allinone.pcx 442 6 01 15 32 -16 -11
   41 sprites/allinone.pcx 490 6 09 19 20 -5 -10

   42 sprites/allinone.pcx 266 44 01 26 7 -3 -10
   43 sprites/allinone.pcx 282 44 09 19 20 -13 -10
   44 sprites/allinone.pcx 314 44 01 15 32 -13 -11
   45 sprites/allinone.pcx 362 44 09 19 20 -6 -11
   46 sprites/allinone.pcx 394 44 01 23 7 -3 -8
   47 sprites/allinone.pcx 410 44 09 19 20 -14 -10
   48 sprites/allinone.pcx 442 44 01 15 32 -16 -11
   49 sprites/allinone.pcx 490 44 09 19 20 -5 -10
  //	1										
 // Action2 for unit2												
   50 * 9	 02 00 11 01 01 00 00 00 00 //											
   51 * 9	 02 00 12 01 01 01 00 01 00 //											
 // Change GFX for Unit based on livery2		161										
   52 * 18	 02 00 A1 81 F2 00 FF 02
  11 00 00 00
  12 00 01 01
 FF FF


// Purchase list sprite :D
   53 * 4	 01 00 01 01
//          XP  YP  CP  YS  XS   X   Y
   54 sprites/allinone.pcx 524 6 01 12 56 -28 -7
   55 * 9	 02 00 F0 01 01 00 00 00 00


// =======================================================
// S-E-T  W-A-G-O-N  G-R-A-P-H-I-C-S (based on pos in train)
// =======================================================
// Add P-list-sprite
   56 * 14	 02 00 03 82 41 10 FF 01 // 
                      F0 00 00 00 // P-list if 0 
                      A0 00 // Use gfx if not


// ================================================
// S-E-T   W-A-G-O-N   L-E-N-G-T-H-S (for callback 11)
// ================================================
   57 * 14	 02 00 04 81 41 00 FF 01 02 FF 00 01
                                         03 FF     


// ================================================
// L-I-V-E-R-Y   N-A-M-E-S (for callback 19)
// ================================================
   58 * 18	 02 00 01 81 F2 00 FF 02
                         00 80 00 00
                         01 80 01 01
                          FF FF


// ====================================================
// A-R-T-I-C-U-L-A-T-I-O-N   I-N-F-O-R-M-A-T-I-O-N '10'
// ====================================================
   59 * 14	 02 00 00 81 10 00 FF 01 // 1 different IDs to add
               00 80 01 01 // add that id, that number of times   
                             FF FF // terminate


// =========================================================================================
// F-I-N-A-L   C-A-L-L-B-A-C-K   A-N-D   G-F-X   A-T-T-A-C-H-M-E-N-T --- T-H-E   E-N-G-I-N-E
// =========================================================================================

   60 * 18	 02 00 FF 81 0C 00 FF 02
              00 00 16 16 // articulate
              01 00 19 19 // Names
              03 00 // attach graphics

// =========================================================================================
// F-I-N-A-L   C-A-L-L-B-A-C-K   A-N-D   G-F-X   A-T-T-A-C-H-M-E-N-T --- T-H-E   W-A-G-O-N
// =========================================================================================
   61 * 18	 02 00 FE 81 0C 00 FF 02
              04 00 11 11 // Wagon Length
              01 00 19 19 // Names
              A1 00 // attach graphics

// Action3
   62 * 7	 03 00 01 73 00 FF 00 // Normal
   63 * 7	 03 00 81 00 00 FE 00 // Livery Override

// Action 4's
// Engine Name
   64 * 9	 04 00 7F 01 73 "VL8" 00
Last edited by Mpet on 04 Dec 2010 19:28, edited 1 time in total.
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

you need cargo capacity to be able to refit it...
Member of the
ImageImage
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

Here is zipped nfo and gfx.
Last edited by Mpet on 04 Dec 2010 19:27, edited 1 time in total.
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

did you try adding some capacity? might need the property 28 to be \w1 and and 29 to be \wxFFFE to work properly.
Member of the
ImageImage
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

did you try adding some capacity? might need the property 28 to be \w1 and and 29 to be \wxFFFE to work properly.
You coding God! :bow: :bow: :bow: :D It works! I set some capacity and change 28 to 01 and 29 to FE FF and it works! But what I must to do if I really not need this capacity(at this moment passingers)?
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: What`s wrong in my GRF?

Post by DJ Nekkid »

you _dont_ need it, but it is the only way to add the other liveries, but you can remove it with callback36... something a'la:


-1 * 0 02 00 F0 81 10 00 FF 01
00 80 14 14
00 00

then add a callback36 in the callback piece
F0 00 36 36
Member of the
ImageImage
Mpet
Engineer
Engineer
Posts: 23
Joined: 20 Jun 2010 18:03

Re: What`s wrong in my GRF?

Post by Mpet »

Ok! I understand. Thank you very much!!! :bow:
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 85 guests