Page 58 of 65

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 11:02
by GarryG
Here's a 2x3 set of tiles that 3iff designed and I coded it so can now be used with Industries.
test_1.png
test_1.png (3.77 KiB) Viewed 5092 times
2x3Industrysets.txt
(89.44 KiB) Downloaded 119 times
They make drawing your Industries so much easier and quicker.

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 12:09
by 3iff
Thanks for the credit but I didn't do that. Was it Quast65??

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 12:13
by GarryG
Actually got 3 people to credit for it. Quast65 did the 2x2 set. Silverx50 first brought to my attention the 2x3 and then 3iff you displayed the coding for it when you patched the error Silverx50 had.

So therefore you all deserve Credit.

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 13:02
by Eddi
might be worth splitting this in a separate topic, nobody is going to find this buried in here.

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 13:13
by GarryG
Eddi wrote:might be worth splitting this in a separate topic, nobody is going to find this buried in here.
Good idea .. anyone suggest a heading for the Topic so easy to find?

The Joined Sprite Tiles I think would suit all types of coding not just NML.

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 13:25
by Quast65
Eddi wrote:might be worth splitting this in a separate topic, nobody is going to find this buried in here.
Not a bad idea, maybe call it something like "my -insert name- coding examples/templates" and put links to various examples in the first post (with a short description).
Saves some time uploading examples if they are already somewhere in this forum and, if new are added, makes those also easy to find.

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 13:31
by GarryG
Quast65 wrote:
Eddi wrote:might be worth splitting this in a separate topic, nobody is going to find this buried in here.
Not a bad idea, maybe call it something like "my -insert name- coding examples/templates" and put links to various examples in the first post (with a short description).
Saves some time uploading examples if they are already somewhere in this forum and, if new are added, makes those also easy to find.
Your the one who first invented the joined sprites .. at least to my knowledge you are. So be nice if you started it by adding the 2x1, 2x2 and 2x3 sets for objects shown in this section earlier. Then I can add the Industry codes I done.

Cheers

Re: NML - a Newgrf Meta Language

Posted: 08 Jun 2016 18:01
by frosch
You could also add it to, or link it from:
https://www.tt-wiki.net/index.php?title=NMLTutorial

Re: NML - a Newgrf Meta Language

Posted: 09 Jun 2016 06:09
by Quast65
frosch wrote:You could also add it to, or link it from:
https://www.tt-wiki.net/index.php?title=NMLTutorial
I think that is the best way to go, create a page on the wiki where links can be added to various coding examples/templates.
Mainly so that everyone is able to add links to examples, not just the starter of the topic (so it can be maintained in the future by others if the original poster dissappears or edited if better examples are made).
And also because the wiki probably also will be visited by coders from other fora than this one, so it is usefull to them too.
I will start up a personal thread where I will post my various examples and link to that in my subscript under my posts (like I already did to my projects and screenshots) and recommend others to do that too.
That will make the first set up of that wiki-page a lot easier.

Re: NML - a Newgrf Meta Language

Posted: 09 Jun 2016 10:30
by Alberth
Why not do it the other way around, make a wiki page and link to it here?

My guess is that making a wiki page is about the same amount of effort as making a post here, with the added advantage that the wiki stays writable, and can be improved by all

Re: NML - a Newgrf Meta Language

Posted: 10 Jun 2016 14:38
by Quast65
True! And an extra wiki page with links is the best way to go.
However, I am also very unorganised. My file setup on my PC is sometimes a mess ;-)
So for my personal future reference I will also set up a thread here in the forum, with all of my examples. Even if it is just for me personally to find them again after some time ;-)

Re: NML - a Newgrf Meta Language

Posted: 12 Jun 2016 10:29
by GarryG
Something I like to share with your fellas.

I made a 8 by 8 size Combined Sprite set for Industries with 2 views.
8x8with2views.png
8x8with2views.png (11.81 KiB) Viewed 4964 times
I cut the image so it would load better for viewing. The actual sprite also has tiles 65 to 128. Each sprite is 512 wide by 400 high so plenty of room what ever height tour industry going to be.

The actual sprite set is in the attached file along with NML file with all the codings.
Test8x8x2views.rar
(325.04 KiB) Downloaded 124 times
Tiles not used just use your rubber in your graphics editor to remove the unused ones.

You can split them as well like in this image.
8x8test.png
8x8test.png (130.77 KiB) Viewed 4964 times
If remove any tiles just delete reference to them in the the coding from these sections:

Like I done here:

