Jump to content

LSPDFR 0.4 API Update


LMS

Recommended Posts

  • Management Team
6 hours ago, PNWParksFan said:

 

Attached log. Loaded, forced on duty, conducted one pursuit (and ultimately terminated because it was taking too long for a simple test lol). Forced off duty, then unloaded. No crashes during unloading. Tried to load again, failed and threw exception. Interestingly, it says "Graceful termination" but never gets to "LSPDFR has shut down" in the first run, but it does say "LSPDFR has shut down" after the crash in the second run. I tested this with all ASI mods removed, no LSPDFR plugins loaded, no other RPH/SHV/SHVDN plugins loaded, and after a fresh reboot.

 

Thanks, it does look like it has trouble shutting down properly, hence leaving the hooks in place. It could be a timeout from the hooking engine or a (silent) script crash, I am not sure yet. I will keep the plugin alive a little bit longer in the next update to ensure everything is freed.

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 not sure what behavior Functions.SetPedIsArrested grants in relation to the new grabbing system implemented in LSPDFR 0.4. Can you document what this function is doing under the hood exactly?

 

A function to (un)apply the handcuff objects (a toggle for the sound would be great here to) when setting a ped as arrested would help out a lot, especially if it works with the systems explained above. This would allow for extremely smooth integration with LSPDFR 0.4 when dealing with arrests.

 

A function such as Functions.IsPedGettingHandcuffed would be welcome.

Edited by liverlande
Link to comment
Share on other sites

13 hours ago, LMS said:

 

Thanks, it does look like it has trouble shutting down properly, hence leaving the hooks in place. It could be a timeout from the hooking engine or a (silent) script crash, I am not sure yet. I will keep the plugin alive a little bit longer in the next update to ensure everything is freed.

 

OK. Anything I can do or should try in the meantime?

