Jump to content

LSPDFR 0.4 API Update


LMS

Recommended Posts

  • Management Team
On 3/17/2019 at 10:22 PM, HazyTube said:

I don't know if this is a bug, but if you set the player's availability for callouts with


Functions.SetPlayerAvailableForCalls(true/false)

 

 

It should work for the actual status but yes, the menu not being updated properly is a bug.

 

On 3/18/2019 at 2:20 PM, liverlande said:

Glad to see there are more functions available for arrests, especially checking if a ped is being cuffed. Are there plans to add an API function to set a ped as handcuffed (with the object and animation) in a future update?

 

Edit: It seems that Functions.IsPedBeingCuffed* doesn't apply to takedown arrests and only triggers when cuffing a stopped ped. Can this behavior be modified? This was not the intent of my request as it only makes what I'm doing apply to 1/2 of possible scenarios.

 

Thanks, I will take a look. As for the object and animation, I cannot give you a definitive answer, we would have to try it internally first and see how well the decoupling works.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

I'm getting this exception logged constantly (as fast as the log window can scroll by) in pursuits when the pursuit AI has been turned off using Functions.SetPursuitDisableAI: 

 

[3/21/2019 11:11:10 PM.924] LSPD First Response: [TRACE] [CONSOLE] System.NullReferenceException: Object reference not set to an instance of an object.
[3/21/2019 11:11:10 PM.925] at ???????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Engine\Scripting\Tasks\TaskCopChasePedAdv.cs:line 488
[3/21/2019 11:11:10 PM.926] at ?????????????????????????????????????????.?????????????????????????????????????????(????????????????????????????????????????? ) in E:\GTA V\LSPD First Response\LSPD First Response\Mod\BackupManager.cs:line 703

Also noticed that when pursuit AI is turned off, suspects do not get blipped at all. I expect this is because the new more dynamic pursuits change the suspect blips depending on whether anyone has eyes on them. It's not hard to add a blip manually, but wasn't sure if that was the intended effect. 

 

Also, could you please add an API method to get whether pursuit "tactics" are turned on, and whether lethal force is authorized?

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

Not sure if it exists and I just missed it (please tell me if I did!), but a way to get the ped that is currently being arrested by the player (or another cop) would be nice. Right now I can only think of 2 ways of achieving this. (Not sure if they actually work as I haven't tried them, this is just theory.)

1) Getting all nearby peds and checking if IsPedBeingCuffed(ByPlayer) returns true to anyone, then working with that ped that this returns true to.

2) Getting all nearby peds and checking if GetPedArrestingOfficer returns the cop/player for anyone, then working with that ped.

Logging in...

Launching game...

Error launching game: Cannot load while loading. Please log out and retry.

Logging out...

Error logging out. You are not logged in. You need to be logged in to log out. Please log in to log out.

Link to comment
Share on other sites

4 hours ago, TheUniT said:

Not sure if it exists and I just missed it (please tell me if I did!), but a way to get the ped that is currently being arrested by the player (or another cop) would be nice. Right now I can only think of 2 ways of achieving this. (Not sure if they actually work as I haven't tried them, this is just theory.)

1) Getting all nearby peds and checking if IsPedBeingCuffed(ByPlayer) returns true to anyone, then working with that ped that this returns true to.

2) Getting all nearby peds and checking if GetPedArrestingOfficer returns the cop/player for anyone, then working with that ped.

Being arrested and being cuffed are two different things in LSPDFR. BeingArrested is the stage where:

 

1) The takedown is initiated

2) The player starts holding down the E key

 

In the first case, the player could literally just stand there and aim their pistol at a grounded suspect - they'll still be counted as being arrested. Not sure if this is something you want. In this event, you could potentially be "arresting" multiple peds. The same is technically true for AI, but I don't think they're allowed to arrest multiple at once.

 

Assuming that is something you intend, there are no practical reasons the methods you gave wouldn't work. You could optimize further by maintaining a cache of Peds so you're not calling World.GetAllPeds every time. Mockup code with no such caching benefits:

 

https://gist.github.com/RiverGrande/6361b57bb5231762c75d127df5a4cb02

 

