It is currently 15 Aug 2018, 21:26

WELCOME TO SIMUSCAPE!


Please Sign in or Register to enable all features, remove restrictions and gain additional access!
For information on how to bypass the CAPTCHA or to contact Team Simuscape, Continue Here!


Post a new topicPost a reply Page 1 of 23   [ 451 posts ]
Go to page 1, 2, 3, 4, 5 ... 23  Next
Author Message
 Post subject: GarryG Does Stations
PostPosted: 25 Apr 2017, 04:04 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
First of all, thnx Wallyweb for allowing us to start up this topic in your workshop! :W
This gave us the opportunity to write this rather extensive guide and release it as a whole publically. :bowing:


Discussion-topic can be found here:
viewtopic.php?f=84&t=881



*DISCLAIMER*
There are many ways (and probably better ways) to draw, code and compile a stationGRF, I do NOT claim that my way is the best or simplest or tidiest, but it works for me and hopefully also for GarryG. ;-)
*/DISCLAIMER*

Lets see if we can get some stations down under!! :twisted:

For others reading this thread:
If you want to look at more coding and/or graphics examples then check out the sources of GarryG's stationsets or the sources of the Dutch Station Addition Set Part-3, as these use the code and graphics in the way I use them for the information in the rest of this thread.
Garry's sets: https://www.tt-forums.net/viewtopic.php?f=26&t=76390
Dutch Station Addition Set Part-3: https://www.tt-forums.net/viewtopic.php?f=26&t=77394

