Jump to content

Calling Transport Support via Functions.RequestBackup


turbofandude

Recommended Posts

I'm trying to summon suspect transport via

Functions.RequestBackup(Game.LocalPlayer.Character.Position.Around(settings.GetSpawnDistance()), LSPD_First_Response.EBackupResponseType.SuspectTransporter, LSPD_First_Response.EBackupUnitType.LocalUnit);                        

and they arrive properly. Once they're there, however, they get out of the car, walk toward the player for a few seconds, then leave (without the suspect, who is handcuffed and on the ground before calling them). Is there an additional function or different arguments I should be using? Thanks in advance!

Collin Biedenkapp

Unit S17 | Professional Programmer | VocalDispatch Developer

Link to comment
Share on other sites

I've also had issues with transport backup not working when called via the API. Would be nice to get an answer on this. @LMS would be most likely to know the answer. 

[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

It's rather due to missing documentation in this case. The backup call will just dispatch the unit like a transport unit, but there is no further logic added. I can imagine that it would be useful if it did though, so I will extend what the API call does for this specific case a little bit. Right now it just passes the call to our internal backup manager, which does nothing more than dispatching the unit. The suspect transportation logic is in another class and also executes this call, but then makes use of the unit returned. That's why there is no AI logic happening for you.

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

8 hours ago, LMS said:

It's rather due to missing documentation in this case. The backup call will just dispatch the unit like a transport unit, but there is no further logic added. I can imagine that it would be useful if it did though, so I will extend what the API call does for this specific case a little bit. Right now it just passes the call to our internal backup manager, which does nothing more than dispatching the unit. The suspect transportation logic is in another class and also executes this call, but then makes use of the unit returned. That's why there is no AI logic happening for you.

On a slightly related note... could you add an API method for us to basically hand off an arbitrary ped to the internal backup manager? We can dispatch a unit Functions.RequestBackup, but that generates the ped and vehicle for us. Something like Functions.SendPedAsBackup(Vector3, EBackupResponseType, EBackupUnitType, Ped), where the Vector3 is where they should respond to, the response type is how they should respond, the unit type is how they should be considered internally (as it appears the AI treats regular cops and SWAT units differently), and Ped being the ped to add. This way callouts or plugins could spawn a specific cop and vehicle desired for that situation, but take advantage of the built-in API logic. It would be very helpful for my custom backups mod, but surely for some callouts 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

  • Management Team
8 hours ago, turbofandude said:

Ah, that makes sense - I'll be happy to implement whatever is needed. Would it be best to wait for you to extend the API or apply my own AI logic?

Largely depends on when you need it. I don't think we'll roll out a patch in the near future, so adding your own logic might be the best idea for now.

4 hours ago, PNWParksFan said:

On a slightly related note... could you add an API method for us to basically hand off an arbitrary ped to the internal backup manager? We can dispatch a unit Functions.RequestBackup, but that generates the ped and vehicle for us. Something like Functions.SendPedAsBackup(Vector3, EBackupResponseType, EBackupUnitType, Ped), where the Vector3 is where they should respond to, the response type is how they should respond, the unit type is how they should be considered internally (as it appears the AI treats regular cops and SWAT units differently), and Ped being the ped to add. This way callouts or plugins could spawn a specific cop and vehicle desired for that situation, but take advantage of the built-in API logic. It would be very helpful for my custom backups mod, but surely for some callouts as well.

Having an already created ped respond as backup should work. I'm not so sure whether we will allow setting the response type via that call though - a lot of stuff is set up on cop creation based on the response type, so this might cause issues.

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

14 hours ago, turbofandude said:

Ah, that makes sense - I'll be happy to implement whatever is needed. Would it be best to wait for you to extend the API or apply my own AI logic?

I'll make an API function in Arrest Manager available for this soon - logic's all there, just need to allow other plugins to access it.

Edited by Albo1125

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

1 hour ago, Albo1125 said:

I'll make an API function in Arrest Manager available for this soon - logic's all there, just need to allow other plugins to access it.

Is there a good way for me to detect if arrest manager is installed, and if so use said API? Would be nice to book arrest manager into the custom backup menu. Likewise my next release will have an API to let other plugins call for custom backup, so you could do something like call for local code 2 unit as the backup transporter and then pass the vehicle + peds to your internal logic. 

[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

9 minutes ago, PNWParksFan said:

Is there a good way for me to detect if arrest manager is installed, and if so use said API? Would be nice to book arrest manager into the custom backup menu. Likewise my next release will have an API to let other plugins call for custom backup, so you could do something like call for local code 2 unit as the backup transporter and then pass the vehicle + peds to your internal logic. 

Yes! Check out my Traffic Policer API Guide to get an idea of how it works - it'll be the same for Arrest Manager. 

 

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

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