Spoiler

 

1 hour ago, dustycop2017 said:

I am done with LSPDFR until all bugs are worked out. Mainly the LSPDFR loading shutdown crash bugs.

  

No one is forcing you to play or develop a modification developed for free by a group of individuals who reverse engineer a game with no real support from Rockstar Games. If you have issues with LSPDFR (and specifically the API, as this is the topic for the API), you should provide information so a patch can be introduced in a future update.

Edited by liverlande
Link to comment
Share on other sites

32 minutes ago, liverlande said:

Being arrested and being cuffed are two different things in LSPDFR. BeingArrested is the stage where:

 

1) The takedown is initiated

2) The player starts holding down the E key

 

In the first case, the player could literally just stand there and aim their pistol at a grounded suspect - they'll still be counted as being arrested. Not sure if this is something you want. In this event, you could potentially be "arresting" multiple peds. The same is technically true for AI, but I don't think they're allowed to arrest multiple at once.

 

Assuming that is something you intend, there are no practical reasons the methods you gave wouldn't work. You could optimize further by maintaining a cache of Peds so you're not calling World.GetAllPeds every time. Mockup code with no such caching benefits:

 

https://gist.github.com/RiverGrande/6361b57bb5231762c75d127df5a4cb02

 

  Hide contents

 

No one is forcing you to play or develop a modification developed for free by a group of individuals who reverse engineer a game with no real support from Rockstar Games. If you have issues with LSPDFR (and specifically the API, as this is the topic for the API), you should provide information so a patch can be introduced in a future update.

I know but I really enjoy the mod and the bugs I mentioned earlier are preventing me from fully enjoying the update atm.

 

Dustin M. Hale

Link to comment
Share on other sites

12 hours ago, TheUniT said:

Not sure if it exists and I just missed it (please tell me if I did!), but a way to get the ped that is currently being arrested by the player (or another cop) would be nice. Right now I can only think of 2 ways of achieving this. (Not sure if they actually work as I haven't tried them, this is just theory.)

1) Getting all nearby peds and checking if IsPedBeingCuffed(ByPlayer) returns true to anyone, then working with that ped that this returns true to.

2) Getting all nearby peds and checking if GetPedArrestingOfficer returns the cop/player for anyone, then working with that ped.

 

Subscribe to LSPD_First_Response.Mod.API.Events.OnPedArrested

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

3 hours ago, liverlande said:

Based on the name, I assume this is called after the ped is arrested. Someone would need to check the behavior here and confirm.

 

Ah, I see what you mean. Yes, perhaps they could add an OnPedArrestStarted or something like that. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

@LMS Any insight on why i'm getting this exception when in a pursuit? Has happened about 3 times now?  I understand the Rage.Vehicle is invalid but what vehicle? I see my suspect now enters/ steals cars when in a pursuit instead of just fleeing on foot. Could it be something to do with that?

Spoiler

