Page 1 of 6

[MOD 0.16] Vehicle Wagon 1.2.5

Posted: Wed Aug 24, 2016 5:48 am
by Supercheese
Vehicle Wagon
Vehicle Wagons.jpg
Vehicle Wagons.jpg (725.97 KiB) Viewed 18544 times
Here's a video of the mod in action: https://www.youtube.com/watch?v=zvvqUfUhfds

Info / Long Description:
  • Name: Vehicle Wagon
  • Latest Release: v1.2.5, June 18, 2018
  • Factorio Version: 0.16.51
  • License: MIT License
  • Author: Supercheese, with graphics by the awesome YuokiTani. Additional contributions from: Mooncat, The_Destroyer, Phasma Felis, & Brant Wedel.
  • Github: https://github.com/Suprcheese/Vehicle-Wagon
This mod allows you to load your fully-laden car or tank onto a flatbed train wagon and take it with you on your rail journeys!
Just use the Winch to haul your vehicle onto the wagon, and use the same Winch to haul it back off when you're ready to drive off.
No more tedious re-inserting ammo, fuel, etc. into your combat vehicle after a long trip by rail to some remote outpost!

The awesome flatbed wagon graphics are courtesy of YuokiTani!
The wagon tarp graphics for supporting unidentified vehicles provided by Brant Wedel.

This mod should play well with other tank or car mods, and has been successfully tested with the following mods from the mod portal:
  • Bob's Warfare
  • Advanced Tanks by Neomore
  • Tanks! by LCruel
  • SuperTank by binbinhrf
  • Trucks by KatzSmile
  • VW Transporter by steinio
Modded vehicle models will revert to a standard, grey-colored version while riding on the wagon, but after unloading it should be back to normal.

Vehicles that this mod cannot automatically identify, including aircraft, will be loaded on the wagon covered in a tarp.

You also cannot winch vehicles that have a passenger; all players must exit vehicles before loading/unloading.


Known Issues/Quirks:

For the time being, DO NOT STORE BLUEPRINTS IN VEHICLES, since blueprints lose their stored data when transported on a Vehicle Wagon.

If a mod adds a "car"-type entity that is not meant to be an actual vehicle, such as the Nixie Tubes mod (used to; it has changed by now), it may still be able to be loaded on a Vehicle Wagon under a tarp.
Specific exceptions have been added for Nixie Tubes (and other mods) to disallow this, but other mods may exist that this mod lacks exceptions for.

In Factorio v0.15, it seems that the following issues are greatly ameliorated, but do still exercise caution:

When a Vehicle Wagon is at the end of a train, everything seems to work just fine.
If a Vehicle Wagon is in the middle of a train, however, then when loading/unloading vehicles, the wagon tends to become disconnected from the train.
There is currently no way to connect wagons via script, but fixing it by hand is simple: just hop into the wagon or locomotive and press the "Connect train" hotkey (G by default).
I recommend getting into the habit of always pressing G after winching vehicles around.

Furthermore, if you have your Vehicle Wagon at the end of your train, and another train is very close behind, the wagon can sometimes get confused and reattach itself to the wrong train.
Should this happen, both trains will be in Manual mode and won't run away on you, so you'll have plenty of time to manually fix the issue.

Version history

Re: [MOD 0.13] Vehicle Wagon 1.0.0

Posted: Wed Aug 24, 2016 6:55 pm
by TheTom
> Of course, you aren't allowed to load your aircraft onto wagons, as there'd be no point!

Why not? Transporting a small aircraft is doable IRL and it means I can have a train to go away AND have easy access to a scout plane - which DOES Make sense when for example building a remote base.

Re: [MOD 0.13] Vehicle Wagon 1.0.0

Posted: Wed Aug 24, 2016 7:30 pm
by Supercheese
TheTom wrote:> Of course, you aren't allowed to load your aircraft onto wagons, as there'd be no point!

Why not? Transporting a small aircraft is doable IRL and it means I can have a train to go away AND have easy access to a scout plane - which DOES Make sense when for example building a remote base.
Well, the aircraft from the aircraft mod have no collision_box, and I rely on checks for collision to determine the presence of a vehicle, so it doesn't work with the aircraft. :?

Re: [MOD 0.13] Vehicle Wagon 1.0.0

Posted: Thu Aug 25, 2016 8:20 am
by Supercheese
Updated to 1.0.1:
  • Improved the flying text that appears if you pick up a loaded vehicle wagon.
  • It is no longer possible to ride in empty vehicle wagons.
  • Added support for the Trucks mod by KatzSmile.

Re: [MOD 0.13] Vehicle Wagon 1.0.1

Posted: Thu Aug 25, 2016 5:41 pm
by Mooncat
Small but interesting mod! And I love this new variant of cargo wagon. Thanks for the mod. :D

Re: [MOD 0.13] Vehicle Wagon 1.0.1

Posted: Thu Aug 25, 2016 6:13 pm
by steinio
Yes graphically this mod is an eyecatcher.

I guess on that can be placed everything like chests or turrets.

Re: [MOD 0.14] Vehicle Wagon 1.0.2

Posted: Sat Aug 27, 2016 9:29 pm
by Supercheese
Updated for Factorio 0.14. Vehicle equipment grids are now preserved during transit!

Re: [MOD 0.14] Vehicle Wagon 1.0.2

Posted: Sat Aug 27, 2016 9:37 pm
by Thomasnotused
Very cool! Although it is unfortunate to hear about the incompatibilies with the aircraft mod. It runs off of collision boxes you say? I'll have to look into stuff.