- INDEX:
(When visiting this thread for the first time, it is best to just carefully read the first 4 pages of this thread, those cover the basics of coding stationplatforms, also use the NFO-wiki to get more in-depth information about the various Actions and Features, https://newgrf-specs.tt-wiki.net/wiki/Main_Page )

* How to setup and compile a station-GRF (This includes the needed programmes and code/graphics-templates):
viewtopic.php?f=45&t=859#p12151

* Changing graphics using the templates:
viewtopic.php?f=45&t=859#p12156

* The first steps to customizing your own station-GRF (IMPORTANT, read the Edit made on July 18th 2017 carefully!!):
viewtopic.php?f=45&t=859#p12159

* Explaining the contents of a station code-block (IMPORTANT, read the Edits made on September 11th 2017 carefully!!):
viewtopic.php?f=45&t=859&start=20#p12183

* Changing hight of boundingboxes (to prevent clipping issues with powerlines and/or pylons):
viewtopic.php?f=45&t=859&p=12183#p12192

* Cant see boundingboxes when pressing CTRL+b ingame? Do this:
viewtopic.php?f=45&t=859&start=40#p12203

* How to remove catenary pylons when they are unwanted:
viewtopic.php?f=45&t=859&start=40#p12207

* Coding Waypoints:
viewtopic.php?f=45&t=859&start=60#p12232

* Coding a 1x1 non-track tile:
viewtopic.php?f=45&t=859&start=80#p12256

* Coding Bufferstops:
viewtopic.php?f=45&t=859&start=80#p12259

* Coding 2x1 non-track:
viewtopic.php?f=45&t=859&start=160#p12334

* Coding 3x1 non-track:
viewtopic.php?f=45&t=859&start=160#p12337

* A little extra information about the Ground/Base-tile of a stationtile (somewhere halfway that post):
viewtopic.php?f=45&t=859&start=200#p12397

* Are tracks facing the wrong way in the Ground/Base-tile? Then probably this happened:
viewtopic.php?f=45&t=859&start=220#p12403

* Coding 4x1 and 5x1 non-track:
viewtopic.php?f=45&t=859&start=220#p12412

* Coding 6x1 and 7x1 non-track:
viewtopic.php?f=45&t=859&start=220#p12413

* How to get animated colors when coding with 32bpp colored graphics (scroll a bit into the post, there is the information):
viewtopic.php?f=45&t=859&start=260#p12452

* Stations that change appearance when a train approaches those and runs through them (Reserved Path Aware tiles):
- Single Tile:
viewtopic.php?f=45&t=859&start=320#p12530
- Waypoints:
viewtopic.php?f=45&t=859&p=12684#p12684
- Multi-tile stations:
viewtopic.php?f=45&t=859&p=12685#p12685

* Colored/textured see-thru glass!!
viewtopic.php?f=45&t=859&start=320#p12535
viewtopic.php?f=45&t=859&start=340#p12580

* Stations with custom foundations:
viewtopic.php?f=45&t=859&p=12609#p12609

* Single-tile Non-track Overlaps:
viewtopic.php?f=45&t=859&p=12611#p12611

* Single-tile Tracked Overlaps:
viewtopic.php?f=45&t=859&p=12613#p12613

* Getting started with Multi-tile stations, 7x7 fully tracked & 7x7 fully non-tracked:
viewtopic.php?f=45&t=859&p=12618#p12618

* How to make a 6x7 station, using the templates of the 7x7:
viewtopic.php?f=45&t=859&start=380#p12621

* How to make a 7x6 station, using the templates of the 7x7:
viewtopic.php?f=45&t=859&p=12628#p12628

* Explaining the values for setting the width and length of a multitile station (with a list of those values):
viewtopic.php?f=45&t=859&p=12629#p12629

* Shaving off tracks and platforms, ending up with a 5x4 example:
viewtopic.php?f=45&t=859&p=12629#p12630

* Stations with tracked and non-tracked tiles combined in one station (using the 5x4 as an example):
viewtopic.php?f=45&t=859&p=12632#p12632

* Removing the "old-fashioned" way of glass-effect graphics and code in older examples, as those are obsolete now that (colored & textured) glass effects can be done in the 32bpp graphicsfile.
viewtopic.php?f=45&t=859&p=12636#p12636

* Cargo Aware 1x1 Non-Track, triggered by ANY cargo, next step by adding up ALL waiting cargo's:
viewtopic.php?f=45&t=859&start=420#p12701

* Cargo Aware Platforms, triggered by ANY cargo, next step by adding up ALL waiting cargo's:
viewtopic.php?f=45&t=859&start=420#p12702

* Reference to spritenumbers for groundtiles:
viewtopic.php?f=45&t=859&p=12703#p12703

* Cutting up graphics of large stations:
viewtopic.php?f=45&t=859&p=12868#p12867

* Coding 2x1, 3x1, ....., 7x1 Tracked stations:
viewtopic.php?f=45&t=859&p=12879#p12879


Last edited by Quast65 on 17 Feb 2018, 17:05, edited 30 times in total.

Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 25 Apr 2017, 04:13 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
Hi Garry,
I am pretty busy the next couple of days with work, but will probably be able to set up some templates for the code and graphics during the weekend (and also provide you with the programs you need to compile a GRF yourself).
Until then, could you answer these questions (I need that information anyway to setup the templates):
- What name will the GRF get? (AuzStations?)
- Do you use only the colors in the standard OpenTTD Palette, or do you use more colors? (either is fine, just need to know it for a code thingy)


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 25 Apr 2017, 04:34 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
Thanks Quast65 for helping me.

No real hurry to start this project. I caught up with the Industry sets at moment as finding a few booboos there so might take me a day or 2 to fix and test.

Thursday hope to go train travelling and get some photos of stations and next Tuesday head to Sydney by train and visit Railway Archives to get some photo copies of older stations.

I think AuzStations will do fin eas almost all my projects I started those names with Auz.

I intend to rename NSWTrains to AuzNSWTrains and the sets of Town names I done do same to those so that all my projects will start with Auz.

Those 2 platforms I sent are from photos I took. The grey ones from weathered timber sleepers and the brownish from new timber. The brownish ones had a lot of Christmas lights and needed to use the OpenTTD Palettes to change the shade of those that blinked.

Happy to redo them it like.

Cheers

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 29 Apr 2017, 02:40 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
My Thursday train trip was a flop .. travelled all the way to a special place to spend an hour getting photos of freight and coal trains and the railways closed the freight line to do maintenance. When I arrive a few trains went through before I could get into position to take photos then nothing more came. What a bumma. Will try again Tuesday.

Those 2 platform sets .. what if you can just code one of them so I can see what involved and hope you can then teach me to code in the other and any future platforms and station buildings until I get the gist of it.

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 29 Apr 2017, 21:03 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
You have not made it easy for me ;-)
I have not yet coded stations that can have colors outside of the normal pallettes, so had to figure out how to do that first (not too easy in NFO) ;-)

But well, I think we can get started.... :twisted:

