controlling external led's

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

arjepsen
Posts: 1
Joined: Sat, 3. Jul 04, 17:04
x2

controlling external led's

Post by arjepsen »

Hey.
I just bought a virpil throttle, which has these nice buttons with multi-color LEDs in them.
There is a tool for making the leds light up corresponding to various states in Elite Dangerous (it does so, by reading a status.json file).
In moving on to setting up the throttle with X4, I wonder if there is any way to read some ship and/or game states, outside the game, that would allow the buttons to reflect these game states?
I wouldn't mind doing some minor programming in python or the like if these states would be available in a file, but have anyone done anything like this already?
tezboyes
Posts: 19
Joined: Tue, 1. Apr 08, 20:52
x4

Re: controlling external led's

Post by tezboyes »

Check out the X4 External App on Nexus.
It used Mod Support API to get what it needs.

That should help as a starter so you can see how to read the data.

I did think there was another one too. But I can't recall the name
User avatar
beko
Posts: 81
Joined: Thu, 11. Jun 20, 21:14
x4

Re: controlling external led's

Post by beko »

tezboyes wrote: Fri, 12. Jan 24, 20:14 I did think there was another one too. But I can't recall the name
Mebbe mine: https://github.com/bekopharm/x4-simpit

May need some tinkering for Windows. I don't have a confirmed installation on this yet but I do format the data the way Elite does so processing this should be dead simple.

Image
Trajan von Olb
Posts: 573
Joined: Wed, 4. Feb 04, 21:39
x3tc

Re: controlling external led's

Post by Trajan von Olb »

Hi,

wow, that sounds extremely exciting. I use EDDI for Elite in conjunction with Voice-Attack to control my stage LED spotlights and to control corresponding light scenes to match the ship's status and mode.
Would it be conceivable that EDDI (with adjustments) would also work for X4?
For which states are Elite-like entries generated in the JSON file?

Thanks for any information.

Greetings Trajan from Olb

Translated with DeepL.com (free version)
Mein Traum vom Glück ist der Traum von einer anderen Menschheit. (S. Lem)
User avatar
beko
Posts: 81
Joined: Thu, 11. Jun 20, 21:14
x4

Re: controlling external led's

Post by beko »

Trajan von Olb wrote: Fri, 26. Jul 24, 16:51 Hi,

wow, that sounds extremely exciting. I use EDDI for Elite in conjunction with Voice-Attack to control my stage LED spotlights and to control corresponding light scenes to match the ship's status and mode.
Would it be conceivable that EDDI (with adjustments) would also work for X4?
For which states are Elite-like entries generated in the JSON file?
I don't know EDDI really but I took a quick look at it's source and it appears to parse the ED Status file, which also determines the ship status and mode: https://github.com/EDCD/EDDI/blob/84702 ... ce.cs#L159

x4-simpit does currently implement the following events:
It should be trivial to write a little connector that drops my Status payload as json on the disk, where it can be picked up by EDDI again. Here is an example payload:

Code: Select all

{"Pips":[4,4,4],"Flags":35651912,"Latitude":82136.8359375,"LegalState":1,"Altitude":5,"Heading":-120,"Pos":[82136.8359375,5.880098342895508,144849.140625],"Speed":"10","Oxygen":1,"Health":1,"Shield":1,"FireGroup":1,"Cargo":0,"BodyName":"Argon Prime","Balance":10500,"Fuel":{"FuelMain":0,"FuelReservoir":0},"timestamp":"2024-07-27T17:30:54.777Z","GuiFocus":1,"Longitude":144849.140625,"event":"Status"}
Mind that not all values make sense. X4 has e.g. no PIP management but I included it just for this exact reason to not confuse eventually compatible consumers. See https://github.com/bekopharm/x4-simpit/ ... Status.lua for details. It's still all highly work in progress, of course.

Return to “X4: Foundations - Scripts and Modding”