Code: Select all

    switch(FEAT_INDUSTRYTILES, SELF, test8x8x2_industry_layout_2_graphics_switch, relative_pos) {

	relative_coord(0, 0): test8x8x2_spritelayout_65;
	relative_coord(0, 1): test8x8x2_spritelayout_66;
	relative_coord(0, 2): test8x8x2_spritelayout_67;
	relative_coord(0, 3): test8x8x2_spritelayout_68;
	relative_coord(0, 4): test8x8x2_spritelayout_69;
	relative_coord(0, 5): test8x8x2_spritelayout_70;
	relative_coord(0, 6): test8x8x2_spritelayout_71;
	relative_coord(0, 7): test8x8x2_spritelayout_72;
	relative_coord(1, 0): test8x8x2_spritelayout_73;
	relative_coord(1, 1): test8x8x2_spritelayout_74;
	relative_coord(1, 2): test8x8x2_spritelayout_75;
	relative_coord(1, 3): test8x8x2_spritelayout_76;
	relative_coord(1, 4): test8x8x2_spritelayout_77;
	relative_coord(1, 5): test8x8x2_spritelayout_78;
	relative_coord(1, 6): test8x8x2_spritelayout_79;
	relative_coord(1, 7): test8x8x2_spritelayout_80;
	relative_coord(2, 0): test8x8x2_spritelayout_81;
	relative_coord(2, 1): test8x8x2_spritelayout_82;
	relative_coord(2, 2): test8x8x2_spritelayout_83;
	relative_coord(2, 3): test8x8x2_spritelayout_84;
	relative_coord(2, 4): test8x8x2_spritelayout_85;
	relative_coord(2, 5): test8x8x2_spritelayout_86;
	relative_coord(2, 6): test8x8x2_spritelayout_87;
	relative_coord(2, 7): test8x8x2_spritelayout_88;



	relative_coord(5, 0): test8x8x2_spritelayout_105;
	relative_coord(5, 1): test8x8x2_spritelayout_106;
	relative_coord(5, 2): test8x8x2_spritelayout_107;
	relative_coord(5, 3): test8x8x2_spritelayout_108;
	relative_coord(5, 4): test8x8x2_spritelayout_109;
	relative_coord(5, 5): test8x8x2_spritelayout_110;
	relative_coord(5, 6): test8x8x2_spritelayout_111;
	relative_coord(5, 7): test8x8x2_spritelayout_112;
	relative_coord(6, 0): test8x8x2_spritelayout_113;
	relative_coord(6, 1): test8x8x2_spritelayout_114;
	relative_coord(6, 2): test8x8x2_spritelayout_115;
	relative_coord(6, 3): test8x8x2_spritelayout_116;
	relative_coord(6, 4): test8x8x2_spritelayout_117;
	relative_coord(6, 5): test8x8x2_spritelayout_118;
	relative_coord(6, 6): test8x8x2_spritelayout_119;
	relative_coord(6, 7): test8x8x2_spritelayout_120;
	relative_coord(7, 0): test8x8x2_spritelayout_121;
	relative_coord(7, 1): test8x8x2_spritelayout_122;
	relative_coord(7, 2): test8x8x2_spritelayout_123;
	relative_coord(7, 3): test8x8x2_spritelayout_124;
	relative_coord(7, 4): test8x8x2_spritelayout_125;
	relative_coord(7, 5): test8x8x2_spritelayout_126;
	relative_coord(7, 6): test8x8x2_spritelayout_127;
	relative_coord(7, 7): test8x8x2_spritelayout_128;


        test8x8x2_spritelayout_2; // a default is needed, but should never be reached, layout definitions are explicit
    }


    tilelayout test8x8x2_industry_layout_2_tilelayout {

		0, 0: test8x8x2_tile;
		0, 1: test8x8x2_tile;
		0, 2: test8x8x2_tile;
		0, 3: test8x8x2_tile;
		0, 4: test8x8x2_tile;
		0, 5: test8x8x2_tile;
		0, 6: test8x8x2_tile;
		0, 7: test8x8x2_tile;
		1, 0: test8x8x2_tile;
		1, 1: test8x8x2_tile;
		1, 2: test8x8x2_tile;
		1, 3: test8x8x2_tile;
		1, 4: test8x8x2_tile;
		1, 5: test8x8x2_tile;
		1, 6: test8x8x2_tile;
		1, 7: test8x8x2_tile;
		2, 0: test8x8x2_tile;
		2, 1: test8x8x2_tile;
		2, 2: test8x8x2_tile;
		2, 3: test8x8x2_tile;
		2, 4: test8x8x2_tile;
		2, 5: test8x8x2_tile;
		2, 6: test8x8x2_tile;
		2, 7: test8x8x2_tile;



		5, 0: test8x8x2_tile;
		5, 1: test8x8x2_tile;
		5, 2: test8x8x2_tile;
		5, 3: test8x8x2_tile;
		5, 4: test8x8x2_tile;
		5, 5: test8x8x2_tile;
		5, 6: test8x8x2_tile;
		5, 7: test8x8x2_tile;
		6, 0: test8x8x2_tile;
		6, 1: test8x8x2_tile;
		6, 2: test8x8x2_tile;
		6, 3: test8x8x2_tile;
		6, 4: test8x8x2_tile;
		6, 5: test8x8x2_tile;
		6, 6: test8x8x2_tile;
		6, 7: test8x8x2_tile;
		7, 0: test8x8x2_tile;
		7, 1: test8x8x2_tile;
		7, 2: test8x8x2_tile;
		7, 3: test8x8x2_tile;
		7, 4: test8x8x2_tile;
		7, 5: test8x8x2_tile;
		7, 6: test8x8x2_tile;
		7, 7: test8x8x2_tile;

    }