First of all, I would like to see if you are able to compile a GRF using the template code and graphics that I have prepared for you. I have made a .rar with everything in it:
Attachment:
grfcodec603.rar [1.31 MiB]
Downloaded 21 times

Save this .rar on the D-partition of your computer (I hope you have a D-partition, if not, just save it on the standard C-partition and let me know, then I will code an NFO-file that has the right path for the graphics-files).

Unpack the .rar to a folder of the same name by rightclicking on it and selecting unpack to folder grfcodec603:
Attachment:
Example242.png
Example242.png [ 18.05 KiB | Viewed 961 times ]


When unrarred the folderstructure should look something like this:
Attachment:
Example241.png
Example241.png [ 35.96 KiB | Viewed 961 times ]


You now have all the programs, code and graphics you need to make a GRF using NFO-code.
The main two programs are grfcodec.exe (that will compile the GRF, like NMLC for NML) and nforenum.exe (as you shall see, all the lines of code have a number. Adding those numbers by hand is a pain in the rear, luckily a handy program like this exists ;-) )
In the folder Auzstations you will find the code (auzstations_1_v001.nfo) and in the folder gfx you will find the graphics.
You can look at the code by opening the .nfo with the standard Windows Notepad (that will also be the program we will use to edit the code).


Last edited by Quast65 on 29 Apr 2017, 21:17, edited 1 time in total.

Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 29 Apr 2017, 21:17 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
Right, now if all this is setup correctly you should be able to compile a GRF.
- Open up a commandprompt (just like with NML compiling)
- Go to partition-D, by typing
Code:
d:

- Go to folder grfcodec603, by typing
Code:
cd grfcodec603

- Finally type
Code:
grfcodec -e -g 2 d:/grfcodec603/auzstations/auzstations_1_v001.grf d:/grfcodec603/auzstations

Should look something like this then:
Attachment:
Example243.png
Example243.png [ 6.36 KiB | Viewed 961 times ]

And finally press ENTER

It should then compile and result in a GRF in the auzstations-folder

Let me know if this all worked (or not :oops: )
If it did work you should be able to make these stations:
Attachment:
Example244.png
Example244.png [ 60.27 KiB | Viewed 961 times ]

If it worked I will go on explaining, otherwise I will help you out to see why it wont compile.


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 01:11 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
I'll do my Sunday house work then see what I can do.

More then happy change the colours of the platforms .. would you like if I use Dos or Windows Palette?

These platforms are some I made for object sets and in Industries so thought already made I use them.

So if like I can change them or if prefer start with one of your Dutch platforms.

Cheers pal

EDIT: Forgot to tell you .. I have drives C: E: and F: .. D is the DVD player .. so I will put them on C:

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 02:23 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
Quote:
More then happy change the colours of the platforms .. would you like if I use Dos or Windows Palette?

No need to worry about palette colors anymore, it should be coded in a way that you can use all colors of the Rainbow, that gives you more freedom, especially when using textures from photo's ;-) Only thing you need to check is that you dont use unwanted animated colors (the infamous christmaslights :mrgreen: )

But to check for that, you must be able to compile a GRF, so back to that first ;-)

Quote:
EDIT: Forgot to tell you .. I have drives C: E: and F: .. D is the DVD player .. so I will put them on C:

OK, C: it is then. Replace the .nfo with this one:
Attachment:
auzstations_1_v001.nfo [15.81 KiB]
Downloaded 17 times

We now should have exactly the same setup, so we both have to do the exact same steps to get a GRF, making it easier to check where something may go wrong ;-)

When you have replaced the .nfo you now need to do this:

- Open up a commandprompt (just like with NML compiling)
- Go to C:, possibly by typing this a couple of times:
Code:
cd..

- Go to folder grfcodec603, by typing:
Code:
cd grfcodec603

- Finally type:
Code:
grfcodec -e -g 2 c:/grfcodec603/auzstations/auzstations_1_v001.grf c:/grfcodec603/auzstations

Should look something like this then:
Attachment:
Example245.png
Example245.png [ 8.27 KiB | Viewed 959 times ]

And finally press ENTER
It should then compile and result in a GRF in the auzstations-folder

Let me know if you get a working GRF, if so we can move on to altering the graphics to ones that suit you. Final step will be adding code, but that will be tomorrow for me, getting late overhere ;-)


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 05:15 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
All worked fine .. those platforms are operational.

