Renai Transportation


The most unhinged ways to transport items and yourself around your factory. Fling items around with Thrower Inserters, launch your trains off ramps, and soar through your base on electric ziplines! Updated for 2.0! No Space Age special features yet (gotta beat it myself first 🗿) but it's definitely coming

Content
26 days ago
0.18 - 2.0
38.0K
Transportation Logistics Trains

b Error: Item stack count has to be a positive integer. [Probably fixed ✅]

2 years ago
(updated 2 years ago)

My save has run into this error a few different times, which I've been able to work around by reloading an earlier save and then disabling some uses of bounce pads - I think it has something to do with long chains of bounce pads (we were throwing Ore from a mining base at distances more deserving of trains).

Error while running event RenaiTransportation::on_nth_tick(3)
Item stack count has to be a positive integer.
stack traceback:
    [C]: in function 'insert'
    __RenaiTransportation__/control.lua:124: in function <__RenaiTransportation__/control.lua:90>

I'm on 1.0.1, and hadn't seen it in 1.0.0 (though our base was smaller then). https://storage.googleapis.com/nt-ss/misc/renai-thrower-overflow-error-3s-before.zip is a save that reproduces it 3 seconds after loading.

In trying to debug it a bit, I found global.OnTheWay[properties.targets[catapult.held_stack.name].unit_number][catapult.held_stack.name] was -6 in one instance, which meant the total it tried to insert was -5, which crashes.

I was able to resume my save by adding an > 0 to control.lua L121's check:

and global.OnTheWay[properties.targets[catapult.held_stack.name].unit_number][catapult.held_stack.name] > 0) then

Though, I feel like it'd be better to alter script/event/FlyingItems.lua L371 and L385 to include a math.max(0, your_calculation) guard or something, since that's the only way I can imagine the OnTheWay number could become negative, but (I'm not very familiar with Factorio modding) I couldn't figure out how to reload changes made to FlyingItems.lua in my save - it kept running the old one.

Thanks for the hilarious, amazing mod!

2 years ago

That's some fine detective work there. Setting a floor for the calculated amount seems like it would help. I didn't know inserting a negative number would give that error. I also never tried bouncing items thousands of tiles either but I'll give it a shot with your save file

2 years ago

So I'm still not sure why the insert amount is sometimes going negative but I added a check to first set the OnTheWay amount to 0 if it was negative before testing how many will fit in the given inventory, which seems to be working for. I also saw your super long coal bouncing highway which was pretty funny 😆. I'll upload the change tomorrow once I check on one other thing.

2 years ago

Great, I think that fixed it! We've had no issues since :)

Thanks again for this great mod - "hmm, where do I put this demonstration train jump... oh I know, it can fly over our science labs! ---- <boom> err oh I see speed is a factor in landing distance......" - just amazing.

2 years ago

Fantastic 👌 Glad to hear it's working better and that you're having fun with it. The meme dream lives on

New response