Sandboxed LuaCombinator

by IWTDU

Program combinators with lua. Now there is a version with outputs isolated from inputs!

Content
4 years ago
0.17 - 0.18
19
Circuit network

i Shared code

4 years ago

This mod is amazing. Thanks!

Do you think there is a reasonable way to add some method of code sharing? I realise that you are trying to avoid global state... but this seems like it could be useful.

E.g. I want to control my train stations and the code is exactly the same at each station. I would be nice to have one central repo for the code. Something like a new combinator that only exports code and then a read only global value that works like inputs[...]?

4 years ago

It's not documented anywhere, but that's what the buttons numbered 0-21 do.

https://mods.factorio.com/mod/SandboxedLuaCombinator/discussion/5e39730ef4f8e5000cd3ac48

4 years ago

That is quite handy thanks. Not quite what I wanted though, I'd like a way for the shared function to only have to be updated in one place. This way I still need to update it on each combinator. Still useful, but not quite there.

4 years ago

One option is to use one of the signal transmission mods like https://mods.factorio.com/mod/shortwave. It may then be possible to have a single lua combinator controlling multiple remote entities. I still believe the shared&updatable code would be useful, if that were possible though

4 years ago

It would take a good bit of work to make the interface intuitive for determining which combinator is the "master" repository for each code base. I'm not sure it's going to fit in the theme of this mod.

I'm currently working on the same sort of project--putting a LuaCombinator each on several thousand train tracks. At the moment the most annoying thing is that long programs are not properly stored in blueprints and must be memory-loaded or shift-click copied afterwards. Since shift-clicking works regardless of size, you can update an entire line of tracks by running down with your mouse button held.

4 years ago

That makes sense. Thanks for the feedback :)

4 years ago

If code could be exported into a "memory chip" item, it could then be ferried down and inserted. Essentially, the combinator would accept memory chip that would have its code. You could make the code and build a memory chip with the code burned on it from inventory and place it on a single combinator. Else, you could make a factory that takes that cartridge recipe and builds copies of it that then can be send via in-game mechanics down to their respective combinators.

You could then save the memory chip as blueprint, which is essentially your code without the processing unit. Sort of like saving the code to a pen drive.

New response