Spidertron Dock


A spidertron dock for efficient spidertron transportation on Space Exploration's spaceships. Allows docking spidertron's passively which cost zero integrity on spaceships.

Utilities
1 year, 4 months ago
1.1
17.2K
Transportation Circuit network

b [Not a bug] Spertron Dock + Spidertron Logistics System

1 year, 7 months ago

Hello!
Found a nasty bug when combining Spertron Dock + Spidertron Logistics System. Once a Spidertron has been docked and undocked, it no longer accepts logical requests from the Spidertron Logistics System. Can this be fixed? Thank you.

1 year, 7 months ago

Hello! I had a look, I could recreate it, but I think this is bug is actually on Spidertron Logistic System's side. I made a bug report on that mod, which you can fine here.

Thank you for the report :)

1 year, 7 months ago

I think it uses on_player_placed_equipment because it needs to get the spiderID. I still haven't found how, using the on_equipment_inserted event, you can get the spiderID in which this very equipment is located. And what other events are called when undocking? Or did I not understand something? I read the descriptions of the on_equipment_inserted event, and did not find how, through the passed classes, to get to the spiderID into which the equipment is inserted.

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

Yeah, I also think that's why it uses that event, you're right. But as mentioned, it doesn't capture everything, so to make the mod robust on_equipment_inserted has to be used.

There are ways to make it work, and here is two:
- The only difference between the two functions is with the current one you have player, which is used to determine on which surface the event happened, and then search that surface for spiders that this event might belong to. Because player will not be know in the other event the mod could simply scan all surfaces, but this will be slightly slower.
- A much better way (and I think the best way) is cache all existing spider grids with grid.unique_id as key ([grid.unique_id] = spider. That way, when using the all-encapusling event it's a simple table-lookup to determine which spider it belongs to (e.g. spider = cache[event.grid.unique_id). Super fast and robust. The unique IDs for grids may not have been available when this mod was created (which would make this method impossible), so maybe that's why it wasn't used in the first place.

So it's definitely possible :)

New response