Should look something like this (untested code):
local inv1 = ???.get_inventory(defines.inventory.cargo_wagon)
local inv2 = ???.get_inventory(defines.inventory.cargo_wagon)
for i,#inv1 do
inv2[i].set_stack(inv1[i])
end
I.e. enumerate all slots, and transfer the LuaItemStack as is. There's ...
Search found 8 matches
- Fri May 04, 2018 6:52 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
- Thu May 03, 2018 5:29 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
Re: [0.16.36] WIP Mod - Train Engineer - help needed
Bah. I didn't know trains can't be teleported. I just assumed they're entities and it would really make the code significantly less bug prone. The post says "trains" can't be teleported (as a whole) though. So maybe there's a chance left for individual carriages to.../sigh.
I played a bit around ...
I played a bit around ...
- Wed May 02, 2018 7:00 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
Re: [0.16.36] WIP Mod - Train Engineer - help needed
So here are my open questions:
1) What happens at a Train::id overflow? If it is happening at all. Is there a way to preserve the old train id and give it to a new created train?
2) Is there a clean way to copy settings like inventory filters and blocked slots from a source carriage to a new ...
1) What happens at a Train::id overflow? If it is happening at all. Is there a way to preserve the old train id and give it to a new created train?
2) Is there a clean way to copy settings like inventory filters and blocked slots from a source carriage to a new ...
- Wed May 02, 2018 6:44 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
Re: [0.16.36] WIP Mod - Train Engineer - help needed
UUh nice, TTD alike train turn around at final station.
Do you need to recreate the whole train or do you just move the locos?
Moving the loco would change the wagon order relative to the loco. So not really an option. "Tower of Hanoi" style teleporting wagon swapping might work. I hightly ...
Do you need to recreate the whole train or do you just move the locos?
Moving the loco would change the wagon order relative to the loco. So not really an option. "Tower of Hanoi" style teleporting wagon swapping might work. I hightly ...
- Wed May 02, 2018 6:20 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
Re: [0.16.36] WIP Mod - Train Engineer - help needed
UUh nice, TTD alike train turn around at final station.
Do you need to recreate the whole train or do you just move the locos?
It is a 'full' rebuild. The hole train gets scanned, then destroyed one by one and finally rebuild one by one in reversed order.
'full' means: carriage by carriage ...
Do you need to recreate the whole train or do you just move the locos?
It is a 'full' rebuild. The hole train gets scanned, then destroyed one by one and finally rebuild one by one in reversed order.
'full' means: carriage by carriage ...
- Wed May 02, 2018 6:08 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
Re: [0.16.36] WIP Mod - Train Engineer - help needed
Mobile cuts off your quote because chrome sucks, but i can answer 1 question for you. Train-id wont overflow in any normal game, game.tick will before the train id does, since it's also uint32_t. So you dont need to concern yourself with that unless you create hundreds of new trains per tick, every ...
- Tue May 01, 2018 8:43 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
Re: [0.16.36] WIP Mod - Train Engineer - status update
Hi again,
still working on my mod, sadly no answers whatsoever. Some questions I solved myself, with some I could still need help. And many new features...
Here's a gif of Bob working ...
TE_working.gif ...
still working on my mod, sadly no answers whatsoever. Some questions I solved myself, with some I could still need help. And many new features...
Here's a gif of Bob working ...
TE_working.gif ...
- Sun Apr 22, 2018 9:13 pm
- Forum: Modding help
- Topic: [0.16.36] WIP Mod - Train Engineer - help needed
- Replies: 14
- Views: 6360
[0.16.36] WIP Mod - Train Engineer - help needed
Hi,
I'm Sven, playing Factorio since 0.14 and new into modding Factorio. Until 3 weeks ago I had no clue of modding in Lua or Factorio. In the past i used many of the awesome mods here e.g. LTN, yuoki, Warehousing, ...
In Factorio i like especially the trains and I have a beauty & symmetry OCD. I ...
I'm Sven, playing Factorio since 0.14 and new into modding Factorio. Until 3 weeks ago I had no clue of modding in Lua or Factorio. In the past i used many of the awesome mods here e.g. LTN, yuoki, Warehousing, ...
In Factorio i like especially the trains and I have a beauty & symmetry OCD. I ...