Wondering if these things are possible...

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

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

Protium
Posts: 2
Joined: Tue, 16. Jan 24, 02:36

Wondering if these things are possible...

Post by Protium » Tue, 16. Jan 24, 02:49

Greetings, I'm having a ton of fun with X4, but there are two things I would love to have to make the experience better.

First, is there a way to make an input that is designated as a toggle act as a hold? The reason I ask is I'm using a Thrustmaster HOTAS setup. Lots of toggle switches. Unfortunately, a setting like the long-range scanner, for example, is a toggle. So, to activate it, I can flip a switch, but to deactivate it, I need to turn off the switch and then trigger it again. I tried setting toggle="0" in the config xml, but no luck.

The second thing I am looking for is logging of basic game states, fast travel enabled / disabled, target lock on my ship, etc, etc.
The reason I want this is so I can parse the log and automate a LiFX RGB light or two to increase immersion. For example, if an enemy locks me, the light pulses red for a couple of seconds. I turned debug logging on, but none of the messages are relevant. They all seem to relate to the economy and missions. Are there any additional flags I can use?

Are there any mods or modding frameworks that could enable what I'm looking for?

Protium
Posts: 2
Joined: Tue, 16. Jan 24, 02:36

Re: Wondering if these things are possible...

Post by Protium » Thu, 18. Jan 24, 05:01

So, I have found at least one solution to the toggle switch issue. I can use software to create a virtual controller. I can turn a toggle on, into a keypress down, and on release trigger another key down. Currently gaming on my Linux work laptop, so that is a pain in the ass, but doable.


For the issue of getting game state, forget I said logs. Can I use named pipes, or the REST API to tell me if I have engaged travel mode etc? If someone knowledgeable can give me a nudge in the right direction it would be appreciated. I fairly sure it is possible now, but my time to play with this is limited. I just need a target :)

DeadAirRT
Posts: 1038
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Wondering if these things are possible...

Post by DeadAirRT » Thu, 18. Jan 24, 05:11

I don't know much about the pipes thing at all but i think that is the right track. I know this isn't much help but i think a saw a picture of someone's set up that was using game data for stuff on a second screen. Best of luck and maybe try asking on the egosoft discord since someone might know more on there.

Return to “X4: Foundations - Scripts and Modding”