Surfaces Transport

by Danacus

Generic transportation utilities for the surfaces mod

Content
1 year, 2 months ago
1.1
636
Transportation

b crash: attempt to index field 'registry' (a nil value)

1 year, 2 months ago
(updated 1 year, 2 months ago)

The mod Surfaces Transport (1.0.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Surfaces_Transport::on_init()
Error when running interface function SurfacesAPI.register_portal: Surfaces_API/script/portal.lua:196: attempt to index field 'registry' (a nil value)
stack traceback:
Surfaces_API/script/portal.lua:196: in function 'register'
Surfaces_API/script/interface.lua:61: in function <Surfaces_API/script/interface.lua:60>
stack traceback:
[C]: in function 'call'
Surfaces_Transport/control.lua:4: in function 'register_portals'
Surfaces_Transport/control.lua:150: in function <Surfaces_Transport/control.lua:149>

installed mods:
https://prnt.sc/HTC_v86hampl

1 year, 2 months ago

I think I might know why this is happening. I think the on_init event is called on Surfaces Transport, but not on the Surfaces API mod. Since on_configuration_changed runs after on_init, the runtime tables are loaded too late, and on_init runs on Surfaces Transport before Surfaces API has loaded its tables.

I'll try to fix it when I have time. For now, can you try creating a new save with the mods you have installed right now. I think that should work, otherwise there's something else I'm missing.

1 year, 2 months ago

You could try removing this on_init handler if you like: https://gitlab.com/Danacus/surfaces-transport/-/blob/master/control.lua?ref_type=heads#L149

I'm not sure if this will fix it and can't test it right now.

1 year, 2 months ago

Fixed in version 1.0.2

1 year, 2 months ago

OK, thx, no crash. there ore some items, but no ladder,
I found a shaft up/down but have not figured out how it works.

1 year, 2 months ago

That's the ladder, it should work, unless something else is broken.

1 year, 2 months ago
(updated 1 year, 2 months ago)

I already thought so, based on the description, ;-)
but there is no reaction if go to/over the shaft, or pressing enter

1 year, 2 months ago

I'll see if I can reproduce this problem. It's supposed to just teleport you whenever you walk over it.

1 year, 2 months ago

I am unable to reproduce this issue unfortunately. Can you share a save file in which the issue occurs?

1 year, 2 months ago

You could also try running the /surface_down and /surface_up commands. That way we can figure out if the surfaces are there at least. It might be the "portals" that broke, but it could also be related to the surface registration.

1 year, 2 months ago

I would prefer to press enter, to avoid accidentally falling down a ladder ;-) or to facilitate positioning with the exo-skeleton
but that's a point to talk about later, just to keep in mind.
for the fast moving problem I had created for years a mod with 2 user inputs using Page-Down/Page/Up to change the surface with the teleport command.

1 year, 2 months ago
(updated 1 year, 2 months ago)

BTW the commands are working
It's just all cave walls.
and cool, in this version you have main surface names (here nauvis) included, this facilitates the assignment
https://prnt.sc/13QfY6NlgrmZ
The transport items seems not to work, I would expect a counterpart, but nothing there.
but you can take care of that when you have time and desire, at present it is sufficient for testing my mod.
Thx and sorry for the unplanned disruption of your schedule

1 year, 2 months ago
(updated 1 year, 2 months ago)

The surface names are not standardized though. Each surface generation picks its own names based on the main surface and the index.

The Surfaces API mod does store a table of all surfaces, so I could expose an interface to get the different layer surfaces of each planet if you're interested in such functionality.

It makes sense that transport of items doesn't work either if transport of players isn't working. My best guess is that the portals from Surfaces Transport were not registered properly.

Ah, I'm able to reproduce it now on a new save. This is a regression of my patch: on_configuration_changed is not called on world creation. You can fix the issue by enabling another mod, to force a configuration change. I'll find a way to fix this, because both the current approach and the previous one are broken.

1 year, 2 months ago

an api to get the main surface and/or the the next up-/down floor would be very nice and also safely.
at pressent i use a pattern, this was sufficient for testing for the first time

i start a new game und no sub surface was generated on placing a Shaft

1 year, 2 months ago

I just pushed an update to a few of the mods that should resolve all issues. Please let me know if that fixed the issues for you as well.

I'll add an API to get registered surfaces.

1 year, 2 months ago

I have added new interface methods. You can find documentation in the README or description. You can also find an example here: https://gitlab.com/Danacus/factorio-surfaces/-/blob/master/src/control.lua?ref_type=heads#L41

1 year, 2 months ago

now i see a preview of the surface (black walls and sky)
the character teleports, but does not change the surface. not your fault. my ZoomRunning interfers with you mod, So I have to fix it too.
Without ZoomRunning the surface is switched as I know it from the old mod. nice
I'll take a look at the interface later, too.

1 year, 2 months ago

Let me know if there's anything I can change or add to my mods that could improve compatibility.

1 year, 2 months ago
(updated 1 year, 2 months ago)

a setting that, when enabled, allows you to change the surface by pressing enter (like getting into a car/train) would be very helpful, the activation distance should be up to 2 tiles (or adjustable would be perfect), then you don't have to aim so precisely with the exoskeleton on. my experience is that i always run past ;-) if more portals are near the closest one should be used.

do you plan (sometime) to fill the sub surface with resources and enemies like in the old mod?
IBTW like to explore cave mazes with surprises

1 year, 2 months ago

a setting that, when enabled, allows you to change the surface by pressing enter (like getting into a car/train) would be very helpful, the activation distance should be up to 2 tiles (or adjustable would be perfect), then you don't have to aim so precisely with the exoskeleton on. my experience is that i always run past ;-) if more portals are near the closest one should be used.

Should be doable, but I might need to use a CustomInputEvent, so I'm not sure if using enter for that as well will work as expected.

do you plan (sometime) to fill the sub surface with resources and enemies like in the old mod?
IBTW like to explore cave mazes with surprises

I really wanted to do this: I wanted to add exploration, dungeons, different resources and stronger enemies on lower layers, etc. However, I ran into a few issues:

  • Factorio makes it really difficult to have distinct world generation for different surfaces: it's a confusing mess that's hard to understand and debug. It's like they never really intended for there to be multiple surfaces.
  • The amount of tiles is quite limited, and mods like Alien Biomes keep destroying my tiles as a "solution"
  • I'm a programmer, not a 3D animator: I really can't make graphics (you might be able to tell from the complete lack of new graphics).

I enjoy building a framework that could enable other mods to add new content on different layers, but when trying to add the content myself, I quickly lost motivation, which also kind of killed my general motivation for this mod.

I'm hoping that factorio 2.0 will bring some improvements that would solve the first two issues, but I'm afraid I won't really find the motivation to add actual content to the different layers. I just don't enjoy it as much as programming.

1 year, 2 months ago

the problem with the generation of different surfaces was solved well by earendel (of course i don't see how much work is behind it) maybe a cooperation can be organized or at least an exchange of knowledge.

lol yes i know the missing 3D animator problem, we have too few of them.

BTW the interface is working like a charm, thank you

1 year, 2 months ago

he problem with the generation of different surfaces was solved well by earendel (of course i don't see how much work is behind it) maybe a cooperation can be organized or at least an exchange of knowledge.

Yeah, maybe. But I think I'd rather wait for factorio 2.0 and hope there will be improvements. I also won't really have a lot of time to work on mods anyway, since I'll be busy with other things.

BTW the interface is working like a charm, thank you

No problem! I'm glad to hear it's working well.

New response