[MOD 0.12.x] K&L Inserters

Changing/adding/removing one thing of the game. Doesn't break the game completely, if mod is removed.

[MOD 0.12.x] K&L Inserters

Postby lyravega » Thu Mar 10, 2016 8:11 pm

Type: Mod
Name: K&L Inserters
Description: Adds re-configurable inserters, in addition to 3 new ones
License: CC BY-NC-ND
Version: 0.2.5
Release: 10/03/2016 (Mar 10, 2016)
Tested-With-Factorio-Version: 0.12.26
Category: SimpleExtension
Tags: inserters
Download: Forum Attachment (outdated) (WIP for Factorio 0.13.9 is in 2nd post)
Github
Spotlight Video by Derpdiherp

Image
I think the image will be enough for a description.
I've put out a new version for Factorio 0.13.9, but it is WIP. Till the work is finished, I won't be updating the main post. You can grab it from the 2nd post, but heed the notes down there.

Notes
-Adds more than 5500 prototypes to the game. If the game has any limits, this will surely push it. I tested how many entity prototypes that the game can handle, gave up trying, though.
-Naturally, when you remove the mod, all of the "Candle..Inserter"s will be gone.

Known Issues
-Holding LMB down to (re)place preconfigured candle inserters will spam item place sound
-Again, holding LMB down while placing a rotated candle inserter will spam the same sound
-Using rotate to reconfigure a programmable (smart, advanced) inserter will cut any green/red wires connected to it. Looking for a solution.
-Since every inserter configuration is another entity, power usage statistics will be all over the place. No solutions as far as I can tell; need a property that'd group entities in power usage or something similar.

Version history
v0.2.5
-Fixed various multiplayer bugs
-Fixed a few bugs related to advanced inserters
-Increased advanced inserter speeds by 25%
K&L-Inserters_0.2.5.zip
K&L Inserters v0.2.5 (Old Version)
(136.66 KiB) Downloaded 9162 times

v0.2.4
-Fixed "invalid LuaItemStack" bug
K&L-Inserters_0.2.4.zip
K&L Inserters v0.2.4 (Old Version)
(137.28 KiB) Downloaded 1362 times

v0.2.3
-"Partial" blueprint support has been added: Placing a candle inserter on top of a candle inserter ghost (or blueprint) or a vanilla inserter ghost will skip the configuration interface; the newly built inserters will be preconfigured
-Made upgrading easier: Replacing a candle inserter or a vanilla inserter with a compatible candle inserter (normal / long) will skip the configuration interface; the replaced inserter will be preconfigured (as well)
-Refactored the code a lot
K&L-Inserters_0.2.3.zip
K&L Inserters v0.2.3 (Old Version)
(137.14 KiB) Downloaded 294 times

v0.2.1
-Added blueprint support; Blueprints can now copy Candle Inserters
-Reordered recipes
-Merged some mod files, renamed some, etc... refactored the mod a little bit
-Fixed problems related to item prototypes
K&L-Inserters_0.2.1.zip
K&L Inserters v0.2.1 (Old Version - Stable)
(136.6 KiB) Downloaded 112 times

v0.2.0 - K&L Inserters; "/ˈkændl̩/: Candle" (Kordy & Lyravega)
-First public release
K&L-Inserters_0.2.0.7z
K&L Inserters v0.2.0 (Old Version - Stable)
(118.73 KiB) Downloaded 546 times

v0.1.8
-Generated localization file
-Improved the UI
-Code overhaul

v0.1.7
-Fixed errors occured on multiplayer, and played a little bit of Factorio together, thanks Kordy!

v0.1.6
-Fixed technology icon sizes
-Code tweaks

v0.1.5
-Added new technologies
-Added new icons

v0.1.2
-Rotating a K&L inserter will now pre-select the existing properties; pickup and insert grids, and if "Insert Near" is selected
-Rotating a K&L inserter no longer drops the item to player's inventory; the new inserter entity will be holding a copy of the same LuaItemStack

v0.1.1
As the mod destroys an inserter entity, and creates a new one at the same place, it is causing these issues on rotation as it is a completely new entity:
-Rotating a K&L inserter is causing the held items to disappear
-Rotating a programmable (smart, advanced) K&L inserter is resetting its filters and network conditions
-Rotating a programmable K&L inserter is cutting its wires
Fixes:
-If the inserter is holding an item, it will drop to the player's inventory
-If the smart inserter has any filters and/or network conditions, they will be copied
-Searching the API for a solution to reconnect the entities to each other, if they are wired to one another

v0.1.0
-Added new long inserters; smart long inserter, fast long inserter and advanced inserter
-Improved the UI
-Linked "on_player_rotated_entity" event to the UI
-Adapted the functions to properly handle "on_player_rotated_entity" event

