Forgive me if there's something already about this. I wasn't even sure how to search for it.
I'd like to be able to interact with outside devices-- an Arduino project connect to my computer via USB, or a background Windows app that uses a built-in web browser to accept inputs from online, etc. I can handle all that stuff, I just need an interface to get data in and out of Factorio.
I can think of lots of cool things to do with this if it's available, like have an in-game display of the temperature in my room, flashing red lights and speaker sounds if someone rings my front doorbell, or an arduino-driven robot that dances every time I launch a nuclear missile.
Is it possible?
Anyway to connect logic circuits to outside world?
-
- Burner Inserter
- Posts: 7
- Joined: Sun Oct 14, 2018 3:14 am
- Contact:
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Anyway to connect logic circuits to outside world?
You should take a look at Cluster I/O. It's a mod that enables cross-server transfer of items/signals etc. The basic idea is (i think) to use file_write() or print() to output data to a file/the console, and RCON to input data via server commands. It requires a fair bit of code on both sides, so i hope your coding skills are well honed :).
For general LEDs there's the RazorChroma support (output only), but i don't know if you can abuse that for your own hardware (i.e. if some sort of protocoll documentation is available).
For general LEDs there's the RazorChroma support (output only), but i don't know if you can abuse that for your own hardware (i.e. if some sort of protocoll documentation is available).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Burner Inserter
- Posts: 7
- Joined: Sun Oct 14, 2018 3:14 am
- Contact:
Re: Anyway to connect logic circuits to outside world?
Hmmmm, interesting.
This seems a lot more elaborate than what I want, but it looks like the programmer is able to get his hooks on some of the information I want to use.
Right now, I'm thinking what I want is to write to a custom log file (i.e. to disk) from a mod, and parse that with a standalone program of my own, which will send serial info to my Arduino. It seems likely that won't be possible though-- I suppose the game designers wouldn't want every dude who comes along having the ability to write whatever they want to a customer's drive.
As for input. . . yeah, it looks like running a private server is going to be the most likely way to receive input from outside. I'm not sure I can spare the time and effort to deal with all that, though.
This seems a lot more elaborate than what I want, but it looks like the programmer is able to get his hooks on some of the information I want to use.
Right now, I'm thinking what I want is to write to a custom log file (i.e. to disk) from a mod, and parse that with a standalone program of my own, which will send serial info to my Arduino. It seems likely that won't be possible though-- I suppose the game designers wouldn't want every dude who comes along having the ability to write whatever they want to a customer's drive.
As for input. . . yeah, it looks like running a private server is going to be the most likely way to receive input from outside. I'm not sure I can spare the time and effort to deal with all that, though.
Re: Anyway to connect logic circuits to outside world?
I'd say just use the Clusterio API and write a mod, you can connect it to something as simple as HTTP on the outside. If you have any trouble, contact the dev. Super nice guy ![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Anyway to connect logic circuits to outside world?
That's exactly what write_file() does (see the api doc). The only limitation is that you can not chose an output root directory. The root will always be /script-output in the factorio config directory.bennyboy1973 wrote: Sun Oct 14, 2018 2:45 pm Right now, I'm thinking what I want is to write to a custom log file (i.e. to disk) from a mod, and parse that with a standalone program of my own, which will send serial info to my Arduino. It seems likely that won't be possible though-- I suppose the game designers wouldn't want every dude who comes along having the ability to write whatever they want to a customer's drive.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Anyway to connect logic circuits to outside world?
Here is a project for you that should be loads of fun: Build the train network from a factorio game using Märklin Digital and use the arduino to control the trains so they mirror the trains in the game.
-
- Burner Inserter
- Posts: 7
- Joined: Sun Oct 14, 2018 3:14 am
- Contact:
Re: Anyway to connect logic circuits to outside world?
Okay, I just saved a test message from a command line in-game and found it in the script-output folder, and was able to make a simple parser. I'll probably just start with a few custom sounds that trigger on important events and work from there.eradicator wrote: Mon Oct 15, 2018 10:25 amThat's exactly what write_file() does (see the api doc). The only limitation is that you can not chose an output root directory. The root will always be /script-output in the factorio config directory.bennyboy1973 wrote: Sun Oct 14, 2018 2:45 pm Right now, I'm thinking what I want is to write to a custom log file (i.e. to disk) from a mod, and parse that with a standalone program of my own, which will send serial info to my Arduino. It seems likely that won't be possible though-- I suppose the game designers wouldn't want every dude who comes along having the ability to write whatever they want to a customer's drive.
I'm currently thinking of finding how to launch a nerf missile with an Arduino.
Okay, now I get the stuff about the need for RCON. That's going to have to be my only way to process input, but it's an order or magnitude more complicated than just dumping text commands to a log from a single-player game, so I'm going to start out with that.
-
- Burner Inserter
- Posts: 7
- Joined: Sun Oct 14, 2018 3:14 am
- Contact:
Re: Anyway to connect logic circuits to outside world?
That's a really fantastic idea, but I don't think I have enough hours left for that in my life. How about YOU build the train, and I'll build the interface for you?mrvn wrote: Mon Oct 15, 2018 10:37 am Here is a project for you that should be loads of fun: Build the train network from a factorio game using Märklin Digital and use the arduino to control the trains so they mirror the trains in the game.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)