Page 1 of 1
Is there a way to display game data externally in oolite
Posted: Sun Apr 19, 2020 5:47 am
by Cmd_viperdad
Hi everyone,
I'm new to the game and this is my first post on the forum. I'm building a cockpit and was hoping to display med data on external screens like flight simmers (not sure if that's the term) do with radio sets etc.
Sorry if this is in the wrong section or been asked before but I can't find any info on it.
Thanks
Re: Is there a way to display game data externally in oolite
Posted: Sun Apr 19, 2020 7:38 am
by phkb
Cmd_viperdad wrote: ↑Sun Apr 19, 2020 5:47 am
I'm new to the game and this is my first post on the forum.
Welcome aboard, commander!
Cmd_viperdad wrote: ↑Sun Apr 19, 2020 5:47 am
display med data on external screens like flight simmers
If you mean is it possible to read data from an active game and use it outside of Oolite, the answer is probably, yes, but not in the standard game. The Java Console debugging tool reads data from an active game, so you could potentially use the same pathways for this purposes. But you would need to install the developer release.
Re: Is there a way to display game data externally in oolite
Posted: Sun Apr 19, 2020 7:45 am
by Cmd_viperdad
Hmmmm, that sound complex but worth more research. Thank you for the info. I may just make some seven segments and led blink randomly lol.
Re: Is there a way to display game data externally in oolite
Posted: Sun Apr 19, 2020 11:02 pm
by gilhad
I think, there is one relatively simple way:
- each OXP have access to nearly all game data, so if you look into some of OXP which display something (fighter HUD or such), you probably could copy the way, they get speed, orientation of ship etc. pretty regulary
- then you can make you own OXP, which collects data of your interest in real time
- maybe there is a way to send such data to some COM port or any other Arduino accessible place and then make light show of your choise
- or you can simply log your data in some easy to parse format (like "## SPEED: 1234") and then read Latest.log file by your own program, simply discard all other lines and parse your own lines accordingly
( tail -f Latest.log | grep "## "| myprog.sh )
Re: Is there a way to display game data externally in oolite
Posted: Fri Apr 24, 2020 7:49 am
by Cmd_viperdad
Thanks Gilad. That seems like a workable solution. Would it be better in java script of is it objective C the other on?
Re: Is there a way to display game data externally in oolite
Posted: Sat Apr 25, 2020 7:02 am
by phkb
JavaScript is the weapon of choice for oxp development.
Actually, is the only weapon. But you’re still free to choose it.
Re: Is there a way to display game data externally in oolite
Posted: Tue Sep 10, 2024 6:32 pm
by hiran
gilhad wrote: ↑Sun Apr 19, 2020 11:02 pm
I think, there is one relatively simple way:
- each OXP have access to nearly all game data, so if you look into some of OXP which display something (fighter HUD or such), you probably could copy the way, they get speed, orientation of ship etc. pretty regulary
- then you can make you own OXP, which collects data of your interest in real time
- maybe there is a way to send such data to some COM port or any other Arduino accessible place and then make light show of your choise
- or you can simply log your data in some easy to parse format (like "## SPEED: 1234") and then read Latest.log file by your own program, simply discard all other lines and parse your own lines accordingly
( tail -f Latest.log | grep "## "| myprog.sh )
This third point (maybe there is a way to send such data to some COM port or any other Arduino accessible place) is the blocker. OXPs cannot send data anywhere but the debug console or the logs.
However meanwhile there is a way out: newer versions of OoliteStarter behave like a debug console but rather than bluntly displaying the message in a window it forwards them to MQTT. Plus OoliteStarter is able to receive messages from MQTT and feed it into Oolite.
It allows to add MQTT code to Arduino (and similar) projects so these devices can interact with Oolite. Be it to render information or to collect information for Oolite.
Have a look at
-
https://github.com/OoliteProject/Oolite ... figuration
-
viewtopic.php?t=21653
-
viewtopic.php?p=297155&hilit=mqtt#p297155
Re: Is there a way to display game data externally in oolite
Posted: Tue Sep 10, 2024 8:09 pm
by gilhad
hiran wrote: ↑Tue Sep 10, 2024 6:32 pm
gilhad wrote: ↑Sun Apr 19, 2020 11:02 pm
I think, there is one relatively simple way:
- each OXP have access to nearly all game data, so if you look into some of OXP which display something (fighter HUD or such), you probably could copy the way, they get speed, orientation of ship etc. pretty regulary
- then you can make you own OXP, which collects data of your interest in real time
- maybe there is a way to send such data to some COM port or any other Arduino accessible place and then make light show of your choise
- or you can simply log your data in some easy to parse format (like "## SPEED: 1234") and then read Latest.log file by your own program, simply discard all other lines and parse your own lines accordingly
( tail -f Latest.log | grep "## "| myprog.sh )
This third point (maybe there is a way to send such data to some COM port or any other Arduino accessible place) is the blocker. OXPs cannot send data anywhere but the debug console or the logs.
For that is the fourth point - log it to file, have somewhere else running program, that read the log as it is written a acts on the data somehow (eg. send it to Serial port for Arduino, or display results in window, or anything else or all together
)
But MQTT is nice solution too