Renai Transportation


Se~no to traditional belts and tiresome walking with these ridiculous ways to transport items and yourself around your factory. Features: Thrower inserters, train ramps, player launchers, bounce pads, ziplines, and more

Content
4 months ago
0.18 - 1.1
33.9K
Transportation Logistics Trains

g Thrower Inserters broken when built by robots [Fixed✅]

4 years ago

Should be a relatively simple fix: you need to listen for on_robot_built_entity and script_raised_built as well as on_built_entity.

Also, have you considered putting the source up on Github?

4 years ago
(updated 4 years ago)

Huh never knew those were different events. I forgot about building by bots, back of my mind I must have figured on_entity_built covered any time an entity was built. Thanks buddy :)

I've never used github though I'm sure I could figure it out. I think you can see the source code from the downloaded zip. What advantage does using github provide?

4 years ago

The main one for me is that people can send you bug fixes, and view the code without having to extract the zip each time you update.

4 years ago

Probably a good idea to also listen to on_entity_cloned, and perhaps script_raised_destroy for removing. there's a good number of mods that use cloned to transfer items between surfaces.

4 years ago

What do you mean by using script_raised_destroy for removing?

4 years ago

Removing should be fine since you don’t take special action on mining. But I forget to mention script_raised_revive, which is what things like Construction Drones use.

4 years ago

Wasn't sure if he kept a list of inserters/player launchers in a table or anything. I haven't looked into his code, just been enjoying the pure memelording.

4 years ago

I didn't actually look at how player launchers are handled. Inserters are in a table, but they're checked for validity during an on_tick handler and cleaned up there, so they don't need any handling when mined.

4 years ago

That seems like a waste of performance. If you have a bunch of them all over the map, constantly checking if each one is valid is wasted cycles, if you don't just properly handle them when they're removed, or check them for valid before use.

4 years ago
(updated 4 years ago)

That is “checking them for valid before use.” :)

The way they work is checking their hands during on_tick, and converting the contents to a projectile.

4 years ago

Ah. I suppose that makes sense. Inserters have always seemed funky to me, and I've seen enough mods that abuse "on tick" and end up being massive performance sinks for minor functions.

4 years ago

I don't know much about optimizing code, I only really cared about making it work (copied a lot from the Robot Army mod for keeping track of and running the throwers) but from what you're saying it sounds like what I wrote is actually not too bad so hey I'll take it lol.
I appreciate all your recommendations too, I could always use the expertise

4 years ago

Actually, if you want. Pyro-Fire is a good resource for optimizing code. Here's a piece he mentions regarding another mod's portals, you can probably apply this to your player throwers. https://mods.factorio.com/mod/RitnTeleportation/discussion/5eb6336d4d447e000c8f5c61

New response