Quantcast

Jump to content

» «
Photo

[GTA SA] Make police chase a ped

1 reply to this topic
psychedelist
  • psychedelist

    Player Hater

  • Members
  • Joined: 22 Dec 2017
  • Russia

#1

Posted 09 February 2018 - 07:05 PM

Title seems like it would be a popular task/request, yet I couldn't find a working solution, i hope someone can help.

 

Sometimes we can see a cop car chasing a car with peds doing a drive-by on their followers. Or we can observe how a random car clashes with a cop car, the cop car turns siren on, the cop exists, drags the driver out, shoots them, then moves on. These two examples are probably different things in terms of how they're implemented in game, the second scenario is probably more of what i need. I want cops to react like this to the criminals on vigilante mission.

 

I check if vigilante mission is active by manually setting a cleo variable from copcar thread. Criminals are created with pedtype 24. Here's what i tried.

 

1. 09B6: set_char_wanted_by_police [email protected] to 1  , inside copcar thread ped initialization. Does nothing (cops never reacted, regardless if they or criminals are on foot or in car).

 

2. 0746: set_acquaintance 4 of_actors_pedtype 6 to_actors_pedtype 24  , on vigilante mission initialization in copcar thread.

 

Also, using data from here and here,

 

in my custom script,

 

before loop:

060A: create_decision_maker_type 1 store_to [email protected]
0709: set_decision_maker [email protected] on_event 36 task 1105 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 1 on_foot 1

 

inside loop (goes through all cops manually found around the player):

077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 24
060B: set_actor [email protected] decision_maker_to [email protected]

 

Also tried tasks 103, 104, 729, 1103. At least one of them made cops on foot attempt to shoot or drag out the target, but cops inside cars never reacted.

 

I guess i'll end up emulating cop behavior myself, but it would be much nicer to reuse the already existing cop behavior towards "criminals" who happen to bump into (or get bumped by) cop cars. Does anyone know how to get this to work? Am i doing something wrong in my examples?

 

Somewhat related, currently i'm performing a lot of ped-related things on each iteration of the loop, and many of those things would better be done only once, on ped initialization. Does anyone know any unused address in ped struct, so that i could store a flag in it to avoid unnecessary procedures on each loop iteration?


Sanmodder
  • Sanmodder

    Fan script

  • Members
  • Joined: 11 Sep 2017
  • Poland

#2

Posted 10 February 2018 - 05:14 AM

Title seems like it would be a popular task/request, yet I couldn't find a working solution, i hope someone can help.

 

Sometimes we can see a cop car chasing a car with peds doing a drive-by on their followers. Or we can observe how a random car clashes with a cop car, the cop car turns siren on, the cop exists, drags the driver out, shoots them, then moves on. These two examples are probably different things in terms of how they're implemented in game, the second scenario is probably more of what i need. I want cops to react like this to the criminals on vigilante mission.

 

I check if vigilante mission is active by manually setting a cleo variable from copcar thread. Criminals are created with pedtype 24. Here's what i tried.

 

1. 09B6: set_char_wanted_by_police [email protected] to 1  , inside copcar thread ped initialization. Does nothing (cops never reacted, regardless if they or criminals are on foot or in car).

 

2. 0746: set_acquaintance 4 of_actors_pedtype 6 to_actors_pedtype 24  , on vigilante mission initialization in copcar thread.

 

Also, using data from here and here,

 

in my custom script,

 

before loop:

060A: create_decision_maker_type 1 store_to [email protected]
0709: set_decision_maker [email protected] on_event 36 task 1105 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 1 on_foot 1

 

inside loop (goes through all cops manually found around the player):

077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 24
060B: set_actor [email protected] decision_maker_to [email protected]

 

Also tried tasks 103, 104, 729, 1103. At least one of them made cops on foot attempt to shoot or drag out the target, but cops inside cars never reacted.

 

I guess i'll end up emulating cop behavior myself, but it would be much nicer to reuse the already existing cop behavior towards "criminals" who happen to bump into (or get bumped by) cop cars. Does anyone know how to get this to work? Am i doing something wrong in my examples?

 

Somewhat related, currently i'm performing a lot of ped-related things on each iteration of the loop, and many of those things would better be done only once, on ped initialization. Does anyone know any unused address in ped struct, so that i could store a flag in it to avoid unnecessary procedures on each loop iteration?

 

I do not know you checked it
this is the code of aggressive drivers
police officers
They will have
too busy

0A8C: write_memory 0x96914F size 4 value 1 virtual_protect 1





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users