I have just uploaded a Python3 library implementing the Fallout 4 Companion App protocol on github: PyPipboy. It's under GPL 3, so feel free to use it.
Hi, I'm interested in adapting some of this code for use in a project I'm working on. I want to make a mirror server so that multiple people can connect to one game, but with view-mode only. Might be a cool gimmick for streamers and such.
You haven't given any licence info, can I get permission to use this code for that project? Ideally I'd like to put my work up on github for others to use.
A JSON-based RPC protocol is used for that. It's rather straightforward, but I didn't had the time to get the specific details of each available function yet. I am currently working on an "Unofficial Pipboy Application", and would like to finish the map viewer widget before I dig into the details of RPC.
The Companion App seems to use the Ids only to refer to values in objects and arrays, and to build a tree with the data. It then navigates to a specific value by starting at the root object and traversing down the tree. E.g. all map related data is found in the object referred to by the "Map" (key, value) pair in the root object. The map object then .e.g has a "Local" (key, value) pair referring to an object that holds all information relating to the local map. It works similar to XPATH, or JSON Path.
However, I can't seem to get an 'initial' payload working that contains all initial data when you first connect. They don't always arrive with packet type 3 (data_update) but instead come with random numbers, e.g. 70, 99, 103, 130, etc..
It might be possible that I messed something up in the parsing though... Not sure :/
I would stick with Python. Python is love. (and kivy is pretty cool for building cross-platform apps) And I guess Python is easier to learn, thus making your lib more convenient for a larger spread of modders.
11 comments
It's under GPL 3, so feel free to use it.
I want to make a mirror server so that multiple people can connect to one game, but with view-mode only. Might be a cool gimmick for streamers and such.
You haven't given any licence info, can I get permission to use this code for that project? Ideally I'd like to put my work up on github for others to use.
Such as change radio station, fast travel, equip/unequip/drop inventory?
I'm seriously thinking about making a second screen (dual monitors on PC) with this and some NodeJS "magic". <3 you for figuring this stuff out!
Edit:
So I managed to get this working in NodeJS. However, the Node ID's are nowhere near consistent
I got this far:
// Misc
4 : 'NewItemPickup (does not always work?)',
5 : 'NewObjective',
22: '(?) NewGame',
// Game pause states
14: 'isInDialogue',
15: 'isPaused (Game)',
18: 'isPaused (Transition)',
23: 'isPaused (ViewMode)',
// Player position and rotation
30136: 'PlayerX (CELL)',
30137: 'PlayerY (CELL)',
30140: 'PlayerX (WORLD)',
30141: 'PlayerY (WORLD)',
33136: 'PlayerX (LOCAL)',
33137: 'PlayerY (LOCAL)',
30138: 'PlayerRotation',
30142: 'PlayerRotation',
// Quest tracking
33326: 'ActiveQuest1',
33327: 'ActiveQuest2',
// Map
33328: 'NearbyLocations'
Until I started a new game session, all numbers changed :/
The only actual consistent ones are the pause states and misc elements.
I think there must be some way to get an "Identity Map" for these ID's right?
However, I can't seem to get an 'initial' payload working that contains all initial data when you first connect. They don't always arrive with packet type 3 (data_update) but instead come with random numbers, e.g. 70, 99, 103, 130, etc..
It might be possible that I messed something up in the parsing though... Not sure :/
Nevermind the above. As it turned out, I messed up the decoding of the node ids.. silly mistake.
The final result works and updates nicely in realtime
https://gist.github.com/haroldiedema/1881835a4445140f4d76
And I guess Python is easier to learn, thus making your lib more convenient for a larger spread of modders.