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

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

1 year, 9 months ago
(updated 1 year, 9 months 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!

1 year, 9 months 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

1 year, 9 months 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.

1 year, 9 months 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.

1 year, 9 months ago

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

New response