Various NML Questions

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

Moderator: Graphics Moderators

Post Reply
User avatar
Fairyfloss
Traffic Manager
Traffic Manager
Posts: 158
Joined: 03 Aug 2011 14:10
Location: Yes

Various NML Questions

Post by Fairyfloss »

So I've been thinking about my Fantasy Industry Set idea again, and I was wondering if some of these ideas are possible to implement - I don't yet have the time to dive deep into NML to figure it out myself, so I was hoping someone else would know.

Industry changing appearance
This is something I'm pretty sure is possible, but would like confirmation. I'd like industries that completely change how they look once certain conditions are fulfilled.

Industry changing name
I'm much less certain about this, but it's related to the previous question. Is it possible to change an industry's name under certain conditions? So to rename something from 'Iron Deposit' to 'Iron Mine'

Prevent certain town houses from generating until a delivery has been made
Is it possible to make it so that certain town houses will not generate until a specific cargo has been delivered to a town?

Limit certain town houses to only generate in certain quadrants of the map
2TallTyler has some fancy code to make certain industries only generate in certain corners of the map - can the same be done for houses?

Make certain town houses only generate once per town
Pretty sure this is possible, but would like confirmation. Is it possible to make it so that a certain town building can only generate once in a town?
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Various NML Questions

Post by Eddi »

Fairyfloss wrote: 19 May 2022 05:15 So I've been thinking about my Fantasy Industry Set idea again, and I was wondering if some of these ideas are possible to implement - I don't yet have the time to dive deep into NML to figure it out myself, so I was hoping someone else would know.

Industry changing appearance
This is something I'm pretty sure is possible, but would like confirmation. I'd like industries that completely change how they look once certain conditions are fulfilled.
that should be possible. depends on what kind of condition you're thinking of. and if the condition must only be fulfilled once and the change is permanent, or if it should revert back if the condition is not fulfilled anymore.
Industry changing name
I'm much less certain about this, but it's related to the previous question. Is it possible to change an industry's name under certain conditions? So to rename something from 'Iron Deposit' to 'Iron Mine'
no, this is not possible. but you can change the description (the text inside the industry window)
Prevent certain town houses from generating until a delivery has been made
Is it possible to make it so that certain town houses will not generate until a specific cargo has been delivered to a town?
this might be tricky. you can prevent houses from generating, e.g. based on certain information stored in the town, but i don't see how cargo deliveries can be one of the conditions. it might be possible to detect cargos which have a "town effect", but i'm not entirely sure about that. (there are 5 different "town effects": passengers, mail, goods, food and water. you can add these effects to any cargo you like, but you cannot distinguish between cargos which have the same effect.)
Limit certain town houses to only generate in certain quadrants of the map
2TallTyler has some fancy code to make certain industries only generate in certain corners of the map - can the same be done for houses?

Make certain town houses only generate once per town
Pretty sure this is possible, but would like confirmation. Is it possible to make it so that a certain town building can only generate once in a town?
yes, that should be possible
User avatar
Fairyfloss
Traffic Manager
Traffic Manager
Posts: 158
Joined: 03 Aug 2011 14:10
Location: Yes

Re: Various NML Questions

Post by Fairyfloss »

Eddi wrote: 19 May 2022 07:44
Fairyfloss wrote: 19 May 2022 05:15 Industry changing appearance
that should be possible. depends on what kind of condition you're thinking of. and if the condition must only be fulfilled once and the change is permanent, or if it should revert back if the condition is not fulfilled anymore.
It's a one-time condition that will then apply permanently.

In this case, the initial delivery of a 'starter' cargo to change a 'prospected ore site' into an actual mine.
Industry changing name
no, this is not possible. but you can change the description (the text inside the industry window)
I see, unfortunate, but I can work with that.
Prevent certain town houses from generating until a delivery has been made
this might be tricky. you can prevent houses from generating, e.g. based on certain information stored in the town, but i don't see how cargo deliveries can be one of the conditions. it might be possible to detect cargos which have a "town effect", but i'm not entirely sure about that. (there are 5 different "town effects": passengers, mail, goods, food and water. you can add these effects to any cargo you like, but you cannot distinguish between cargos which have the same effect.)
I see, a bit unfortunate, but four options beyond passengers that I can apply to any cargo of choice should provide plenty of choice.
Limit certain town houses to only generate in certain quadrants of the map

Make certain town houses only generate once per town
yes, that should be possible
Very nice, that should make my ideas possible.

One more question, is it possible to make houses that are essentially mini-industries, where they only output something if they've received a delivery of something? I'm guessing not based on earlier answers, but it can't hurt to ask.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Various NML Questions

Post by Eddi »

Fairyfloss wrote: 19 May 2022 08:05One more question, is it possible to make houses that are essentially mini-industries, where they only output something if they've received a delivery of something? I'm guessing not based on earlier answers, but it can't hurt to ask.
as far as i've understood it, you can make houses produce arbitrary stuff based on all sorts of conditions, but they don't receive cargo like industries do. so you might need to get a bit inventive here.
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Various NML Questions

Post by jfs »

You can make town houses accept any cargo, and get payment for the delivery of that cargo, but it might not have any effect on anything.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 7 guests