EDIT: Collision box thingy fixed, but unfortunately the graphics are incompatible! It's sad, but nothing we can do, at least not at the moment.

Re: [MOD 0.14] Vehicle Wagon 1.0.3

Posted: Wed Oct 05, 2016 7:58 am
by Supercheese
Version 1.0.3 uploaded, making vehicles now remember their inventory filter settings after being transported on a Vehicle Wagon, and additionally a German translation courtesy of ST-DDT on GitHub.

Re: [MOD 0.14] Vehicle Wagon 1.0.3

Posted: Fri Oct 07, 2016 12:42 am
by Cobra1117
I was still getting a "nil filters" error with the latest (1.0.3) version of the mod. Changing this code:

Code: Select all

function setFilters(entity, filters)
    for i = 2, 3 do
to this:

Code: Select all

function setFilters(entity, filters)
    if filters == nil then
        filters = {}
    end
    for i = 2, 3 do
fixed the problem

Re: [MOD 0.14] Vehicle Wagon 1.0.4

Posted: Fri Oct 07, 2016 2:52 am
by Supercheese
I was testing a bunch, trying to replicate that issue, and I finally did, after trying to quickly unload multiple loaded vehicle wagons. Version 1.0.4 has the fix, which is similar to what you suggest.

Re: [MOD 0.14] Vehicle Wagon 1.0.4

Posted: Fri Oct 07, 2016 4:20 am
by Cobra1117
Cool! Thanks!

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Tue Oct 11, 2016 4:46 am
by Supercheese
Version 1.0.5 out to resolve another issue: Now mining (i.e. picking up) a loaded Vehicle Wagon now drops the vehicle as if it was winched off of the wagon.

In previous versions, the vehicle and its contents were inserted directly into the player's inventory, but this could result in lost items if the player had insufficient inventory space available.

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Mon Oct 17, 2016 5:15 am
by Ulithium_Dragon
Overall this works great, but as sort of mentioned in the description I am having some issues with one particular train configuration: Single-track trains.

The issue is that for trains with locomotives on each end that are intended to run back and forth along a single non-looping track, loading the vehicle waggon causes the train to separate into two different trains.

So say I have a locomotive on one end, then a cargo car, then the vehicle wagon, then a rear-facing locomotive. When I load a vehicle into the waggon, the rear locomotive detaches with the vehicle wagon, becoming a separate train.

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Mon Oct 17, 2016 6:50 am
by Supercheese
Ulithium_Dragon wrote:Overall this works great, but as sort of mentioned in the description I am having some issues with one particular train configuration: Single-track trains.

The issue is that for trains with locomotives on each end that are intended to run back and forth along a single non-looping track, loading the vehicle waggon causes the train to separate into two different trains.

So say I have a locomotive on one end, then a cargo car, then the vehicle wagon, then a rear-facing locomotive. When I load a vehicle into the waggon, the rear locomotive detaches with the vehicle wagon, becoming a separate train.
Yeah, it's a known issue. Until we get some way to connect/disconnect wagons via script, there's nothing I can do to fix it.

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Sat Oct 22, 2016 9:23 pm
by epiccraft_tv
I'm not sure why, but my game kicks me out of the world when I try to winch a car or vehicle....

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Sun Oct 23, 2016 12:40 am
by Supercheese
epiccraft_tv wrote:I'm not sure why, but my game kicks me out of the world when I try to winch a car or vehicle...
As the crash dialogue indicates, that is a bug with Powered Entities.

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Wed Oct 26, 2016 10:00 pm
by aubergine18
This may be of use when creating/destroying vehicles from other mods: https://github.com/aubergine10/lifecycle-events

Re: [MOD 0.14] Vehicle Wagon 1.0.5

Posted: Sat Oct 29, 2016 11:20 am
by Cyrlynx
Hi,
Thanks for your great mod idea!

I have several bugs to report though:
  • As Aubergine's said, I face bugs when placing item into vehicle after unloading from your wagon:
    Error while running event on_player_placed_equipment (ID 38)
    LuaEntity API call when LuaEntity was invalid.
    stack traceback:
    __electric-vehicles-lib__/src/main.lua:345: in function <__electric-vehicles-lib__/src/main.lua:343>
    It seems to come from other mod but in fact it's from yours as seen in the Aubergine's GitHub thread or in this one :
    viewtopic.php?f=34&t=34952&start=60&hilit=vehicle+wagon
  • Also, another problem is that the energy state of the unloaded vehicle drops to zero (shield, battery...) :
    By looking at your code, I noticed that you use your own methods to place the vehicle on the wagon and unload it.
    Now, when I pickup a vehicle into my inventory and place it again, it's equipement remains charged AND it doesnt' trigger the bug with my other mods.
  • I cannot access the grid of your wagon?
  • About the deconnection of the wagon if in the middle of a train :
    the vanilla wagon got updated mesh to show open door when they stop and they don't disconnect,
    yours happened because you changed entity type to reflect cargo type
So I'm wondering, can you use the vanilla pickup to store the vehicle as an item onto the wagon,
by giving it one slot inventory and adjust mesh by checking cargo to solve all this?

Re: [MOD 0.14] Vehicle Wagon 1.0.6

Posted: Mon Oct 31, 2016 7:59 am
by Supercheese
Version 1.0.6 uploaded, which has compatibility fixes that should -- together with the Electric Vehicles 0.3.5 update -- make transporting electric cars on vehicle wagons work much more smoothly.