Page 1 of 1

How to base a surface on a LuaSurfacePrototype?

Posted: Fri Oct 25, 2024 9:23 am
by Pi-C
I've some surfaces that are strictly for mod-internal purposes, not intended to be visited by players. But the surfaces I've created are visible in the "Surfaces" GUI from Remote view. So, I want to hide my surfaces.

Luckily we now have the LuaSurfacePrototype, where we can set the properties 'hidden' and 'hidden_in_factoriopedia', so I've defined a surface prototype where these properties are set to "true". The new prototype shows up alright in the in-game prototype browser. But how do I use it?

I can't seem to find a way to apply my new surface prototype when I create a LuaSurface in the control stage. Does anybody have an idea how to do that?

Re: How to base a surface on a LuaSurfacePrototype?

Posted: Fri Oct 25, 2024 10:01 am
by Xorimuth
Pi-C wrote: Fri Oct 25, 2024 9:23 am I've some surfaces that are strictly for mod-internal purposes, not intended to be visited by players. But the surfaces I've created are visible in the "Surfaces" GUI from Remote view. So, I want to hide my surfaces.

Luckily we now have the LuaSurfacePrototype, where we can set the properties 'hidden' and 'hidden_in_factoriopedia', so I've defined a surface prototype where these properties are set to "true". The new prototype shows up alright in the in-game prototype browser. But how do I use it?

I can't seem to find a way to apply my new surface prototype when I create a LuaSurface in the control stage. Does anybody have an idea how to do that?
LuaSurfacePrototypes are only for use as space platforms. You want https://lua-api.factorio.com/stable/cla ... ace_hidden instead.

Re: How to base a surface on a LuaSurfacePrototype?

Posted: Fri Oct 25, 2024 10:12 am
by Pi-C
Thank you, I'll try that! I didn't even think of looking for hiding surfaces in LuaForce …

Re: How to base a surface on a LuaSurfacePrototype?

Posted: Sun Oct 27, 2024 3:48 am
by jamiechi1
"You want https://lua-api.factorio.com/stable/cla ... ace_hidden instead."

I am having difficulty understanding the syntax of the documentation for the LUA classes.
I see the '::' (double quote thing) all over. What does it mean?
I searched the internet and have only found reference to '::=' which appears to be something else.

Re: How to base a surface on a LuaSurfacePrototype?

Posted: Sun Oct 27, 2024 5:54 am
by DaveMcW
:: is just a separator between the name and type of the variable. This is a factorio.com convention, it is not a standard usage in any programming language.

Re: How to base a surface on a LuaSurfacePrototype?

Posted: Sun Oct 27, 2024 7:31 pm
by jamiechi1
Thanks. I would prefer to see it how I would actually code it. The documentation in Factorio is a bit confusing.
And I have been programming since 1976 (First year in college). And many years working at Microsoft.
I think the documentation needs a bit of work. Part of this may be the translation from whatever language the Developers use, to English.