Jump to content

Override Persuit Flee


dylanlive

Recommended Posts

Hey All,

 

Whenever I call AddPedToPersuit(), the suspect seems to flee, despite any Task I call after that (including Suspect.Tasks.StandStill(30000)).

 

I'm trying to tell the suspect to continue their FightAgainstClosestHatedTarget, but it seems to get overridden. I want to add them to the persuit so that I can call Helicopter, FBI, etc via the Persuit Backup Menu.

 

Any thoughts on how I can override the flee behavior of suspects when they've been added to a persuit?

 

Code snippet:

public override void Process()
        {
            base.Process();


            if (!PursuitCreated && Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 30f)
            {
                Game.LogTrivial("Getting them to fight");
                Suspect.Tasks.FightAgainstClosestHatedTarget(50f);

                foreach (Ped bystandard in bystandards)
                {
                    bystandard.Tasks.ReactAndFlee(Suspect);
                }

                Game.LogTrivial("Creating persuit");
                Pursuit = Functions.CreatePursuit();
                Functions.AddPedToPursuit(Pursuit, Suspect);
                Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                PursuitCreated = true;

                Game.LogTrivial("Attempt to fight again... debugging");
                Suspect.Tasks.FightAgainstClosestHatedTarget(50f);
            }
}

 

Edited by dylanlive
add code
Link to comment
Share on other sites

LSPDFR aggressively resets and re-applies its own tasks to peds every 2000ms during a pursuit. You can try also aggressively resetting and re-applying your tasks, but basically it'll probably still be a mess unless this app ever makes it back from the depths of abandonware.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

Link to comment
Share on other sites

Ah, I guess I can understand. I'd imagine this is for the logic of running, surrendering, etc.

 

I'm trying to recall how the Gang Fight callouts currently work. Are the suspects marked with a blip, but not technically marked for pursuit? That said, you can't call pursuit backup?

 

Ultimately I'm just trying to allow the user to access the helicopters - perhaps I'll play with writing this logic in RPH independent of LSPDFR's pursuit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...