Jump to content
PNWParksFan

[WIP] [REL] Custom Backup by Location

Recommended Posts

MOD RELEASED: 

 

So, I've been working on this for several weeks now, and am finally ready to share some details. Please note this plugin will not be available for a while longer - it's very much still in development, and only the basic framework has been built so far. That said, I can't wait to release it to the community! If you're interested in beta testing please send me a PM. 

This plugin will allow you to define a custom CustomBackup.xml to override the default LSPDFR Backup.xml in certain geographical areas. It will also correctly implement vehicle extras (which seems to be broken in the default Backup.xml), and will have the ability to change the "chance" of every vehicle set, vehicle, and ped (the default Backup.xml only lets you set a chance on peds). You'll be able to set vehicle color, and what distance range from the scene each type of vehicle should spawn at, so that you can configure special units to spawn further away. 

This gives you infinite control over how backup responds in different parts of the map. For example, for my testing, I have configured certain regions which are parks to have the park ranger respond in Mt. Chiliad, Raton Canyon, Cassidy Creek, Paleto Forest, Mount Josia, and San Chianski Mtn Range. I have also configured for Fort Zancudo to have base security respond as local patrol, military HUMVEEs respond as local SWAT, and Rhino tanks respond for NOOSE swat. I've also set the Annihilator, Buzzard2, and Savage to respond as local air support, and the Hydra and Lazer respond as NOOSE air support... that's right, fighter jets in your backup menu! At the airport I have an Airport Police livery which responds, as well as Federal Police. At the ports, the Port Police responds, and on the beach there's a chance of the Lifeguard responding for local patrol and a Coast Guard helicopter responding as the air unit. 

You specify what units should respond based on the WorldZone, meaning you can override for an entire county, or a specific area like "Sandy Shores" or "Vinewood Hills". The custom backup XML file only has to specify the options you want to override; if a zone isn't defined or you only define one response type (e.g. only override local patrol unit), then it'll use whatever your default LSPDFR setting is automatically. 

Current progress status of the mod:

Completed:

  • Create CustomBackup.xml format
  • Parse CustomBackup.xml components:
  • Create backup menu with dynamic options depending on if pursuit is active
  • Determine correct response when backup is requested (choose a vehicle set correctly)
  • Spawn correct backup vehicles and peds, and add to pursuit
  • New 2/2/16: Implemented basic Code 2 and Code 3 response. Code 2 responds at a slower speed, with flashing lights but no sirens. Code 3 responds at higher speed with sirens. 
  • New 2/3/16: Implemented configuration of vehicle liveries and extras, vehicle color, and vehicle spawn radius range. 
  • New 2/4/16: Implemented setting ped model components, improved Code 2/3 response driving code. 
  • New 2/5/16: Implemented ped hat/prop selection. Added various options to config file.
    Implemented 3 levels of Code 2 response options - no lights/siren; lights only; and no lights until arrival on scene, then turn lights on when arriving on scene
  • New 2/7/16: Implemented audio when calling backup, e.g. "Attention all units... backup requested at <location>, units respond Code 3", and option in ini file to toggle audio on/off. 
  • New 2/7/16: Implemented specification of custom weapons for responding peds, and chance of each weapon spawning
  • New 2/22/16: Lots of small details have been cleaned up significantly. Better controller support, ability to override LSPDFR backup menu, more customization options in the XML file, better Code 2 and Code 3 response AI, partial ambulance support, detection of police computer in use to avoid unwanted interaction, and more. Public release should be by the end of the month. Thank you to the beta testers for all your help!

 

And, here's a preview screenshot of custom backup arriving at Ford Zancudo. Yes, that's a fighter jet about to take a bombing run at the suspects!

2016-01-30_00053.thumb.jpg.5b8f652328fa8

And here we are over in Raton Canyon and we get Rangers responding in various vehicles including an ATV: 

2016-01-30_00062.thumb.jpg.fa1dfc88a2db8

Here's an image showing the livery and component selection. At the airport, LS Airport police and Federal Protective Police spawn. The airport police cars have pushbars and regular cop peds, the federal police have no pushbars and have IAA agent models. 

2016-02-04_00013.thumb.jpg.8b762dfdb4b02

 

Edited by PNWParksFan
Mod released!

Share this post


Link to post
Share on other sites

