
If I run the exe without the LD_PRELOAD, it still doesn't start which makes me think it's something about the steam exe that's causing issues (when steam isn't running).
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
Not so easy with Steam. I'm running the GOG version and I'm starting it just like that after the lib was compiled:
Code: Select all
LD_PRELOAD="${LD_PRELOAD}:/games/linux/X4_Foundations/game/lib/X4RestServer.so" ./X4 -skipintro
Code: Select all
beko ~ lsof -i tcp:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Main() 73073 beko 5u IPv4 517725 0t0 TCP *:hbci (LISTEN)
Code: Select all
LD_PRELOAD="/path/to/X4RestServer.so" %command% -skipintro
Great that you found this project and nice results so far.
It's providing various documented functions via a REST route returning data as json. This means once running you have to request the data you need via http from the server probably running on localhost. This is described on the project page. You basically have to query the information of interest and poll that information in a loop.Mamy la Puce wrote: ↑Mon, 14. Jun 21, 17:26 How could I use this mod to know some data like for example if the player is on foot or at the controls of a ship, if he take off from the station (or ship docking deck) or is he still docked ? My goal is to be able to use this "feedback" to set up my VoiceAttack profile and that’s typically what I’m looking for !! Does your mod inform about this kind of thing in a text (.json) file ? If so, where can I find this file ?
Code: Select all
var server = 'http://localhost:3000/';
var shipID = 0;
setInterval(function() {
fetch(`${server}GetPlayerShipID`).then((r) => r.json())
.then((data) => {
if(data.func_res !== shipID){
console.log('ShipID changed', data.func_res);
shipID = data.func_res;
}
})
.catch((e) => null)
}, 2000);