No need to remove references from anywhere else if wish as they are ignored when you run the nmlc.

Simple to use (has to be for me to understand things) .. and the great part about is no more splitting buildings to put in single tiles.

Hope you make use of it.

Cheers

Re: NML - a Newgrf Meta Language

Posted: 12 Jun 2016 14:06
by Quast65
GarryG wrote: Simple to use (has to be for me to understand things) .. and the great part about is no more splitting buildings to put in single tiles.

Hope you make use of it.

Cheers
So... Is this the trick used to keep room in industries for roads/tracks/waterways?? If so, very very interesting!! :bow: I have always been curious about how that was done in some industry sets.

Re: NML - a Newgrf Meta Language

Posted: 12 Jun 2016 14:17
by Leanden
If you change the colours of the numbers in the graphic template to transparent blue, then the unused tiles will be easier to edit out by just using fill tool and transparent blue :)

Re: NML - a Newgrf Meta Language

Posted: 12 Jun 2016 15:02
by Quast65
Leanden wrote:If you change the colours of the numbers in the graphic template to transparent blue, then the unused tiles will be easier to edit out by just using fill tool and transparent blue :)
But that can make the numbers harder to see for some people (also with regard to some colors of the tiles, blue can be difficult to see then, or ingame the blue will get the color of the ground and then also harder to see), I would then advise to make some templates with rows/lines of tiles in transparent blue and just copy paste those over the graphic template.
That way you also dont accidentaly change some other tiles to blue (as some of the tiles have the same color) ;-)

Re: NML - a Newgrf Meta Language

Posted: 13 Jun 2016 00:51
by GarryG
Leanden wrote:If you change the colours of the numbers in the graphic template to transparent blue, then the unused tiles will be easier to edit out by just using fill tool and transparent blue :)
I just tried that idea and I think be ok

Here's a sample.
new-1.png
new-1.png (4.75 KiB) Viewed 4933 times
The numbers are there solely to help a person see where things are referenced to. Save them counting them.

Re: NML - a Newgrf Meta Language

Posted: 13 Jun 2016 02:30
by GarryG
Found a fault when splitting the tile set for roads and rail to go in the middle .. Vehicle and trains pass through fine .. not a problem.

But when I put a station in middle have a problem as can be seen by these images.
Spliting problem.PNG
Spliting problem.PNG (364.73 KiB) Viewed 4926 times
Maybe I missing something in the code. Some Industry sets in FIRS has the space in middle and stations build there ok.

Hope to figure out why eventually.

Cheers

Re: NML - a Newgrf Meta Language

Posted: 13 Jun 2016 06:28
by Leanden
Ive sent you a pm about this, but the fix is easy, wherever you intend to split the tiles, seperate this into 2 spritesheets and then update the spriteset references for those tiles on the other side of the split to the second spritesheet. Then it wont try drawing the more northern tiles as overlays :)

Re: NML - a Newgrf Meta Language

Posted: 13 Jun 2016 06:50
by GarryG
What I will do is make a few different sizes all with 4 views. That way people can have a variety of choices.

The 4x4 for instance can be used singly, 4x8, and 8x8 with or without spaces between them for roads etc.

I will do a 6x6 set and I think make the 8x8 to have 4 views.

Shall see what I come up with.

Re: NML - a Newgrf Meta Language

Posted: 13 Jun 2016 06:55
by Leanden
I still think the 12x12 will be useful and still as easy to use, pm me the source code and the 8x8 Split gfx and ill show you what i mean :)