==============================
[3/25/2019 11:03:46 AM.548] LSPD First Response: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[3/25/2019 11:03:46 AM.549] LSPD First Response: ------------------------------
[3/25/2019 11:03:46 AM.550] LSPD First Response: Origin: Game fiber "<UNNAMED THREAD>".
[3/25/2019 11:03:46 AM.551] LSPD First Response: ------------------------------
[3/25/2019 11:03:46 AM.552] LSPD First Response: Exception type: Rage.Exceptions.InvalidHandleableException
[3/25/2019 11:03:46 AM.552] LSPD First Response: Exception message: Operation is not valid because the specified  Rage.Vehicle is invalid.
[3/25/2019 11:03:46 AM.553] LSPD First Response: ------------------------------
[3/25/2019 11:03:46 AM.554] LSPD First Response: Inner exceptions:
[3/25/2019 11:03:46 AM.556] LSPD First Response: ------------------------------
[3/25/2019 11:03:46 AM.557] LSPD First Response: Stack trace:
[3/25/2019 11:03:46 AM.558] LSPD First Response: at Rage.Entity.get_Model()
[3/25/2019 11:03:46 AM.558] at ‌‏‮‫‍‬‌‌‏‮‍‎‬‏‍‮‎‍‮‍‭‎‍‍‮.‏‭‏‎‎‏‎‍‎‭‌‪‫‏‬‬‫‌‬‮‪‭‎‮[](String , Func`1 ) in E:\GTA V\LSPD First Response\LSPD First Response\Engine\Scripting\AI\Blackboard.cs:line 69
[3/25/2019 11:03:46 AM.561] at ‮‬‌‮‫‮‮‬‍‪‎‮‬‌‎‫‏‬‭‌‌‮‬‫‮‭‍‎‪‮.‮‭‫‌‏‬‫‮‬‬‍‪‎‫‮‭‍‌‭‮‎‌‏‪‮(Entity ) in E:\GTA V\LSPD First Response\LSPD First Response\Engine\Scripting\CachedCalls.cs:line 29
[3/25/2019 11:03:46 AM.564] at ‌‎‎‍‪‎‫‌‬‎‎‎‪‭‮‎‎‮.‮‌‪‍‮‪‪‭‌‭‍‭‌‎‫‪‮‏‫‍‏‌‎‮(Ped , Ped[] ) in E:\GTA V\LSPD First Response\LSPD First Response\Mod\EvacuateStreetManager.cs:line 39
[3/25/2019 11:03:46 AM.568] at ‏‪‭‮‎‮‎‍‬‬‮‍‪‭‏‪‬‍‎‮‭‭‌‏‫‮.‎‭‍‏‍‎‬‮‍‍‍‬‬‍‏‪‏‭‎‎‪‫‎‮() in E:\GTA V\LSPD First Response\LSPD First Response\Engine\Scripting\Chase.cs:line 229
[3/25/2019 11:03:46 AM.568] at ‫‪‎‫‫‍‎‌‫‫‎‫‏‪‎‎‎‏‮‎‪‮.‎‭‍‏‍‎‬‮‍‍‍‬‬‍‏‪‏‭‎‎‪‫‎‮() in E:\GTA V\LSPD First Response\LSPD First Response\Engine\Main.cs:line 54
[3/25/2019 11:03:46 AM.569] at ‮‏‭‎‮‬‌‬‫‬‮‌‏‎‮‭‬‏‭‫‮.‍‮‫‭‬‮‮‌‌‮‎‭‍‪‏‫‪‎‫‮() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\LSPDFR.cs:line 741
[3/25/2019 11:03:46 AM.570] at Rage.GameFiber.Main()
[3/25/2019 11:03:46 AM.572] LSPD First Response: ==============================

 

Link to comment
Share on other sites

  • 1 month later...
  • Management Team
On 3/25/2019 at 4:24 AM, 420Chuur said:

@LMS Any insight on why i'm getting this exception when in a pursuit? Has happened about 3 times now?  I understand the Rage.Vehicle is invalid but what vehicle? I see my suspect now enters/ steals cars when in a pursuit instead of just fleeing on foot. Could it be something to do with that?

 

Sorry for the late reply, it was a bug in our vehicle cache. It will be fixed in the next update.

 

7 hours ago, Bleddyn Welch said:

Have you guys considered a maximum area for a Callout to spawn. For example you have the minimum area and if your outside the area the Callout spawns, but could you do the opposite it would be quite useful to people with a static spawn location 

 

Sure, I can add that!

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

Could we possibly get an OnPursuitSuspectEscaped event? Ideally, it'd pass the suspect ped and any vehicle they were in.

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

11 hours ago, Darkmyre said:

Could we possibly get an OnPursuitSuspectEscaped event? Ideally, it'd pass the suspect ped and any vehicle they were in.

 

I wonder if when a ped escapes if the ped and vehicle are promptly dismissed, or if they're kept around? 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

  • Management Team
On 5/1/2019 at 7:09 AM, PNWParksFan said:

 

I wonder if when a ped escapes if the ped and vehicle are promptly dismissed, or if they're kept around? 

 

They are actually deleted the very second the suspect is marked as escaped. There is a system to remember the suspect and spawn them in later, but it is currently not enabled.

 

@Darkmyre Sure!

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

LSPDFR 0.4 seems to have some pretty good logic for pullovers and finding the "side of the road". I think this would be useful for a variety of things in callouts and ambient scenarios. Could this be exposed through the API? I'm thinking a few API functions would be useful, but would probably need to be tweaked depending on how the internal logic works. 

  • bool StopVehicleOnSideOfRoad(Vehicle) - I specifically didn't put "pullover" in the name, to avoid any confusion with all the other pullover-related functions that essentially mean traffic stop. This would make a moving vehicle w/ a driver find a place to stop on the side of the road as soon as reasonably possible. It would return true once they successfully stop, or false if for some reason it didn't work (i.e. got interrupted, ped died or despawned, whatever). Would have to be called inside a sleepable gamefiber and might take several/many ticks before returning. 
  • Vector3 GetStopPositionOnSideOfRoad(Vector3 position, float heading) - This would take a given position and heading, and find a suitable pullover location as if a vehicle were driving at that position with that heading. The purpose for this would be to find a place to put a vehicle that hadn't actually been spawned yet, e.g. for spawning ambient events, or making a vehicle drive to some location and then stop nearby, or things like that. I'm not sure how the logic to find a pullover location works, but this might take a few ticks to run as well. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

On 5/4/2019 at 4:04 AM, LMS said:

 

They are actually deleted the very second the suspect is marked as escaped. There is a system to remember the suspect and spawn them in later, but it is currently not enabled.

 

@Darkmyre Sure!

 

So in that case, passing the Vehicle and the Ped(s) in the event wouldn't make sense, as they would all be invalid entities. Would it be possible to pass the Persona of the escaped ped, or is a Persona for a now-invalid Ped also invalid itself?

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

On 5/6/2019 at 4:38 AM, PNWParksFan said:

 

So in that case, passing the Vehicle and the Ped(s) in the event wouldn't make sense, as they would all be invalid entities. Would it be possible to pass the Persona of the escaped ped, or is a Persona for a now-invalid Ped also invalid itself?

 

Ideally, it'd be great to also get the ped's model and variations, and similar details for the vehicle. I'm sure there'd be others (custom audio triggers for example), but my initial idea was some sort of BOLO system where the suspect could be spawned in later.... although if there's already a similar native LSPDFR system that's just turned off, it'd probably be far better to just see that turned on.

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

23 hours ago, Darkmyre said:

 

Ideally, it'd be great to also get the ped's model and variations, and similar details for the vehicle. I'm sure there'd be others (custom audio triggers for example), but my initial idea was some sort of BOLO system where the suspect could be spawned in later.... although if there's already a similar native LSPDFR system that's just turned off, it'd probably be far better to just see that turned on.

hey @LMS what about LOTKF Look Out To Be Kept For

 

Dingo RP

 Our website : 
Our Discord

 

 

Link to comment
Share on other sites

  • Management Team
On 5/7/2019 at 8:53 AM, Darkmyre said:

Ideally, it'd be great to also get the ped's model and variations, and similar details for the vehicle. I'm sure there'd be others (custom audio triggers for example), but my initial idea was some sort of BOLO system where the suspect could be spawned in later.... although if there's already a similar native LSPDFR system that's just turned off, it'd probably be far better to just see that turned on.

 

The way it works is that there is a very small chance the suspect will be involved in a scenario after having escaped. In that case they are not deleted. Hence the prototype for the functions looks like this now (where suspect and vehicleSkin can be null). What do you think?

 

public delegate void PursuitSuspectEscapedEventHandler(LHandle pursuitHandle, Ped suspect, Persona suspectPersona, VehicleSkin vehicleSkin, bool busyInScenario);

 

As for our native system and to answer @OblongGaming, it is certainly something we would like to introduce soon, but have disabled it for the time being as we are not completely happy with it yet.

 

 

On 5/5/2019 at 8:18 PM, PNWParksFan said:
  • bool StopVehicleOnSideOfRoad(Vehicle)
  • Vector3 GetStopPositionOnSideOfRoad(Vector3 position, float heading 

 

The first one should be relatively simple to implement. However, I don't think we could add the second one, as the parking system needs a vehicle to operate on.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

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...