Single buildings newgrf

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Otto1988octavius
Engineer
Engineer
Posts: 19
Joined: 08 Jul 2020 00:08

Single buildings newgrf

Post 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?
Attachments
TOKYOSSKYCITY.nfo
(2.17 KiB) Downloaded 19 times
Bad_Brett
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Feb 2007 17:59
Location: Stockholm, Sweden

Re: Single buildings newgrf

Post 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. 😊
Otto1988octavius
Engineer
Engineer
Posts: 19
Joined: 08 Jul 2020 00:08

Re: Single buildings newgrf

Post 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.
User avatar
2TallTyler
Traffic Manager
Traffic Manager
Posts: 197
Joined: 11 Aug 2019 18:15
Contact:

Re: Single buildings newgrf

Post 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.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1512
Joined: 04 Mar 2005 01:07

Re: Single buildings newgrf

Post 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.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests