diff --git a/docs/traffic-system-debrief.md b/docs/traffic-system-debrief.md index 06ef3b8..7dda3a9 100644 --- a/docs/traffic-system-debrief.md +++ b/docs/traffic-system-debrief.md @@ -138,6 +138,31 @@ one of them can resolve the mappin system, it also logs concrete vtable RVAs for slots `0x1f0`, `0x220`, `0x228`, `0x250`, `0x280`, `0x2e0`, `0x2f0`, `0x368`, and `0x3a8`, then attaches temporary hooks to the route-adjacent slots. +Live result: this lead appears to be the hover/selection layer, not the route +commit layer. In a controlled test window, hovering a world-map icon and then +moving back to empty map space fired `SetSelectedMappinWrapper` and +`SetSelectedMappinCore`. Pressing the route/track action on that icon did not +fire `FrameMappinPath`, `TrackCustomPositionMappin`, `TrackMappin`, the tracked +mappin slots, or any of the custom-position slots. + +That pushes the search one layer higher, into the world-map controller script +methods around tracking an objective or setting a waypoint. Static REDscript +strings name these relevant methods: + +```text +WorldMapMenuGameController.TryTrackQuestOrSetWaypoint +WorldMapMenuGameController.UpdateTrackedQuest +WorldMapMenuGameController.UpdateTravelDestination +WorldMapMenuGameController.TrackQuestMappin +WorldMapMenuGameController.OnPressInput +WorldMapMenuGameController.OnHoldInput +``` + +The current read-only REDscript probe wraps the no-argument route/tracking +methods plus `TrackQuestMappin`. If those fire on route plotting, the next step +is to trace their native calls or wrap the specific player-quest/custom-waypoint +operation they delegate to. + ## The High-Level Shape Cyberpunk appears to split "navigation" into at least two major domains: diff --git a/redscript/EdgeWeightGPS/EdgeWeightGPS.reds b/redscript/EdgeWeightGPS/EdgeWeightGPS.reds new file mode 100644 index 0000000..75256b4 --- /dev/null +++ b/redscript/EdgeWeightGPS/EdgeWeightGPS.reds @@ -0,0 +1,33 @@ +module EdgeWeightGPS + +private func EdgeWeightGPSLog(message: String) -> Void { + Log("[EdgeWeightGPS] " + message); +} + +@wrapMethod(WorldMapMenuGameController) +private final func TryTrackQuestOrSetWaypoint() -> Void { + EdgeWeightGPSLog("WorldMapMenuGameController.TryTrackQuestOrSetWaypoint enter"); + wrappedMethod(); + EdgeWeightGPSLog("WorldMapMenuGameController.TryTrackQuestOrSetWaypoint exit"); +} + +@wrapMethod(WorldMapMenuGameController) +private final func UpdateTrackedQuest() -> Void { + EdgeWeightGPSLog("WorldMapMenuGameController.UpdateTrackedQuest enter"); + wrappedMethod(); + EdgeWeightGPSLog("WorldMapMenuGameController.UpdateTrackedQuest exit"); +} + +@wrapMethod(WorldMapMenuGameController) +private final func UpdateTravelDestination() -> Void { + EdgeWeightGPSLog("WorldMapMenuGameController.UpdateTravelDestination enter"); + wrappedMethod(); + EdgeWeightGPSLog("WorldMapMenuGameController.UpdateTravelDestination exit"); +} + +@wrapMethod(WorldMapMenuGameController) +private final func TrackQuestMappin(mappinController: ref) -> Void { + EdgeWeightGPSLog("WorldMapMenuGameController.TrackQuestMappin enter defined=" + ToString(IsDefined(mappinController))); + wrappedMethod(mappinController); + EdgeWeightGPSLog("WorldMapMenuGameController.TrackQuestMappin exit"); +} diff --git a/tools/install_redscript_probe.sh b/tools/install_redscript_probe.sh new file mode 100755 index 0000000..6122301 --- /dev/null +++ b/tools/install_redscript_probe.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +game_dir="${CYBERPUNK2077_GAME_DIR:-/var/home/salt/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Cyberpunk 2077}" +script_out="$game_dir/r6/scripts/EdgeWeightGPS" + +mkdir -p "$script_out" +install -m 0644 "$repo_root/redscript/EdgeWeightGPS/EdgeWeightGPS.reds" "$script_out/EdgeWeightGPS.reds" + +printf 'Installed %s\n' "$script_out/EdgeWeightGPS.reds"