v0.0.5
-Removed K&L burner inserters
-Added "Insert Near" option
-Adapted & improved the UI

v0.0.1
-Added K&L versions of existing inserters (even found a bug on the vanilla smart inserters; they are no longer slower than fast inserters!)
-Made a simple UI for selection
-Linked on_built_entity event to the UI
Old versions can be found under "Version Log", should you encounter issues with newer versions!
K&L-Inserters_0.2.5.zip
K&L Inserters v0.2.5 (Old Version)
(136.66 KiB) Downloaded 9162 times
Last edited by lyravega on Sun Jul 17, 2016 11:48 pm, edited 20 times in total.
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Mon Mar 14, 2016 4:45 pm

Update for Factorio v0.13.x is in progress!

You can download the WIP version from this post, however no migration script is present at the moment and it hasn't been properly tested
K&L-Inserters_0.3.2.zip
WIP - for Factorio 0.13.9
(223.97 KiB) Downloaded 442 times

Things that I've done / been doing so far:
-Remade the mod for Factorio 0.13.x
-Blueprints now work properly (thanks to the new version of Factorio)
-Reduced the entity, recipe and item prototypes by a huge amount (thanks to the new version of Factorio)
-Utilized "global" table, which should solve most of the desync issues
-Added "Import" and "Export" buttons to the configuration menu
-"Export" button acts like "Accept", it configures the inserter to the adjusted layout and saves the layout
-"Import" button acts like "Accept", and only works if there is a saved layout, it configures the inserter with the saved layout
-Added Candle versions of the new inserters, with long handed ones
-Added a new technology "Candle Stack Inserters" that unlocks the new stack inserters
-Candle Advanced Inserters now work much faster
-Added "Candle Advanced Stack Inserter" which is basicly a stack version of advanced inserter, and can be unlocked via same technology
-Altered technology costs, all technologies require some amount of Pack 1 & Pack 2 now (no Pack 3's)
-Candle Basic Long Inserter is now slower (matches the speed of Candle Basic Inserter), and is brighter yellow (vanilla long handed one is red, and is faster)
-Remade (repainted) the sprites for all of the inserters. Long versions now use a similar but lighter/darker colour

Things to be done:
-Bug hunt.
-More bug hunt
-A migration script. I'd like to make one for existing saves, because I love you people :)
Last edited by lyravega on Mon Jul 18, 2016 7:38 pm, edited 20 times in total.
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Mon Mar 14, 2016 6:17 pm

If you would like to help me test stuff in multiplayer, add me on Steam! :)
Last edited by lyravega on Fri Jul 08, 2016 12:54 am, edited 2 times in total.
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby Arch666Angel » Mon Mar 14, 2016 6:22 pm

Ok that is a solution for all your inserter problems :D Nice mod and very nice in bringing it all together in a simple way. Will definitely try it.

One question: Does it include the express inserter from bobs? Or does it generate the inserters dynamically from what is there?
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
 
Posts: 1277
Joined: Sun Oct 18, 2015 11:52 am
Location: Darmstadt, Germany

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Mon Mar 14, 2016 7:09 pm

Arch666Angel wrote:One question: Does it include the express inserter from bobs? Or does it generate the inserters dynamically from what is there?


Nah, no express inserters. But you can save some insert time by cross-inserting; instead of grabbing from top and put it to bottom, you can grab from top-left and put it to bottom left for example, and reduce the amount of time an inserter spends for rotation.

I'll put a remote function later on to allow other mods interface with this, but problem is localization files which has to be pre-generated as far as I can tell. I'd like to make the mod dynamic since pretty much everything is pre-defined now, but as I've said, it raises a few other problems unfortunately.

edit: I thought about adding faster inserters, but it'll increase the number of prototypes that this mod adds to the game by a huge amount. So I added advanced inserters and made them faster instead; but just noticed that they share the same speed values with fast/smart inserters, I'll correct it later on. Wish pickup & insert positions were adjustable from the API, it'd reduce the load of this mod by a huge amount.
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby GotLag » Tue Mar 15, 2016 12:28 am

lyravega wrote:Wish pickup & insert positions were adjustable from the API, it'd reduce the load of this mod by a huge amount.

Coming in 0.13, along with definable hotkeys: place an inserter, press a custom hotkey while mousing over it to open the GUI and choose direction. Only one entity required, I can't wait :)
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Tue Mar 15, 2016 11:50 pm

GotLag wrote:Coming in 0.13, along with definable hotkeys: place an inserter, press a custom hotkey while mousing over it to open the GUI and choose direction. Only one entity required, I can't wait :)


Oh where does it say so? Did I miss it or something? :)
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby GotLag » Wed Mar 16, 2016 12:03 am

You can learn a lot hanging around in IRC and pestering devs :)
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] K&L Inserters

Postby daniel34 » Wed Mar 16, 2016 12:15 am

