Hello!
So, I'm making a mod (1st foray into modding!) that, ideally, would allow the player to select a splitter & then change the ratio of items split between the two output lanes.
I have a fairly decent idea of how to do the logic/switching/stuff. But, I have a few questions & I was hoping I could get some help.
First, is there a way to modify the control.lua for the vanilla splitters? If so, how do I specify to overwrite that with my mod? Would it be better off just making separate items?
Secondly, I'd like to make it so that clicking on a given splitter (or custom splitter) opens a gui. How do I go about that?
Thanks guys!
Help with a mod: vanilla part control modification & GUI
-
- Fast Inserter
- Posts: 193
- Joined: Fri May 06, 2016 10:35 pm
- Contact:
Re: Help with a mod: vanilla part control modification & GUI
Vanilla splitters don't have any control.lua, actually, no entity whatsoever does. Control.lua is generally associated to the instance of the game itself. The parameters of entities are defined in data.lua, any scripting is impossible to associate to them through there.Bizobinator wrote:First, is there a way to modify the control.lua for the vanilla splitters?
If you want to create a custom behavior, you'll have to keep track of all splitters not set to 50:50 and manually teleport items to their rightful positions.
By using gui and gui_element and even more custom scripting. Different people come uo with different solutions here.Bizobinator wrote:Secondly, I'd like to make it so that clicking on a given splitter (or custom splitter) opens a gui. How do I go about that?
There's utility mod that handles the easier part - click detection. With gui drawing - you're on your own.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.