Vehicle Wagon 2


Take with you a fully charged and battle-ready vehicle and take it on a rail trip. --------------------------------------------------------------------------------- Возьмите с собой полностью заряженный и готовый к бою транспорт и отправьте его в путешествие по железной дороге.

Content
1 year, 3 months ago
0.17 - 1.1
17.3K
Transportation Trains Combat

b Crash when winching Schall Tank Platoon heavy tank onto vehicle wagon

4 years ago

Error while running event VehicleWagon2::on_tick (ID 0)
LuaInventory API call when LuaInventory was invalid.
stack traceback:
VehicleWagon2/control.lua:56: in function 'getItemsIn'
VehicleWagon2/control.lua:184: in function <VehicleWagon2/control.lua:138>
stack traceback:
[C]: in function 'index'
__VehicleWagon2
/control.lua:56: in function 'getItemsIn'
VehicleWagon2/control.lua:184: in function <VehicleWagon2/control.lua:138>

https://mods.factorio.com/mod/SchallTankPlatoon

4 years ago

I assume that this happened when you tried to install a tank from the Shall Tank Platoon modification to a freighter from Vehicle Wagon 2?

4 years ago

Yes. Loading the vanilla tank onto the vehicle wagon does not cause a crash.

4 years ago
(updated 4 years ago)

I do not see yet a real solution to this problem, except for the installation of a stub with an error. I try to come up with something in the near future, if possible.

If you want more rapid development of events, I think you should contact Schallfalke to support the Vehicle Wagon on his part. I suspect that he now has more time and skills.
All have access to GitHub.
Sorry I can't fix it right now.

4 years ago

Hi, I just noticed this post "by chance" when I am looking for 0.17 update of this good mod.

Just happily download this mod and test. I am using Schall Tank Platoon 0.17.9 and Vehicle Wagon 2 1.2.11.
I can reproduce your bug, by having "vehicle fuel cell" in the tank grid.
The cause is "vehicle fuel cell" is a burner (consuming chemical fuel like wood, coal, solid fuel) but have NO burnt fuel inventory.
So the solution is to have validity check before.
Line 56 should be changed to:

if equipment[i].burner.burnt_result_inventory.valid then
items.grid[i].burner.burnt_result_inventory = equipment[i].burner.burnt_result_inventory.get_contents()
end

Line 119-121 (117-119?) should also be changed to:

if items.grid[i].burner.burnt_result_inventory then
for name, count in pairs(items.grid[i].burner.burnt_result_inventory) do
equipment.burner.burnt_result_inventory.insert{name = name, count = count}
end
end

I submitted the above changes to your GitHub.

There is a minor flaw (but not crash) though. The MK3 tanks (including light tank MK3, heavy tank MK3) are consuming nuclear fuel, and they have burnt fuel slots. I winched these onto the vehicle wagon, and winched them back onto the ground. The result is... those "used uranium fuel cell" disappeared from the burnt fuel slot.

4 years ago

Greetings. Thank you for providing me invaluable assistance in supporting this mod at a time when I cannot physically find the time to support it.
I accepted your changes applied to GIT.

4 years ago

You are welcomed.

I am quite new to Git, so I could be wrong.
But I saw you only "accept commit" without "merge commit". The changes were not made into your master branch.
So if I remove my fork, these changes could be lost.

4 years ago

If they merge the pull request, then the commits will be added to their repository and they wont get lost if you delete your fork. Forks are separate copies and are totally independent. If the master gets deleted then the forks wont change either.

4 years ago

Alright, nice to know.
I am just confused because the files are still "old" ones in your master branch.
Anyway, if you say so, I can remove my fork then.

4 years ago

Just downloaded latest version 1.2.12. Was trying to propose #7 and #8.
But I realize NONE of my last changes in the file. Can you please check if commits are really merged?
(Plus I need your control.lua updated, in order to send commit #8.)

4 years ago

Yes you are right!
I did not follow the versions of the mod. And also I didn’t correctly understand how GIT works.
Today I will upload a new version with changes from you.

4 years ago

Version updated, corrections made. Please check the performance, since right now I do not have access to my workplace.

4 years ago

Hi, now I come back to this.
Tested 1.2.13, which finally includes the changes. Nice.

I have also pulled request "Apply burnt fuel inventory with checking #8".
Burnt fuel inventory of vehicles should be handled with those extra 8 lines.

New response