[closed] surface.type

Things that we aren't going to implement
Post Reply
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[closed] surface.type

Post by aubergine18 »

Currently there's no way for a mod to know what a surface represents, with the exception of Nauvis.

For example, there are mods out there that have factory surfaces, underground surfaces, even surfaces inside trains or in the sky. It's likely we'll get other planet surfaces at some point, as well as asteroids, and probably all kinds of other crazy stuff in the coming years.

Would it be possible to add a surface.type :: string (R) to help describe or categorise surfaces in an open-ended manner?

Initial surface types could be:

* 'terrain' (eg. a planet surface, like Nauvis, or an asteroid surface)
* 'building' (eg. factorissimo)
* 'underground' (eg. for caves, etc)

Mods that implement surfaces could choose from a list of recommended types, but could also add their own if substantially different.

This would allow other mods to determine if a surface is applicable home to entities they define, or swap placed entities to more applicable entities for the kind of surface. For example, some entities might only work outdoors (terrain surfaces); or if placed indoors (building surfaces) may require a different entity graphics, etc.

This would make it much easier for other mods to get some idea about the nature of a surface. The only other option is to try and keep track of all the mods that implement custom surfaces and find a way to categorise them based on surface names or some other aspect of a surface.
Last edited by aubergine18 on Tue Aug 30, 2016 12:31 pm, edited 3 times in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13793
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: surface.type

Post by Rseding91 »

That's what the surface name property is for.

Other than that, it's up to the mod author to determine how they want to treat surfaces. If you want to have mod compatibility with other mods then you need to talk to the other mods and decide on some system for yourselves about how you want to treat each others mod created surfaces.
If you want to get ahold of me I'm almost always on Discord.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: surface.type

Post by aubergine18 »

But each surface has to have a unique name does it not? Which would result in needing to do something like a 'string.startsWith()' (custom function) to get the consistent part of a name, and even then it will need hard-coded dictionary to map those name portions to surface types. I'm really just thinking of a macroscopic way to categorise surfaces that all mods could use. :/
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: surface.type

Post by Nexela »

aubergine18 wrote:But each surface has to have a unique name does it not? Which would result in needing to do something like a 'string.startsWith()' (custom function) to get the consistent part of a name, and even then it will need hard-coded dictionary to map those name portions to surface types. I'm really just thinking of a macroscopic way to categorise surfaces that all mods could use. :/
The real problem is a surface is just that "a surface" and since we can have a virtually unlimited number of surface "types" there would be no way to reliably code this in because here is what would happen

[mod interface request] -> please add surface.type moon for me! (replace moon with whatever type we want.


P.S add your support here :) viewtopic.php?f=28&t=31869&p=200857#p200857

Post Reply

Return to “Won't implement”