[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

There are a couple more things I can think of on the theme of "rolling up on a scene with other cops already there." Basically, you'd specify a position, a backup type and flags, a number of vehicles (default is 1), and a number of peds (again, default is 1). LSPDFR would then choose a loadout based on the position, backup type, and flags, would spawn the given number of vehicles and peds based on that loadout, and would pass handles to all spawned vehicles and peds. That way, if you wanted to set up a scene that the player arrives at, you could use appropriate units for that area based on the config files.

Link to comment
Share on other sites

10 hours ago, cp702 said:

There are a couple more things I can think of on the theme of "rolling up on a scene with other cops already there." Basically, you'd specify a position, a backup type and flags, a number of vehicles (default is 1), and a number of peds (again, default is 1). LSPDFR would then choose a loadout based on the position, backup type, and flags, would spawn the given number of vehicles and peds based on that loadout, and would pass handles to all spawned vehicles and peds. That way, if you wanted to set up a scene that the player arrives at, you could use appropriate units for that area based on the config files.

 

Perhaps an easier way to implement this would be an API method to spawn a backup unit at a specific position, and it would do that but without any task assigned to the peds. If you want multiple vehicles, you could just call it multiple times with different positions. Would be helpful for a wide variety of mods. 

 

Another event suggestion would be OnPedIdentified(Ped, LHandle), which would fire any time a ped gets asked for their ID, whether as a driver or passenger in a traffic stop, or while on foot. LHandle to the traffic stop, which is null if the ped was stopped on the street. I don't recall off hand whether LHandle is nullable, so if that doesn't work, could be separate events for OnPedIdentifiedTrafficStop and OnPedIdentifiedOnFoot. 

[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 3/2/2019 at 6:36 AM, PNWParksFan said:

 

OK. Anything I can do or should try in the meantime?

 

I've tested it several times myself on the release build and checked with a couple of others, you should be able to reload without any issues (except for the native address at some point, which can be disabled via ini). You're saying the "shutdown crash/timeout" happens even on a clean installation without any plugins though, right?

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

Hey guys, great work on 0.4 🙂  I was wondering if the ped picture database and function for using those pictures in notification displays is going to be made available for developers? Or is it already? Would be a nice addition to Interaction+ as well as other plugins to add immersion.

 

Thanks

-Phaxol

Link to comment
Share on other sites

10 hours ago, LMS said:

 

I've tested it several times myself on the release build and checked with a couple of others, you should be able to reload without any issues (except for the native address at some point, which can be disabled via ini). You're saying the "shutdown crash/timeout" happens even on a clean installation without any plugins though, right?

 

Yes, I tried it with all ASI mods removed, no LSPDFR plugins, and no other RPH plugins. I also don't have any unusual antivirus, just Windows Defender, and wasn't running anything weird at the time like the VS debugger or anything like that. RPH is in Developer mode, but I imagine it is for you too. 

 

8 hours ago, Phaxol said:

Hey guys, great work on 0.4 🙂  I was wondering if the ped picture database and function for using those pictures in notification displays is going to be made available for developers? Or is it already? Would be a nice addition to Interaction+ as well as other plugins to add immersion.

 

Thanks

 

That uses the natives for Ped headshots. Check out this wrapper by @alexguirrehttps://gist.github.com/alexguirre/760bff5e8f922901ec337fe9ea0c58cb

[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
12 hours ago, PNWParksFan said:

Yes, I tried it with all ASI mods removed, no LSPDFR plugins, and no other RPH plugins. I also don't have any unusual antivirus, just Windows Defender, and wasn't running anything weird at the time like the VS debugger or anything like that. RPH is in Developer mode, but I imagine it is for you too. 

 

Yes, mine is too. I think it is something else: Do you by any chance use the option "Networking.DisableServerCommunication"? From what I can see, there is a bug in the shutdown code for the server communication that could cause it to fail when a connection had never been established. Please see if removing this option (if you are using it) fixes your problem. I will fix the issue in the next patch.

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

53 minutes ago, LMS said:

 

Yes, mine is too. I think it is something else: Do you by any chance use the option "Networking.DisableServerCommunication"? From what I can see, there is a bug in the shutdown code for the server communication that could cause it to fail when a connection had never been established. Please see if removing this option (if you are using it) fixes your problem. I will fix the issue in the next patch.

 

I do have that option enabled. Hadn't occurred to me to reset the lspdfr.ini. I will try that when I get a chance and report back. 

[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

15 hours ago, LMS said:

 

Yes, mine is too. I think it is something else: Do you by any chance use the option "Networking.DisableServerCommunication"? From what I can see, there is a bug in the shutdown code for the server communication that could cause it to fail when a connection had never been established. Please see if removing this option (if you are using it) fixes your problem. I will fix the issue in the next patch.

 

I set that back to false and now I can load/unload/reload the mod. Interestingly, there is an exception that gets thrown during unloading when I have that option set to false which doesn't get thrown when it's set to true. 

 

[3/5/2019 11:20:18 PM.523] LSPD First Response: [TRACE] Exception when trying to save pending messages System.ArgumentException: Path must be longer than zero characters
[3/5/2019 11:20:18 PM.525] at ?????????????????????????????????????????.?????????????????????????????????????????(String ) in E:\GTA V\LSPD First Response\LSPD First Response\Engine\IO\FileManager.cs:line 333
[3/5/2019 11:20:18 PM.526] at ?????????????????????????????????????????.?????????????????????????????????????????(String ) in E:\GTA V\LSPD First Response\LSPD First Response\Engine\IO\FileManager.cs:line 355
[3/5/2019 11:20:18 PM.526] at ?????????????????????????????????????????.?????????????????????????????????????????(????????????????????????????????????????? , String , Byte[] , Boolean ) in E:\GTA V\LSPD First Response\LSPD First Response\Engine\IO\FileManagerHelper.cs:line 97
[3/5/2019 11:20:18 PM.527] at ?????????????????????????????????????????.?????????????????????????????????????????[](????????????????????????????????????????? , String , Byte[] , Boolean ) in E:\GTA V\LSPD First Response\LSPD First Response\Engine\IO\FileManagerHelper.cs:line 93
[3/5/2019 11:20:18 PM.527] at ?????????????????????????????????????????.GetPendingMessagesForCurrentUserId(String path) in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Connectivity\SyncManager.cs:line 125
[3/5/2019 11:20:18 PM.528] at ?????????????????????????????????????????.?????????????????????????????????????????(String ) in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Connectivity\SyncManager.cs:line 195
[3/5/2019 11:20:18 PM.528] at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Connectivity\SyncManager.cs:line 176
[3/5/2019 11:20:18 PM.632] LSPD First Response: [INFO] LSPDFR has shut down

 

[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
7 hours ago, PNWParksFan said:

 

I set that back to false and now I can load/unload/reload the mod. Interestingly, there is an exception that gets thrown during unloading when I have that option set to false which doesn't get thrown when it's set to true. 

 

Good to hear! That exception is happening now because some server code is running (before it was not). I've just fixed that issue as well, but it should not affect you in any way as it is caught. As long as you can reload nicely now, that should be good enough. I think I fixed your original issue too, so you will be able to disable the connection again with the next update.

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

A problem with the STREETS folder of the audio files and that already happened in 0.3 is that the final abbreviation in the name of the audios makes that it can not be played in the game: where it should be, for example, AVENUE, is abbreviated as AVE or ROAD as RD. This make at least to me, that they do not reproduce ingame. Once I complete the name of the abbreviated urbanistic object it is when they are reproduced in the game.
 

A.C.A.B

Link to comment
Share on other sites

  • Management Team
4 hours ago, Pazzi said:

@LMS @Sam

is there any plan to add API related to "Sync" ? i mean to add the counts on the player stat.

2008780819_ScreenShot2019-03-08at11_04_06AM.png.2260cf2808eed3f2e4b05261087cf0bf.png

 

 

We are looking into if/how we could make Sync available to developers - both for stats and activity - but there are no definitive plans yet.

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

In relation to API methods I can think of off the top of my head (not currently at PC for a while) that would be immensely useful:

 

SetPedAsArrested - already exists but does not integrate properly as the features when arresting a ped normally do not work properly. Can this be fixed so a ped is recognised as being arrested like any other ped?

SetPedAsStopped - new method for on-foot stops, similarly to above please adjust so it uses the exact same behaviour as any other stopped ped

SetPedAsTrafficStopped -  similarly to above

 

I'm sure I'll think of some more when I get back to my PC but these 3 would be lovely.

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

Link to comment
Share on other sites

17 minutes ago, Albo1125 said:

In relation to API methods I can think of off the top of my head (not currently at PC for a while) that would be immensely useful:

 

SetPedAsArrested - already exists but does not integrate properly as the features when arresting a ped normally do not work properly. Can this be fixed so a ped is recognised as being arrested like any other ped?

SetPedAsStopped - new method for on-foot stops, similarly to above please adjust so it uses the exact same behaviour as any other stopped ped

SetPedAsTrafficStopped -  similarly to above

 

I'm sure I'll think of some more when I get back to my PC but these 3 would be lovely.

 

Non-developer here, is this why my arrestees keep escaping the back of my cruiser and running off? 🙂

lovkal

Link to comment
Share on other sites

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.

Edited by liverlande
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...