Author Topic: New Elite Dangerous status.json  (Read 3888 times)

jcdick1

  • Jr. Member
  • **
  • Posts: 59
New Elite Dangerous status.json
« on: November 15, 2018, 06:07:58 PM »
I suck at non-decimal math (binary, hex, etc).  Frontier is adding a status.json file to the game that contains the current status of hardpoints, landing gear, lights, etc.  But the flags are encoded as bits in an integer.

From the docs:

Flags:
Bit           Value Hex           Meaning
0                1    0000 0001 Docked, (on a landing pad)
1                2    0000 0002 Landed, (on planet surface)
2                4    0000 0004 Landing Gear Down
3                8    0000 0008 Shields Up
4              16    0000 0010 Supercruise
5              32    0000 0020 FlightAssist Off
6              64    0000 0040 Hardpoints Deployed
7            128    0000 0080 In Wing
8            256    0000 0100 LightsOn
9            512    0000 0200 Cargo Scoop Deployed
10         1024   0000 0400 Silent Running,
11         2048   0000 0800 Scooping Fuel
12         4096   0000 1000 Srv Handbrake
13         8192   0000 2000 Srv Turret
14        16384  0000 4000 Srv UnderShip
15         32768 0000 8000 Srv DriveAssist
16         65536 0001 0000 Fsd MassLocked
17       131072 0002 0000 Fsd Charging
18       262144 0004 0000 Fsd Cooldown
19       524288 0008 0000 Low Fuel ( < 25% )
20     1048576 0010 0000 Over Heating ( > 100% )
21     2097152 0020 0000 Has Lat Long
22     4194304 0040 0000 IsInDanger
23     8388608 0080 0000 Being Interdicted
24   16777216 0100 0000 In MainShip
25   33554432 0200 0000 In Fighter
26   67108864 0400 0000 In SRV

{ "timestamp":"2017-12-07T10:31:37Z", "event":"Status", "Flags":16842765, "Pips":[2,8,2], "FireGroup":0,
"GuiFocus":5 }

In the first example above 16842765 (0x0101000d) has flags 24, 16, 3, 2, 0: In main ship, Mass
locked, Shields up, Landing gear down, Docked

So how would I go about setting a command that would give me a status update:

Me: "Give me a status rundown"
Ship: "The hardpoints are secured, landing gear is up, the lights are on, and the fuel scoop is deployed"

Any help is appreciated in understanding how to get VA to read those flags for what's set and what isn't.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: New Elite Dangerous status.json
« Reply #1 on: November 15, 2018, 07:51:00 PM »
If you have the integer value from json, you can use the attached profile with the single command in it that I have uploaded.  It contains an action to set the integer value to a variable and then calls an inline function.  The inline function parses the integer and puts all the indicated statuses into boolean variables.  The next bunch of actions just write out those variables to the log.

Edit - I guess what I was trying to say is that you can look inside the inline function to see how the integer is being handled ;)

« Last Edit: November 15, 2018, 09:09:18 PM by Gary »

jcdick1

  • Jr. Member
  • **
  • Posts: 59
Re: New Elite Dangerous status.json
« Reply #2 on: November 15, 2018, 09:19:37 PM »
So if I integrate this function, I'd just have VA read back through the log output for the actual status, yes?  Or let it maintain the variables in memory?

Edit:  First, have VA read the json file for the integer, then run the function you've kindly provided, then do whatever with the resulting variables?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: New Elite Dangerous status.json
« Reply #3 on: November 15, 2018, 09:37:19 PM »
Correct - you'd have to figure out how to get the json into VA and get the integer parsed out.  Probably with another inline function, or amend the provided one to do it.  That json string you provided... is that the final version?  I could probably just whip up the whole thing and all you would have to do is make the request to get the json (and get it into a variable) ;)

jcdick1

  • Jr. Member
  • **
  • Posts: 59
Re: New Elite Dangerous status.json
« Reply #4 on: November 15, 2018, 09:47:45 PM »
http://hosting.zaonce.net/community/journal/v18/Journal_Manual_v18.pdf

That's the link to the API documentation for Elite Dangerous, and the status.json file is section 11.  This doc was updated back in March, so I would guess since there hasn't been any updates to it since, this integer is the final layout.

Thanks!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: New Elite Dangerous status.json
« Reply #5 on: November 16, 2018, 08:01:12 AM »
I've attached the updated version to this message.  Note that you set the, '>EDStatus_Data' variable (profile-scoped) to the json value (setting the integer value is out).  Note that the example uses |{ and |} to indicate the curly brackets so that VA doesn't try to parse the sample text as a token.  Also note that the inline function is set to, 'wait until execution finishes' so that the log entries show up right ;)   Also also note that the function is only parsing out the Flags element and nothing else (you can augment the code to stuff the other elements into variables or whatever... like pips, fire group and gui focus)).  Also also also note that this is only tested briefly - good luck, commander!

My wife is recovering from surgery, so, I'm just hanging out tonight while she rests - VA is in a holding pattern, so, I get to work on fun stuff :)

J. Calvert (Joshua)

  • Newbie
  • *
  • Posts: 30
Re: New Elite Dangerous status.json
« Reply #6 on: November 17, 2018, 02:33:40 AM »
http://hosting.zaonce.net/community/journal/v18/Journal_Manual_v18.pdf

That's the link to the API documentation for Elite Dangerous, and the status.json file is section 11.  This doc was updated back in March, so I would guess since there hasn't been any updates to it since, this integer is the final layout.

Thanks!

There has been an update: http://hosting.zaonce.net/community/journal/v20/Journal_Manual_v20.pdf
(from https://forums.frontier.co.uk/showthread.php/452937-Journal-Docs-for-v3-3)

Alain Escher

  • Newbie
  • *
  • Posts: 1
Re: New Elite Dangerous status.json
« Reply #7 on: January 14, 2021, 06:21:44 AM »
If anyone is interested, I updated the Refresh ED Status-Profile to read directly from the json file in the user's Saved Games folder. I made some changes, e.g. colour of the output depending on true or false.