SRTT NPCs shoot out of car

Well, since my modded police notoriety is different then the original one I would say that they start shooting out of their squad cars from level level 4.
This is my view on the notoriety level:
Level 1 cops try to take you out with melee and tasers
Level 2 cops actively start to hunt you and use deadly force (pistols and shotguns)
Level 3 SWAT arrives
And once the player reaches level 4 every unit is send after the player and officers are allowed to use 'all necessary force to take the suspect down' which offcoarse includes shooting while driving.
At level 5 the SNG arrives offcoarse, since reaching this level means that the SPD can't seem to bring the player down.

In the script I uploaded look for the following two lines and change the 3.0 to 4.0 for both of them:
Code:
       if POLICE_SHOOT_FROM_VEHICLES and not mission_is_active() and SANDBOX_COP_NOTORIETY_CHECK >= 3.0 then
        elseif POLICE_SHOOT_FROM_VEHICLES and not mission_is_active() and SANDBOX_COP_NOTORIETY_CHECK < 3.0 then
 
Oh god, offcoarse I can't get it to work :confused:

Editing xtbl files, anything you want, but when it comes to lua files, all hell breaks lose because I literally have zero percent experience in modding these type of files, except for adding a few lines to the 'function sr3_city_main()' to do stuff like lower the drawbridges etc...

I uploaded the sr3_city.lua with this message, so you can see (and probably laugh your ass off) with what I've done with the code that tulip.sniper gave me.

I hope this can be corrected and I might learn something from it.
 

Attachments

Oh god, offcoarse I can't get it to work :confused:

Editing xtbl files, anything you want, but when it comes to lua files, all hell breaks lose because I literally have zero percent experience in modding these type of files, except for adding a few lines to the 'function sr3_city_main()' to do stuff like lower the drawbridges etc...

I uploaded the sr3_city.lua with this message, so you can see (and probably laugh your ass off) with what I've done with the code that tulip.sniper gave me.

I hope this can be corrected and I might learn something from it.

You don't need to use that code. I already did it for you. Just use my script.
 
I hope this can be corrected and I might learn something from it.
The script I gave you was just proof of concept. I didn't even run it to make sure there aren't any typos.

That said, the main problem is that you didn't call that function from anywhere. You'll want to setup a new thread from sr3_city_main() that will execute your new function of on it's own, like in the link I referenced earlier.
Code:
function sr3_city_main()

    tutorial_suspend_all(true)

    local new_thread_handle = thread_new("sr3_city_thread_cops_shooting_out_windows")
end

Again, I haven't tested any of this. This is just to give you a good starting point and for you to clean-up. Also, Check our IdolNinja's script. You'll learn a few things (I promise). :P
 
The script I gave you was just proof of concept. I didn't even run it to make sure there aren't any typos.

That said, the main problem is that you didn't call that function from anywhere. You'll want to setup a new thread from sr3_city_main() that will execute your new function of on it's own, like in the link I referenced earlier.
Code:
function sr3_city_main()
 
    tutorial_suspend_all(true)
 
    local new_thread_handle = thread_new("sr3_city_thread_cops_shooting_out_windows")
end

Again, I haven't tested any of this. This is just to give you a good starting point and for you to clean-up. Also, Check our IdolNinja's script. You'll learn a few things (I promise). :p


Thanks you! It works now tulip.sniper, the cops shoot out of their cars from level 4, like I wanted, big thanks.
And IdolNinja, your script also works so also thank you for your help :D

But i will be using the sr3_city.lua from the vanilla game with the now working code by tulip.sniper so I can include it my mod, I don't want to steal somebody else his hard work.

And IdolNinja, just a suggestion, wouldn't it be better for Sandbox+ to keep the cops like in vanilla by default, so they don't shoot out of their cars and then when the player presses F + right arrow a message pops up saying 'enabled police shooting out of vehicles' or something like that and then the cops start shooting out of their cars from level 1, just like the gangs?
I mean, its your mod, I'm just sharing my ideas, do whatever you want with it. ;) But Sandbox+ mod gives the player a range of new features which can be activated by pressing a key combination. Changing the AI itself seems more something for another mod like Shitface his spawn & ai mod or my Advanced Notoriety Mod. But thats offcoarse just my opinion, you make your mod the way you like it and I'm sure I and the rest of this community will enjoy it either way :D
 
I like the fact that the cops shoot at you at higher notoriety. To me, it seems like an oversight to have it off. That's why I have it turned on by default. It's also configurable at the top of the script if someone wants to change it.

For future reference, I'm extremely easy going about another modder including my work in their mods. I do understand that you want a clean script for your mod, and that's cool too. To anyone else, all I ask is is that if you do want to use my work that you simply ask me first and link back to the original thread in your readme. We're all on the same team here, and if my stuff can make someone else's stuff better then I'm all for it. :)
 
I like the fact that the cops shoot at you at higher notoriety. To me, it seems like an oversight to have it off. That's why I have it turned on by default. It's also configurable at the top of the script if someone wants to change it.

For future reference, I'm extremely easy going about another modder including my work in their mods. I do understand that you want a clean script for your mod, and that's cool too. To anyone else, all I ask is is that if you do want to use my work that you simply ask me first and link back to the original thread in your readme. We're all on the same team here, and if my stuff can make someone else's stuff better then I'm all for it. :)


Yes thats true and those who don't like it can simply turn it off :)

And I find it very kind off you that you are extremely easy going about other people using your work in their mods.
When you spend a lot of time with the GTA and Need For Speed mod community you would understand why I am so carefull when it comes to my mind to use a part of someone else his mod. These forums are so different, everyone feels so much more close to each other without anyone bitching about a mod being bad or someone not knowing something. Hell, even Volition themselves are trying to help us with our mods! ;) I was actually surprised by your reaction as well as some of the other people on this forum when they said it was no problem to use something out of their mod in mine. :)
 
Back
Top