My first computer had DOS operating system so maybe I can give you a few DOS commands to help you.

When in folders no matter how many sub-folders you are in
Just type CD/
This will bring you all the way back to the beginning C:/>

Quote:
C:\Users\quast>cd/

C:\>


cd.. takes you back 1 folder at a time and cd/will take you all the way back to command prompt.

Can also do it this way to go to another folder.

Quote:
C:\Windows\System32>cd/grfcodec603

C:\grfcodec603>


If press the function key F7 it will list last 10 commands you done. Just type the number and it will run that command again. If want to do the 3rd command you typed again .. just press F7 and 3.

F8 will retype the last command you did, save typing it again.

Cheers pal

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 07:19 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
Good to hear that the compiling worked! That means we can mess around with some graphics!
Thnx for the DOS tips and good that you know your way around that, especially getting back to the last command typed (I use the Arrow-up by the way) as that is very usefull later on :W

Ok, lets get you going on changing the graphics and setting up two graphicssheets (using for example your blackish and brownish platforms you drew) that we will use later on for expanding the code.

Use this one as a base (its also already in the gfx folder):
Attachment:
Template_RegularPlatform_32bpp_BASE.png
Template_RegularPlatform_32bpp_BASE.png [ 26.18 KiB | Viewed 950 times ]

This has the four types of regular platforms, with an added extra (that I will explain later)
- row-1: Standard old school style OpenTTD platform setup (platforms on each side of the track, with the extra graphics when you drag the station over a couple of tiles)
- row-2: Single sided platforms, only at front of track
- row-3: Single sided platforms, only at back of track
- row-4: Island platforms, only in the middle of two tracks

When drawing completely new platforms (like those black and brown ones), I believe it is best to give a player all 4 options as some like to use the oldschool style and others may like the singlesided ones (or both, the more options, the more fun ;-) )
As you can see from the various colored platforms, you can use the same graphics for the various options (not necessary ofcourse, each can have custom graphics, but this gets you a lot of different types of platforms with little graphical work)

I would say, change this template with your graphics ;-) Please do note the shading of the foundations, it will look better if you keep that in mind. The foundations dont have to be fully drawn, you can draw tiny poles if you want. Also the platforms dont have to be this size, they can be smaller if you want (or have a ramp/stairs going up/down). But this is the size for them to link up completely to each other. It is also the biggest size they should have without overlapping the tracks or getting graphical glitches. They can have structures on them ofcourse, or roofs, or other things high over tracks so trains pass under them, but that is for the advanced class ;-) (it means changing the values for the boundingboxes in the code, better to discuss that when you are comfortable with the basics)

The only thing you may not be able to draw before coding it and actually using it ingame are the two purchasemenu-sprites at the end of row-4. I usually draw and code the Island Platforms and then make a screenshot and use the screenshot for the purchasemenu-sprites and recompile the GRF.
The first 3 rows make their purchasemenu sprites automatically, so you dont have to worry about those ;-)

Now, the added extra. Those are the sprites with the yellow letters/numbers. Those can be used for the see-thru glass effect. You may not need that right now (so in that case, just make those sprites completely transparent blue), but I wanted to code that already in for possible future use ;-)
EDIT 21st september 2017:
At the time I was giving these first examples, I was not aware that the 32bpp graphics can contain transparency/translucency information. This now means that this "old-fashioned" way of adding see-thru glass is kinda obsolete. In this post I explain how you can remove references to those:
http://www.simuscape.net/simutalk/viewtopic.php?f=45&t=859&p=12636#p12636




OK, so lets say you have replaced the graphics with your platforms, after that select all the white and the transparent blue and delete that, so you end up with something like this:
Attachment:
Template_RegularPlatform_32bpp.png
Template_RegularPlatform_32bpp.png [ 24.45 KiB | Viewed 950 times ]

So just the platforms with a completely transparent background (in this case dont forget to also delete the yellow letters/numbers). This is the graphicsfile we will use to code. Give it a name that is logical for you.

