UNDER THE HOOD // TWO THINGS IT WAS BUILT TO TEST
HOW THE GOONS FIND YOU
Part of the reason this gig exists was to check whether two things were even possible from a mod: forcing the NCPD (or Militech, out here) to always know where you are, and controlling the wanted level. Both are. Here is how, in case you want them in your own gig.
1. Making the goons find you. NPCs placed by a community spawn with no particular attitude towards V. Making them hostile and aware of your location is four calls per NPC, copied from what the base game does to each MaxTac unit after they land:
npc.SetAttitudeTowards(player, EAIAttitude.AIA_Hostile);
npc.GetSensesComponent().Toggle(true);
TargetTrackingExtension.InjectThreat(npc, player, 1.0, -1.0);
NPCPuppet.ChangeHighLevelState(npc, gamedataNPCHighLevelState.Combat);
The first two make you an enemy they can see. The third shares your location. The fourth makes them react at once instead of waiting for a detection.
2. Controlling the wanted level. Raising the stars is a request copied from vanilla:
let evt: ref<SetWantedLevel> = new SetWantedLevel();
evt.m_wantedLevel = EPreventionHeatStage.Heat_3;
evt.m_forcePlayerPositionAsLastCrimePoint = true;
preventionSystem.QueueRequest(evt);
// Heat_0 turns the wanted level off again, at a location or an objective of your choosing
The response doesn't know where you are until one of them spots V. To have them find a player who left the road, report the position every few seconds:
PreventionSystem.CombatStartedRequestToPreventionSystem(game, player);
That sets the player's position as the last known one and hands it over. Out in the Badlands the response is Militech rather than the NCPD, which is who you just stole from, so the hunt walks in on its own.
BUILD YOUR OWN GIG[INJECT]