Page 1 of 1

Help with a mod: vanilla part control modification & GUI

Posted: Sat Jun 04, 2016 8:23 pm
by Bizobinator
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!

Re: Help with a mod: vanilla part control modification & GUI

Posted: Sun Jun 05, 2016 12:01 am
by Adil
Bizobinator wrote:First, is there a way to modify the control.lua for the vanilla splitters?
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.
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.
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?
By using gui and gui_element and even more custom scripting. Different people come uo with different solutions here.
There's utility mod that handles the easier part - click detection. With gui drawing - you're on your own.