So, lets see if we can code that and see how it looks ingame. 8-)
For now we only have to change the paths to the graphicsfile in the code. (the good old simple Windows Notepad will be good enough for doing that)
In the code you can see two graphicsfiles being adressed like this:
Code:
   11 c:/grfcodec603/auzstations/gfx/template_regularplatform_8bpp_EMPTY.png  8bpp   10   40   64  122  -31  -91 normal chunked
    | c:/grfcodec603/auzstations/gfx/template_regularplatform_32bpp.png  32bpp  10   40   64  122  -31  -91 normal chunked

Do NOT change the name or path to the one with the _EMPTY.png extension! Also make sure that this file stays in the gfx folder!!
(short explanation, I have prepared the code in such a way that you can use 32bpp graphics, so all colors of the Rainbow, not being limited to the pallettes. However the code does require a standard oldschool 8bpp graphicsfile before replacing them with the 32bpp one, even though they dont have to have any graphics in them. Dont ask me why, it just does :cucko: )

But do replace all the paths to this graphicsfile:
Code:
template_regularplatform_32bpp.png

with a path to your newly made graphicsfile.

Save the .nfo and recompile the GRF and see if your graphics will now turn up in the game. :twisted:
With a bit of luck this should work to check your graphicsfiles, when you have drawn another graphicsfile, you can replace the path in the code to that one and see if those graphics are ok too.

I think that is enough homework for the time being :P
If you have two graphicsfiles that are ok, we can go on with expanding the code to have both graphicsfiles in it. Then I will also go deeper into explaining the basics of the code that you need to change when expanding the code and how to renumber the codelines.
But first, try to get some graphicsfiles, I'm off to bed.... :yawn:
Please also post these graphicsfiles if they are ok, so I can place them in my compile factory for the next steps.
Good luck!! :W


Last edited by Quast65 on 21 Sep 2017, 19:13, edited 1 time in total.

Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 07:54 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
I thought you went to bed hours ago .. you must be a bulldozer driver .. they don't sleep they doze :)

Be a few hours before I get chance to do what you ask. See how I go.

Cheers pal

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 14:42 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
Success .. took me 3 goes.

1st time I forgot to remove the white background
2nd time I forgot to remove the yellowish letter/numbers.
3rd go success.
Attachment:
AuzStations.png
AuzStations.png [ 66.4 KiB | Viewed 946 times ]

I zipped up what is in the Auzstations folder and include if you need check anything.

I didn't adjust any shading or graphics to the platforms yet .. thought just getting them to work as they are for now.

The grey platforms do need some graphics work to them .. think the dark grey is too dark. Maybe look better if make it all the lighter grey colour .. or as a friend told me when I did these months ago .. maybe have it a bit dark along the platform (train side) edge to represent lot of activity and towards the far side where not as much activity leave it lighter.

Any way .. my turn to go get some beauty sleep .. cheers pal


Attachments:
Auzstations.rar [191.25 KiB]
Downloaded 17 times

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811
Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 30 Apr 2017, 17:18 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
Well done mate! :W
Good thing indeed is that you now have a testbed to check out your graphics and see if you like them, how they turn out ingame.
I would recommend to split the browns and the blacks and make two separate sets of graphicsfiles from them. These we can then use to expand the code.

But before expanding the code I will try to explain some of the basic elements of the code we have so far. That will make it hopefully easier for you to see what needs to be changed when expanding the code or if you want to make an update for public release or even an entirely new GRF.
Many of these things you will recognise from NML-coding, its just done differently ;-)

The most important thing in NFO-coding I would like you to know about is hexadecimal counting.
In normal life we count in decimals, 0 to 9, 10 to 19 etc etc.
Hexadecimal adds 6 extra "numbers":
Decimal: 00 01 02 03 04 05 06 07 08 09 (10 11 ......)
Hexadecimal: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F (10 11 12 13 14 15 16 17 18 19 1A 1B ..... 99 9A 9B 9B 9C 9D 9E 9F A0 A1 ..... )
So everything upwards from 09 is a different (larger) number, 0A is actually 10, 10 is actually 16.
This means you can get more "real" numbers from just 2 bits, eventually leading up to FF, which is 255 (and that is a magic number you probably know about ;-) For example its the max number of ID's in a single GRF)
As I said, Hexadecimals are very important in NFO-coding, you will encounter them a lot, so its good to get to know about them early on ;-)
A very handy website is this one:
http://www.statman.info/conversions/hexadecimal.html
A simple hexadecimal to decimal and viceversa converter, for when you loose track of what number you are on ;-)