Sometimes it also helps to read the FFFs:
Friday Facts #108 - Unexpected features wrote:Rseding91 is quite productive, and he is coming with new ideas quite often. Thanks to him, our internal 0.13 branch (the next big release) already contains interface for scripts to register their own keyboard shortcuts, possibility to create new gui element types from script and much more.
daniel34
Global Moderator
Global Moderator
 
Posts: 2625
Joined: Thu Dec 25, 2014 7:30 am
Location: Austria

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Wed Mar 16, 2016 12:31 am

Thanks for the replies :)

Found a bug related to blueprints. You can save a blueprint with Candle Inserters in it, but construction robots will not build them. It is a big oversight on my part as every entity has its own item, and unless you have those items ready, construction robots will not be able to do their jobs. I'll release another update tomorrow or something. I found a cheesy workaround for the issue, it doesn't exactly solve the problem, but allows you to put an inserter down with pre-configured settings that the blueprint ghost has.

API talk
I looked through the API, and found something that may be of some help solving my issue; LuaEntityPrototype has a key called "items_to_place_this". So I assume different item prototypes can be linked to one entity prototype, as this key is a table. This doesn't solve my issue though; I need one item that can be used as a "construction block" for multiple entities and I believe this is not possible. LuaItemPrototype also has something called "item_to_clear", which I'm not really sure how can be used. I assume it is related to blueprints, but cannot find any examples for this as well, maybe I can solve my issues via this as well.
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby ALittleGreenStone » Fri Mar 18, 2016 9:56 pm

"_ _ K&L-Inserters _ _/control.lua:61: attempt to index global 'script' (a nil value)"

It is the error message I get trying to load a game, or starting a new one.
I have the same issue with KS power [where it says _ _ KS_Power _ _/control.lua:9: attempt to index global 'script' (a nil value)]
could anyone tell me how to solve this?
ALittleGreenStone
Burner Inserter
Burner Inserter
 
Posts: 18
Joined: Thu Mar 17, 2016 12:03 pm

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Fri Mar 18, 2016 10:05 pm

You are using an old version of Factorio, please update :)

In other news, a new version is out, v0.2.3. I wasn't able to properly implement blueprint support; drones will not take a candle inserter and place it. However, you can do so without any problems. While I was focusing on this, I also thought making upgrading easier would be preferred by many people, so I also added that in too.

Now, when you place a candle inserter on a vanilla inserter, the candle inserter will be preconfigured, having same pickup & insert positions. Same with ghosts & blueprints. Only restriction when replacing is whether the inserter is long handed or not; Advanced inserter is counted as long inserter which I'll be fixing later though. Like in vanilla, if the inserter is programmable (smart, advanced) the filters and conditions will be transferred however you need to reconnect the inserter if it was wired to something, I haven't found a workaround for that yet.

Anyway, I hope this update makes your life a little bit easier. If you encounter any problems, please report, and if you want to use an older "working" version, you can find them under "Version Log" as well.
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby ALittleGreenStone » Fri Mar 18, 2016 10:32 pm

lyravega wrote:You are using an old version of Factorio, please update :)


I am using 0.12.3;
Tested-With-Factorio-Version: 0.12.26
would indicate that I should have a newer version of the game than what it was tested with.
Or does this statement refer to an older version of the mod, and simply wasn't updated?

...Sure, I can try updating the game, but I'd prefer not to, as I really don't want to lose the saves and neither the compatibility with the mods I'm already using.
ALittleGreenStone
Burner Inserter
Burner Inserter
 
Posts: 18
Joined: Thu Mar 17, 2016 12:03 pm

Re: [MOD 0.12.x] K&L Inserters

Postby daniel34 » Fri Mar 18, 2016 10:55 pm

ALittleGreenStone wrote:
lyravega wrote:You are using an old version of Factorio, please update :)


I am using 0.12.3;
Tested-With-Factorio-Version: 0.12.26
would indicate that I should have a newer version of the game than what it was tested with.
Or does this statement refer to an older version of the mod, and simply wasn't updated?

...Sure, I can try updating the game, but I'd prefer not to, as I really don't want to lose the saves and neither the compatibility with the mods I'm already using.


The Factorio version numbering system is a little bit confusing for some, it is 0.12.[x], where x increases by one each version. So it goes 0.12.0 to 0.12.9, then 0.12.10 to 0.12.19, and then 0.12.20 to 0.12.27 (current version).

Your 0.12.3 is about half a year older than 0.12.26.
daniel34
Global Moderator
Global Moderator
 
Posts: 2625
Joined: Thu Dec 25, 2014 7:30 am
Location: Austria

Re: [MOD 0.12.x] K&L Inserters

Postby ALittleGreenStone » Sat Mar 19, 2016 1:52 am

