Change code for inserters and belts?

Place to get help with not working mods / modding interface.
Post Reply
Nick-Nack
Inserter
Inserter
Posts: 36
Joined: Tue May 31, 2016 11:03 am
Contact:

Change code for inserters and belts?

Post by Nick-Nack »

Hi there!

I would like to create a mod doing certain things, but based on what I found up to this point, I'm not sure if this is possible with reasonable effort.
The idea is to make a harder version where it is even more important to balance resources. Therefore I would like to implement the following changes:
1. Belts keep on moving items even if there is a jam.
2. Inserters don't stop inserting at a certain limit.
3. Inserters try to insert items that they can grab even if they are not the correct type for the production building (e.g. inserting copper plates into a smelter)
4. All items that are to be inserted into a full or unfitting building or moved by a belt even though there is a jam are scattered on the ground instead.

I tried to find the lua implementation for the corresponding behavior of the inserters and belts, but couldn't find it. Is it possible to find it somewhere, or are these behaviors hardcoded in C?
Would be great if someone with more modding experience could help me out! :)

Best,
Nick-Nack

Sean Mirrsen
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Wed Apr 27, 2016 6:30 pm
Contact:

Re: Change code for inserters and belts?

Post by Sean Mirrsen »

Unfortunately the inserters' behavior is hardcoded - if the destination is full they will not even try to insert an item, and the same will happen with an item of a "wrong type", and there is no realistic way to override it. The belts carrying items even if they are filled up can probably only be done by a complex script monitoring every placed building to see if it's a belt, and checking if it isn't connecting to another belt, then constantly running updates on those belts and spawning items that would have "fallen off" on the ground while clearing them off the belt, in a very rapid cycle - meaning, it would kill performance very very quickly even if done right.

So no, I would say it's probably completely unfeasible right now.

Nick-Nack
Inserter
Inserter
Posts: 36
Joined: Tue May 31, 2016 11:03 am
Contact:

Re: Change code for inserters and belts?

Post by Nick-Nack »

What a bummer. There are so many mods trying to make the combat harder, but for me the game is more about automization, and this would be an easy way to make this part of the game harder.
Well, maybe I can convince the devs to have a look at this some day :D

Post Reply

Return to “Modding help”