Ok back to the basics....

First of all, the name of the .nfo
Code:
auzstations_1_v001.nfo

Choosing a clear and updateable name from the beginning is very important (just like with NML-coding)
auzstations speaks for itself
_1_ means part-1 of the auzstations family (trust me, when you get into stations you just keep adding and adding, like I did with the Dutch Station Addition set, I am almost ready to start with part-3 of that ;-) )
v001 That is the current version number, when you are ready for a publicly released update, save the file then with a higher versionnumber. Basically the same as you do with your other GRFs. Nothing really new here ;-)

Now, inside the .nfo file
All GRFs in NFO that I coded have this kind of "header"
Code:
    0 * 4    5B 00 00 00
    1 * 24    14 "C" "INFO" "B" "PALS" \w1 "W" "B" "BLTR" \w1 "3" 00 00
    2 * 83    08 07 "GG" 00 01 "Auz Stations Part1 v001" 00 "Australian Stations, Part 1, Version 001" 0D 0D "EXTRA TEXT" 00

line 0 states the total number of lines of code in the .nfo in hexadecimal, we have a total of 91 lines right now, that is 5B in hexadecimal.
As you can see, there are three 00's, meaning we are not limited to just 2 bits and thus can go further than FF (255 lines).
Adding extra lines of code means that this number will go up, but you dont have to do that manually, we will use the handy tool nforenum.exe for that later on.

line 1 Is in this case basic graphics information, it says that the 8bpp file is in Windows palette and that there are also 32bpp graphics. This you dont have to change, leave it as is.
EDIT made on July 18th 2017:
Something does have to change ;-)
the "W" has to be "D"
as it turns out I am using the Dos-palette for the 8bpp graphics-templates, not the Windows-one :oops: This is important regarding using an 8bpp animated color mask, in combination with the 32bpp graphics


line 2 states the GRF-ID "GG" 00 01 , the GRF-name WITH VERSIONNUMBER "Auz Stations Part1 v001" as seen in the grf-list ingame and finally the GRF-description "Australian Stations, Part 1, Version 001" 0D 0D "EXTRA TEXT"
So basically, the same information you give in a NML-header.
For every new publically released update you need to change the versionnumber, just like with the .nfo name.
The "EXTRA TEXT" you can alter to what you like.
If you want to make a completely new GRF, you also need to change the GRF-ID and general names ofcourse. Basically the same like you do for your object-sets.
So ingame you will see this information like this:
Attachment:
Example246.png
Example246.png [ 248.5 KiB | Viewed 945 times ]


For now I would like to give you a little assignment 8-)
- Change the EXTRA TEXT, to a text that you would like. Maybe something like: Stations as found Down Under, Made by GarryG. Whatever you like ;-)
- Save the .nfo and try to compile it to a GRF

- It will probably compile to a GRF, but at the beginning of the compiling you will see a warningmessage like this:
Attachment:
Example247.png
Example247.png [ 29.99 KiB | Viewed 945 times ]


- This now shows you what the number means next to the codeline number. Its the number of bytes in a line of code. So changing stuff in a line of code may probably mean that you need to change that number. Handy that grfcodec.exe gives this information, so you dont have to count it yourself ;-) and thus you can change the number to the correct one.
However, you will probably have to do this often (for example when adding/changing the names of the stationtiles for the purchasemenu) and when you have a lot of code it is a bit of a pain to scroll back everytime in the DOS-prompt ;-)

- So now we come to the real point of this assignment, using the handy tool nforenum.exe :twisted:

- Copy the .nfo with the changed information to the folder that has nforenum.exe in it
- Drag and drop the .nfo onto the nforenum.exe
- It will now automatically renumber what needs to be renumbered (you will probably see a quick DOS-prompt pop up and dissappear again)
- Now, cut (or copy, but cutting is handier so you dont end up with too many copies of the .nfo in various folders) and paste the .nfo back to its original folder and let it replace the old one.
- Recompile the GRF again and you will see that there is no more warning. :mrgreen:

You are going to do this often, as nforenum not only renumbers the number of bytes in a line of code, the total numbers of codelines as stated in codeline-0, but also the codelinenumbers at the beginning of a line of code!! :bowing: :bowing:
Meaning that you can later on simply copypaste parts of code, without having to worry about changing the codelinenumbers manually!! And this is really really handy!!