Big progress today! I got the vehicle customization working, including livery support and functional enabling/disabling of vehicle extras (which is broken in LSPDFR's backup.xml). I also just got color support working. 

The site's image upload keeps failing for me tonight, so here's some screenshots on imgur: 

https://imgur.com/a/swQZB

https://i.imgur.com/Z8IpFgx.jpg

Edited by PNWParksFan
Added color support

Share this post


Link to post
Share on other sites

 

Today's accomplishment: ini file has option now for code 2 response types of silent, lights, or arrival. Silent mode is the same as LSPDFR default; units don't use lights or sirens when responding. Lights turns on the lights but leaves sirens off. In arrival mode, the officers drive to the scene with lights off, then turn on their lights when they arrive at the scene. Arrival mode demonstrated in the video below: 

Share this post


Link to post
Share on other sites

Hey man.  I was testing the beta you gave me (thanks, by the way) and although I've already PM'd you I thought I'd post here so others can see the reply or help. 

is there any way to change the controller key to None? as i just realised Right on the dpad is the arrest button for LSPDFR. i tried editing it in the ini but it didn't have an effect. neither did changing the button to another usable button, like DPadLeft, or A

 

@Albo1125 @FtDLulz could you help? You guys seem knowledgeable about keybindings.

 

Share this post


Link to post
Share on other sites
20 minutes ago, Play3r2 said:

Hey man.  I was testing the beta you gave me (thanks, by the way) and although I've already PM'd you I thought I'd post here so others can see the reply or help. 

is there any way to change the controller key to None? as i just realised Right on the dpad is the arrest button for LSPDFR. i tried editing it in the ini but it didn't have an effect. neither did changing the button to another usable button, like DPadLeft, or A

 

@Albo1125 @FtDLulz could you help? You guys seem knowledgeable about keybindings.

 

My plugin checks if the controller button is None, and if so, just checks the keyboard key instead. If you check against None itself then it checks if no buttons are down and therefore it will mess everything up.

Edited by FtDLulz

Share this post


Link to post
Share on other sites
23 minutes ago, FtDLulz said:

My plugin checks if the controller button is None, and if so, just checks the keyboard key instead. If you check against None itself then it checks if no buttons are down and therefore it will mess everything up.

oh okay. I get ya now, I was under the impression that None was a built in RPH thing that says no button. It actually means when no button is pressed, then you get the none input.

 

Edited by Play3r2

Share this post


Link to post
Share on other sites
1 hour ago, Play3r2 said:

Hey man.  I was testing the beta you gave me (thanks, by the way) and although I've already PM'd you I thought I'd post here so others can see the reply or help. 

is there any way to change the controller key to None? as i just realised Right on the dpad is the arrest button for LSPDFR. i tried editing it in the ini but it didn't have an effect. neither did changing the button to another usable button, like DPadLeft, or A

 

@Albo1125 @FtDLulz could you help? You guys seem knowledgeable about keybindings.

 

Just got your message - sorry, I've been at work so I couldn't respond. I don't have a controller so its difficult to test myself but I will add support for a controller modifier key and make sure that it detects None and behaves appropriately. I will PM you more info once I get home and can get into the code. 

Share this post


Link to post
Share on other sites
3 minutes ago, PNWParksFan said:

Just got your message - sorry, I've been at work so I couldn't respond. I don't have a controller so its difficult to test myself but I will add support for a controller modifier key and make sure that it detects None and behaves appropriately. I will PM you more info once I get home and can get into the code. 

Alright. Thanks

 

Good luck!

Share this post


Link to post
Share on other sites
7 hours ago, PNWParksFan said:

Just got your message - sorry, I've been at work so I couldn't respond. I don't have a controller so its difficult to test myself but I will add support for a controller modifier key and make sure that it detects None and behaves appropriately. I will PM you more info once I get home and can get into the code. 

You may still have the controller button hardcoded in by accident. 

Setting the button to none in the ini should disable the controller button anyway if not hardcoded in. 

Share this post


Link to post
Share on other sites
5 minutes ago, Albo1125 said:

You may still have the controller button hardcoded in by accident. 

Setting the button to none in the ini should disable the controller button anyway if not hardcoded in. 

Yep, I just fixed the issue and sent a new beta to testers. It was a silly mistake... I was reading from the wrong section of the INI file. I also added support for a controller modifier button. 

Share this post


Link to post
Share on other sites
11 minutes ago, PNWParksFan said:

Yep, I just fixed the issue and sent a new beta to testers. It was a silly mistake... I was reading from the wrong section of the INI file. I also added support for a controller modifier button. 

Awesome. Thanks for the quick work man!

Loving the plugin so far though!

Share this post


Link to post
Share on other sites

Thank you very much to all the beta testers who have been helping get this ready for release! I'm planning to get the first public release up by the end of February. Nearly there... just a bit more testing to do, documentation to write, etc. 

Share this post


Link to post
Share on other sites

So out of curiousity do you still request backup the normal way with this or is there an additional menu? Looks very promising and if you need any additional testers I would love to try and help?

Share this post


Link to post
Share on other sites
36 minutes ago, gavind85 said:

So out of curiousity do you still request backup the normal way with this or is there an additional menu? Looks very promising and if you need any additional testers I would love to try and help?

It is an additional menu which is functionally equivalent to the default menu. You can either configure it to a different key/button so that you can still use the default LSPDFR backup menu if desired, or you can override the default menu and only use the custom menu. 

At this point I think we're good on testers, as it's nearly ready for release. I'll let you know when I'm developing future updates if you'd like to help test new features later on. 

Share this post


Link to post
Share on other sites
16 minutes ago, PNWParksFan said:

It is an additional menu which is functionally equivalent to the default menu. You can either configure it to a different key/button so that you can still use the default LSPDFR backup menu if desired, or you can override the default menu and only use the custom menu. 

At this point I think we're good on testers, as it's nearly ready for release. I'll let you know when I'm developing future updates if you'd like to help test new features later on. 

Yes please bare me in mind, I'm guessing we can edit the backup.xml to our own liking?

Share this post


Link to post
Share on other sites
23 minutes ago, gavind85 said:

I'm guessing we can edit the backup.xml to our own liking?

The default LSPDFR Backup.xml file will be unaffected. There will be an additional CustomBackup.xml file which will let you customize any area in great detail. If no entry is found in the custom file for a certain area, then it will default to the LSPDFR backup.xml. 

Share this post


Link to post
Share on other sites

I am still having a lot of trouble understanding out to set the xml up. I know the pdf explains alot, however is there a video about setting up the xml?

Share this post


Link to post
Share on other sites
7 minutes ago, jichelson said:

I am still having a lot of trouble understanding out to set the xml up. I know the pdf explains alot, however is there a video about setting up the xml?

I have not created any such video. If somebody made a good video tutorial I would post it on the download page. What part are you having trouble with? Perhaps I can help? 

If somebody wanted to create a GUI program for editing the CustomBackup.xml, they can PM me and we can discuss that possibility. I don't have the time right now to do that myself though. 

Share this post


Link to post
Share on other sites
13 hours ago, PNWParksFan said:

I have not created any such video. If somebody made a good video tutorial I would post it on the download page. What part are you having trouble with? Perhaps I can help? 

If somebody wanted to create a GUI program for editing the CustomBackup.xml, they can PM me and we can discuss that possibility. I don't have the time right now to do that myself though. 

For some reason the actual xml is confusing me. Im not sure where one area ends and another begins. I had the same issue with the original backup.xml that comes with lspdfr. Just wasnt able to figure out exactly what to enter where to make the backup work as I want. Im sure once I figure it out it is simple, however Im just lost. Maybe Ill just wait until a video is made or someone can come up with a gui 

Share this post


Link to post
Share on other sites
13 hours ago, jichelson said:

For some reason the actual xml is confusing me. Im not sure where one area ends and another begins. I had the same issue with the original backup.xml that comes with lspdfr. Just wasnt able to figure out exactly what to enter where to make the backup work as I want. Im sure once I figure it out it is simple, however Im just lost. Maybe Ill just wait until a video is made or someone can come up with a gui 

What text editor are you using? It might help to use something which is designed for editing XML. If you have Visual Studio installed, use that. Otherwise, try Notepad++. The way XML works is it's a series of opening and closing tags. <TagName> opens a tag, and </TagName> closes it. That's how you tell where one part ends and another begins. 

Share this post


Link to post
Share on other sites

I have a stupid question. If I wanted the BCSO to respond as backup in blaine county I would have to set it up like this correct?

Spoiler

    <BackupRegion nickname="Blaine">
      <BackupAreas>
        <Area>BlaineCounty</Area>
      </BackupAreas>
      <VehicleSet>
        <Vehicles>
          <Vehicle chance="30">bsheriff</Vehicle>
          <Vehicle chance="40">bsheriff2</Vehicle>
          <Vehicle chance="20">bsheriff3</Vehicle>
          <Vehicle chance="10">bsheriff4</Vehicle>
        </Vehicles>
        <Peds>
          <Ped chance="70">s_m_y_sheriff_02</Ped>
          <Ped chance="30">s_f_y_sheriff_02</Ped>
        </Peds>
        <NumPeds min="1" max="2" />
      </VehicleSet>
    </BackupRegion>

 

Share this post


Link to post
Share on other sites
48 minutes ago, br0adyb0ii said:

I have a stupid question. If I wanted the BCSO to respond as backup in blaine county I would have to set it up like this correct?

  Hide contents

    <BackupRegion nickname="Blaine">
      <BackupAreas>
        <Area>BlaineCounty</Area>
      </BackupAreas>
      <VehicleSet>
        <Vehicles>
          <Vehicle chance="30">bsheriff</Vehicle>
          <Vehicle chance="40">bsheriff2</Vehicle>
          <Vehicle chance="20">bsheriff3</Vehicle>
          <Vehicle chance="10">bsheriff4</Vehicle>
        </Vehicles>
        <Peds>
          <Ped chance="70">s_m_y_sheriff_02</Ped>
          <Ped chance="30">s_f_y_sheriff_02</Ped>
        </Peds>
        <NumPeds min="1" max="2" />
      </VehicleSet>
    </BackupRegion>

 

Looks perfect to me! Copy that in under the <LocalPatrol> section and it should work for ya, assuming all those vehicles are actually installed. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×