Page 1 of 1

[closed] surface.type

Posted: Mon Aug 29, 2016 11:56 pm
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.

Re: surface.type

Posted: Tue Aug 30, 2016 1:05 am
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.

Re: surface.type

Posted: Tue Aug 30, 2016 3:35 am
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. :/

Re: surface.type

Posted: Tue Aug 30, 2016 5:33 am
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