Page 1 of 1

Single buildings newgrf

Posted: 12 Aug 2020 14:01
by Otto1988octavius
I've been trying convert rspeed's 2x2 tokyo skyscraper into stand alone file. The game pops the first sprite. Shows in jgr scenario editor. Says undefined string.

File attached below works on 1x1 buildings.

Didn't code before. Just know basic stuff.

Where can i find more about values of the properties of the actions other than wiki?

Re: Single buildings newgrf

Posted: 13 Aug 2020 21:08
by Bad_Brett
I think it would be easier to use nml. There's a tutorial in the wiki that's really good. While nml also can be challenging at first, replacing buildings is really easy. 😊

Re: Single buildings newgrf

Posted: 14 Aug 2020 20:14
by Otto1988octavius
Bad_Brett wrote: 13 Aug 2020 21:08 I think it would be easier to use nml. There's a tutorial in the wiki that's really good. While nml also can be challenging at first, replacing buildings is really easy. 😊
I city build in editor. Needed to skip restrictions 4 zone & availabity.

Re: Single buildings newgrf

Posted: 14 Aug 2020 23:25
by 2TallTyler
Otto1988octavius wrote: 14 Aug 2020 20:14 I city build in editor. Needed to skip restrictions 4 zone & availabity.
You don't have to set these restrictions. Just use ALL_TOWNZONES.

Re: Single buildings newgrf

Posted: 16 Aug 2020 03:18
by OzTrans
Otto1988octavius wrote: 12 Aug 2020 14:01 I've been trying convert rspeed's 2x2 tokyo skyscraper into stand alone file. The game pops the first sprite. Shows in jgr scenario editor. Says undefined string. ...
You have quite a bit of code missing for that 2x2 building ...

- Each tile requires its own ID, in consecutive order.
- You need for each tile an action-0, -2 and -3.
- Action-0 property 8 needs to point to a TTD-original 2x2 building (the stadium is a good candidate, it has the IDs 0x20, 0x21, 0x22 and 0x23).
- The tiles need to be coded in the order of North, East, West and South.

Check the sample code below.

Code: Select all

Action-0s
	00 07 nn 01 00 08 20 09 10 ...
	00 07 nn 01 01 08 21 09 00 ...
	00 07 nn 01 02 08 22 09 00 ...
	00 07 nn 01 03 08 23 09 00 ...
	
	[check GRF specifications what needs to be set to other values for additional tiles and 
	 what needs to be the same for each tile]
	
Action-1 Block
	
Action-2s
	02 07 10 41 8D 0F 00 00 00 00 00 00 00 80 02 00 00 00 00 10 10 19 80
	02 07 11 41 8D 0F 00 00 00 00 00 00 00 80 02 00 00 00 00 10 10 19 80
	02 07 12 41 8D 0F 00 00 00 00 00 00 00 80 02 00 00 00 00 10 10 19 80
	02 07 13 41 8D 0F 00 00 00 00 00 00 00 80 02 00 00 00 00 10 10 19 80
	
	[values need to be adjusted, so that for each tile the correct sprites in the 
	 action-1 block are selected]

Action-3s
	03 07 01 00 00 10 00
	03 07 01 01 00 11 00
	03 07 01 02 00 12 00
	03 07 01 03 00 13 00
Everything you need to know is documented in the GRF specifications.