cp2077_extractor.radio_dj
Helpers for handling radio DJ logic and audio files.
Classes:
|
Data for a radio DJ's sound files. |
|
Metadata for an event triggered by a node in a scene. |
Functions:
|
Find entry points into the radio logic graph. |
|
Returns an iterator over possible paths through the various link segments. |
|
Load a JSON serialised mapping of node numbers to |
|
Partial parsing of scene graph. |
|
Parse subtitle data. |
|
Plot the graph, in a hierarchy from start nodes down to finish nodes. |
|
Remove non-audio nodes from a networkx graph, and reconnect edges. |
-
namedtuple
DJData(audio_filename_prefix, scene_file, station_name, general_audio=False)[source] Bases:
NamedTupleData for a radio DJ’s sound files.
- Fields
audio_filename_prefix (
str) – The filenames in the game files (inbase/localization/en-us/voorbase\localization\common\vo) for this advert all start with this string.scene_file (
str) – The name of the scene file inbase/media/animated_billboards/scenesin the game files (with the suffix.scene.)station_name (
str) – The name of the radio station etc.general_audio (
bool) – Whether the audio is common too all game languages.Falsefor localised audio,Truefor files inaudio_1_general.archive.
-
__repr__() Return a nicely formatted representation string
-
namedtuple
EventData(event_id, screenplay_line_id, audio_file_suffix, subtitle_ruid)[source] Bases:
NamedTupleMetadata for an event triggered by a node in a scene.
- Fields
event_id (
str) – Alias for field number 0screenplay_line_id (
int) – Identifier of thescnscreenplayDialogLinefor this event (which indicates the file to play and the subtitle line).audio_file_suffix (
str) – The suffix of the audio file, to give the file to play. e.g. f_1BAAA2A79044D000.subtitle_ruid (
str) – Identifier of the subtitles for the event.
-
__repr__() Return a nicely formatted representation string
-
find_graph_entry_points(graph)[source] Find entry points into the radio logic graph.
That is, any lone nodes, any start nodes, and any end nodes (skipping chatter).
-
get_link_paths(graph)[source] Returns an iterator over possible paths through the various link segments.
-
load_events_dict(events_dict)[source] Load a JSON serialised mapping of node numbers to
EventData.Converts string keys back into integers and value tuples bacm into
EventData.
-
parse_radio_scene_graph(data)[source] Partial parsing of scene graph.
Only finds dialogue events and the paths between them; no conditional logic.
-
plot_graph(graph)[source] Plot the graph, in a hierarchy from start nodes down to finish nodes.
Requires
matplotlibandpygraphviz.- Parameters
graph (
Graph)- Return type
Figure
-
remove_intermediate_nodes(graph, audio_nodes)[source] Remove non-audio nodes from a networkx graph, and reconnect edges.
- Parameters
graph (
Graph)audio_nodes (
Collection[int])