I will let you digest this information first, let me know if you can get nforenum to do its work and then I will go on to the real magic, the pieces of code that actually gets you stations ingame. 8-)


Last edited by Quast65 on 18 Jul 2017, 18:58, edited 2 times in total.

Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 01 May 2017, 00:43 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
Goood morning .. just had a quick read at next lesson and hope to have a go at it after I have breaky and do my morning chores. Be about 3 - 4 hours time before I have a go at it.

To edit the NFO file yesterday I use EditPad Lite 7 .. also use it to do the NML files. Great for all types of text type files.

I have 2 x 27" monitors connected to computer so can have the lessons open on one monitor and do the work on the other. Makes it easier for me as my memory not good reading some things and trying to remember what I read by time I switch windows to try put it into action.

Hope tomorrow spend day on trains and getting photos of some stations and trains.

I been thinking to remove the brown platforms and just use the grey style for old platforms and goods platforms. Not much needed for these. Get the shading right, put some steps and ramps at end of platforms.

I better go do more chores before I get lost in the world of coding.

Cheers pal

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 01 May 2017, 04:10 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
Hi Quast,

I finished that assignment.

I added this to "EXTRA TEXT" .. "Stations from Down Under, Made by GarryG with much help from Quast65"

I'll have a practice with redoing the platforms by changing all the brown platforms to greyish ones .. but before I do see if I can improve the looks of those platforms by making them a bit lighter.

A tricky question for you .. in my object sets I have a girder crane that expands a road and a railway line. What's the chance making one of these for the game .. be like a foot bridge but doesn't expand 2 lines .. it expands a road and a rail. If that not possible, could make the road a fake dirt road.

Can I pinch some of your platforms from the ISR set .. but in stead of red brick like to make them concrete and some with wooden sides. Make some as Wool Dumps by raising them another 3 pixels.

Thanks heaps for helping.

Cheers

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 01 May 2017, 05:39 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
Just practiced a bit more with the platforms. Change the graphics to the grey ones and for now removed the brown ones.

I think I will concentrate on the greys and add platforms with ramps, stairs and see if I can draw a jib crane to put on them.
Attachment:
AuzStations2.png
AuzStations2.png [ 46.66 KiB | Viewed 940 times ]

I tested them with some of my Industries and they fit perfect and the good shed keeps the old look.

I zip up each time I make changes to things and leave a copy here in case you like to check the nfo file if need.
Attachment:
Auzstations2.rar [155.6 KiB]
Downloaded 16 times

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 01 May 2017, 06:19 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 445
Location: The Netherlands
Looking good buddy! :bowing:
And nice that you also know your way around nforenum now!
Ill get back later on with explaining the rest of the code (got some work to do today, so could be Tuesday)

Did notice a few short pillars though ;-)
Attachment:
Example249.png
Example249.png [ 14.45 KiB | Viewed 939 times ]

So doublecheck your graphics (there are a couple more that are too short)

Ill get back to you soon with the rest of the explanation!


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 01 May 2017, 06:27 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
Quast65 wrote:
Did notice a few short pillars though


I used short timbers from short trees for those :) See if can find some taller ones.

I be busy Tuesday too so if like next lesson can be Wednesday .. in mean time this afternoon I practice with making other platforms and getting some longer timber :mrgreen:

Cheers

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 02 May 2017, 00:02 
Moderator
User avatar

Joined: 29 Feb 2012, 00:55
Posts: 1651
Location: Hellas
And some were 'borrowed':
Image
:lol:


Top
 Offline Profile  
 
 Post subject: Re: GarryG Does Stations
PostPosted: 02 May 2017, 06:00 
Expert
Expert
User avatar

Joined: 03 May 2015, 03:27
Posts: 1369
Location: Newcastle, Australia
athanasios wrote:
And some were 'borrowed':

Permanently I bet.

_________________
All my projects are GPLv2 License.
Soot Happens.
Projects: viewtopic.php?f=179&t=811


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 23   [ 451 posts ]
Go to page 1, 2, 3, 4, 5 ... 23  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Status SimuscapeTerms of UseAbout Simuscape

Design by SAC © 2012-2015, Sweden • Powered by phpBB • Based on twilightBB by Daniel St. Jules