Editing FIRS to make a North American Industry Set

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

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Editing FIRS to make a North American Industry Set

Post by NekoMaster »

Ok for some reason now stuff works, even if I change stuff a little to get it to load up with my economy as well as chaning the cargo outputs, for example, I changed the Pyrite Smelter to put out chemicals and fertilizer

I have no idea what I did to make it work, but Il'll just go with it for now until another issue pops up. Hopefully I can get something done today so I can test if my industry chains works properly. Kind of sucks that i'm limited to 32 cargos as I would have loved to have a proper nuclear chain with uranium ore, nuclear fuel, and nuclear waste (which would have been sent to a processing facility to re-enrich the waste to make more nuclear fuel at a slight loss of materials so you dont get a positive feed back loop)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Editing FIRS to make a North American Industry Set

Post by NekoMaster »

Ok so I've run into another Error when trying to make my own Nuclear Power Plant.

I'm not familier with this stuff so I dunno how to fix it. I do have a sprite sheet labled "nuclear_power_plant_1.png" so theres that, but aside from that I dunno what to do.

Code: Select all

[RENDER GRAPHICS] (not currently used)
[RENDER DOCS] render docs
Traceback (most recent call last):
  File "src/render_docs.py", line 48, in <module>
    import firs
  File "/mnt/d/USERS/MATTHEW/Dropbox/~ OpenTTD Projects ~/[GRF] North American Industry Set/src/firs.py", line 27, in <module>
    import industries
  File "/mnt/d/USERS/MATTHEW/Dropbox/~ OpenTTD Projects ~/[GRF] North American Industry Set/src/industries/__init__.py", line 14, in <module>
    from industries import nuclear_power_plant
  File "/mnt/d/USERS/MATTHEW/Dropbox/~ OpenTTD Projects ~/[GRF] North American Industry Set/src/industries/nuclear_power_plant.py", line 26, in <module>
    disallow_industry_adjacent=True))
  File "/mnt/d/USERS/MATTHEW/Dropbox/~ OpenTTD Projects ~/[GRF] North American Industry Set/src/industry.py", line 764, in add_tile
    new_tile = Tile(self.id, *args, **kwargs)
  File "/mnt/d/USERS/MATTHEW/Dropbox/~ OpenTTD Projects ~/[GRF] North American Industry Set/src/industry.py", line 40, in __init__
    self.numeric_id = global_constants.tile_numeric_ids[self.id] # don't fail this silently, tile id must be defined
KeyError: 'nuclear_power_plant_tile_1'
Makefile:78: recipe for target 'docs' failed
make: *** [docs] Error 1
Heres a copy of the code for my "nuclear_power_plant.py"

https://pastebin.com/qxzMXFMp
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Editing FIRS to make a North American Industry Set

Post by andythenorth »

You need to define a tile ID for your nuclear plant tiles. Look in src/global_constants.py

At some point, you have to learn the NML industry spec :) https://newgrf-specs.tt-wiki.net/wiki/NML:Industries

FIRS automates away some of the spec for you, but no hiding from all of it.

If you can compile your own OpenTTD, then you can have 64 cargos :twisted:
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Editing FIRS to make a North American Industry Set

Post by NekoMaster »

andythenorth wrote:You need to define a tile ID for your nuclear plant tiles. Look in src/global_constants.py

At some point, you have to learn the NML industry spec :) https://newgrf-specs.tt-wiki.net/wiki/NML:Industries

FIRS automates away some of the spec for you, but no hiding from all of it.

If you can compile your own OpenTTD, then you can have 64 cargos :twisted:
Well I got my stuff to work, I also have my own bank now

I want my GRF to be compatible with Vanilla TTD though if they do increase the max cargo types in future versions that'd be nice.

Also, I wonder how one would bring the gold mine back using the TTD/OPenGFX graphics like what was done with the sawmill.
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Editing FIRS to make a North American Industry Set

Post by andythenorth »

NekoMaster wrote:Also, I wonder how one would bring the gold mine back using the TTD/OPenGFX graphics like what was done with the sawmill.
- the sawmill uses the ottd sprite numbers (look in sawmill.py)
- you can get sprite numbers in-game using the newgrf dev tools, start a game with the baseset and find the relevant sprite numbers from a gold mine with the sprite inspector
- default industry layouts are listed in the wiki https://newgrf-specs.tt-wiki.net/wiki/I ... faultProps
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Editing FIRS to make a North American Industry Set

Post by NekoMaster »

@Andy

How would I go about enabling placement of ports, bulk terminals, and other marine industry on river/lake tiles? is there any way to change the checks those industries use for coastal tiles and just have them see if they're being placed next to water period?

BTW, thanks for the help so far, I'm already figuring out quite a bit with the FIRS 3.0.10 code. I was even able to add my own nuclear reactor sprite to the power plant graphics code to make my own nuclear power plant (seperate from the regular power plant so they both have their own code and graphcis)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Editing FIRS to make a North American Industry Set

Post by andythenorth »

NekoMaster wrote:How would I go about enabling placement of ports, bulk terminals, and other marine industry on river/lake tiles? is there any way to change the checks those industries use for coastal tiles and just have them see if they're being placed next to water period?
There probably is, but I'm not sure, iirc coast tiles are counter-intuitive because they are land, but also report sea. I can't remember if that's true, newgrf spec probably knows. NML might also have some magic to hide away some of the complexity, again, spec might know.
BTW, thanks for the help so far, I'm already figuring out quite a bit with the FIRS 3.0.10 code.
Thumbs up. ;)
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 81 guests