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.6K
Transportation Logistics Trains

i Request: Throwing a water based vehicle (ie. Ironclad) should deploy that vehicle [Done βœ…]

1 year, 27 days ago

Would you have any interest in adding an integration with Earendel's AAI Vehicles: Ironclad mod (https://mods.factorio.com/mod/aai-vehicles-ironclad)? It would be super dope if I could use a thrower inserter to toss an Ironclad into water and have it deploy automatically! I'm not super great with lua, but I'm willing to help if I can. Even just testing or documentation, if that's helpful.

1 year, 23 days ago

Actually that'd be pretty easy. I've never used that mod myself. What would be the benefit of being able to deploy those ships automatically?

1 year, 23 days ago
(updated 1 year, 23 days ago)

I'd really like to be able to automate launching a large naval attack, but throwing all the boats down by hand is a pain. I'd like to be able to wire up a circuit to have a tosser throw a boat into the water every minute or so to stage up an attack. Because, you know... science.

11 months ago

Done πŸ‘Œ

11 months ago

You are an absolute legend! I'll grab the new version and try things out.

11 months ago

I updated and tried things out. I was able to toss a regular Ironclad into water and it deployed! Yeet the boat and there she blows! Fantastic work, my friend!. Many many thanks! I then tried an AI version of the Ironclad and got an error (AI mortar variety). It might be a good excuse for me to learn a little more lua and see if I can add handling of the AI vehicle sub-types. You use github to track your mod, I think?

The mod Renai Transportation (1.2.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event RenaiTransportation::on_nth_tick(3)
Unknown entity name: RTItemProjectile-ironclad-ironclad-mortar18
stack traceback:
[C]: in function 'create_entity'
RenaiTransportation/control.lua:283: in function <RenaiTransportation/control.lua:75>

11 months ago

Update on this:

Regular, non-programmable Ironclad's can be tossed into water, but the AI flavors throw an error in create_entity. To enable the AI flavors of the Ironclad, you need the AAI Programmable Vehicles mod (https://mods.factorio.com/mod/aai-programmable-vehicles).

I've created a test save that demonstrates the issue with version 1.2.1 of RT. There are three chests and three thrower inserters. Each is controlled by a constant combinator that is set to off. If you turn the combinator on, the inserter throws whatever is in the chest.

Uploaded to: https://factoriobox.1au.us/map/info/68672a455e421ba0486bbdc533342d554dc3d2d95af591cd11dacd9018761484

In the save, the first chest contains a regular Ironclad. You toss it and it deploys. The second chest contains an Ironclad of the AI mortar type. The third contains one of the AI cannon type. Tossing either of the later two result in an error.

Error form the mortar type:

Error while running event RenaiTransportation::on_nth_tick(3)
Unknown entity name: RTItemProjectile-ironclad-ironclad-mortar18
stack traceback:
[C]: in function 'create_entity'
RenaiTransportation/control.lua:283: in function <RenaiTransportation/control.lua:75>

Error from the cannon type:

Error while running event RenaiTransportation::on_nth_tick(3)
Unknown entity name: RTItemProjectile-ironclad-ironclad-cannon18
stack traceback:
[C]: in function 'create_entity'
RenaiTransportation/control.lua:283: in function <RenaiTransportation/control.lua:75>

11 months ago

I'm going through Earandel's code in AAI Programmable Vehicles to understand the difference between the regular Ironclad and the AI varieties. It looks like his code "splits" the Ironclad into entities ironclad, ironclad-ironclad-mortar, and ironclad-ironclad-cannon, in his prototypes/entity/entity-update-externals.lua file.

Down in aai_split_vehicle(), he takes a vehicle and creates new entity types with it based on the valid gun types associated with the vehicle. The ironclad has two valid guns named "ironclad-mortar" and "ironclad-cannon". He creates new entity types like "original_type" .. "-" .. "gun_type", resulting in "ironclad-ironclad-mortar" and "ironclad-ironclad-cannon".

That all seems straightforward. What I don't yet understand is why "RTItemProjectile-ironclad-ironclad-mortar18" isn't valid as an entity name in create_entity. It looks like those item projectile entity types are created down in your MakeProjectile() function?

Looking through my game log, I see your code creates the below projectile types.

1.225 Script @RenaiTransportation/data-final-fixes.lua:809: Creating item projectile for item-with-entity-data: ironclad
1.229 Script @RenaiTransportation/data-final-fixes.lua:809: Creating item projectile for gun: ironclad-cannon
1.229 Script @RenaiTransportation/data-final-fixes.lua:809: Creating item projectile for gun: ironclad-mortar

The AI flavor types aren't listed, just the vanilla ironclad and the guns by themselves. So that loop isn't picking up ironclad-ironclad-mortar and ironclad-ironclad-cannon when creating projectile types... I just don't understand why.

11 months ago

Here's the full log from an example crash: https://pastes.io/n5rnnjhssv

11 months ago

Hey there m8. So long story short what I SHOULD do is make a projectile with a placeholder graphic that the game can use to throw any item not caught by my loop.

While the game loads, each mod takes it's turn loading things in. So unfortunately if, after my mod's turn, another mod adds another item then my mod will miss it. The order mods load in is somehow determined by the game. We can get around this by setting ironclad as an optional dependency so it will load before my mod and then I can catch all the ships, but I think having a placeholder projectile is more future proof.

11 months ago

Ah of course! Mod load order! That should have been the first thing that came to my mind. I'll play with it and see if that helps get me further along.

As for a placeholder projectile type to future proof things, what graphic do you think you would use?

11 months ago

I was able to get things working with the AI varieties of the Ironclad. I have a fork of your mod on github, and I sent you a pull request with the necessary changes. It comes from my branch named fr-1.2.1-ironclad.

Super simple change. I added optional dependencies on the AAI Ironclad and AAI Programmable Vehicles mods and put in a tiny change in the flying items event handler. And it worked! I was able to deploy all 3 types of boats.

11 months ago

Nice work man πŸ‘

11 months ago

Thank you so much for including this! You are the best! I can now yeet my fleet!

New response