daniel34 wrote:
ALittleGreenStone wrote:
lyravega wrote:You are using an old version of Factorio, please update :)


I am using 0.12.3;
Tested-With-Factorio-Version: 0.12.26
would indicate that I should have a newer version of the game than what it was tested with.
Or does this statement refer to an older version of the mod, and simply wasn't updated?

...Sure, I can try updating the game, but I'd prefer not to, as I really don't want to lose the saves and neither the compatibility with the mods I'm already using.


The Factorio version numbering system is a little bit confusing for some, it is 0.12.[x], where x increases by one each version. So it goes 0.12.0 to 0.12.9, then 0.12.10 to 0.12.19, and then 0.12.20 to 0.12.27 (current version).

Your 0.12.3 is about half a year older than 0.12.26.


You mean to tell me, it's not 0.12.3(0), but 0.12.(0)3...?

I suppose it's about time for some updates, then. Thanks for the help, now I have an idea why it didn't work.
ALittleGreenStone
Burner Inserter
Burner Inserter
 
Posts: 18
Joined: Thu Mar 17, 2016 12:03 pm

Re: [MOD 0.12.x] K&L Inserters

Postby Ratzap » Sat Mar 19, 2016 4:26 pm

I just wanted to post and let you know I think your inserters are fantastic. The idea of letting me select where the arm starts and ends it's movement with a simple tick box for near side is just genius. It let me ditch all the other inserter mods with the dozens of weird n wacky variants (all of which have similar names). Less clutter, full function.

10/10, bravo etc, Thanks.
Ratzap
Filter Inserter
Filter Inserter
 
Posts: 343
Joined: Sun Aug 16, 2015 11:15 pm

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Sun Mar 20, 2016 2:34 am

Thanks Ratzap, I appreciate the feedback. Even though "silence" generally means "good", sometimes it is better to hear something is working properly (or not) from time to time :)
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby RitchieS » Wed Mar 23, 2016 3:05 pm

Hey, I found a crash that occurs when placing (any)objects down when you hold your mouse down and drag, once your hand is "empty" you will get this error:
Code: Select all
Error while running the event handler: __K&L-Inserters__/control.lua:155: LuaItemStack API call when LuaItemStack was invalid.


Ill try to find more info on this crash/error, maybe even a solution.
Its quite annoying though, because if it happens it will kick you out the game and you'll have to load an autosave.

For the rest, this is by far one of my favorite mods, and I hope you'll be able to fix the issue soon. :)

EDIT:
I made a quick video of it since I was able to reproduce the error reliably(In Multiplayer & Single Player).
Hopefully that helps you understand why it happens. :)
https://youtu.be/hGeAthPM6sQ
RitchieS
Manual Inserter
Manual Inserter
 
Posts: 1
Joined: Thu Mar 10, 2016 5:10 am

Re: [MOD 0.12.x] K&L Inserters

Postby lyravega » Wed Mar 23, 2016 5:46 pm

Thanks RithchieS, I fixed that error but noticed additional ones (the ones that are more of an annoyance - they won't boot you from your game). I am thinking of a way to fix them without reducing functionality of the mod, meanwhile I'll upload the fix for the thing you've reported.

edit: To clarify the issues, if you grab a candle inserter, rotate it, and hold down the LMB to place the item down, you will keep replacing the same inserter over and over. This is because every candle inserter faces south, even if you rotate it in your hand and build it, it'll be rotated to south. So fast replace is trying to do what it is supposed to do, since you have an entity on the ground that is facing south, and the one in your hand is not. That's the first issue.

Second thing is, if you are upgrading vanilla inserters, or placing a candle inserter on a blueprint, you'll get the very same issue that is caused by fast replace. Lets say you have a Candle Advanced Inserter, however its internal name is different than the one you are holding in your hand. And as such, fast replace will keep replacing it over and over.

I am looking for solutions, but either I need to lose some functionality, or explore other ways. I'll be doing the latter, of course, but if I cannot find a way, I think I'll get rid of 0.2.3 easy upgrade & blueprint functionalities... But I think I can remove vanilla fast replace functionality from candle inserters, and expand the replace function a little bit to keep 0.2.3 functionality and mimic vanilla fast replace at the same time. We'll see :)
lyravega
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Mon Jan 06, 2014 4:41 pm

Re: [MOD 0.12.x] K&L Inserters

Postby Sander_Bouwhuis » Fri Mar 25, 2016 8:37 am

1.
Is v0.2.4 the version that has the fix you mentioned?

2.
With v0.13 your mod will work better because of something the developers added?
Sander_Bouwhuis
Long Handed Inserter
Long Handed Inserter
 
Posts: 88
Joined: Mon Dec 07, 2015 10:45 pm
Location: The Netherlands

Next

Return to New Items, Entities, Extensions

Who is online

Users browsing this forum: No registered users and 3 guests