Jump to content

[SA] Cleo. Spawned ped behavior. [solved]


vladvo

Recommended Posts

I spawn two medics in an ambulance. Everything is good, they are doing what I order them to do. But if CJ gets a wanted level and cops come to beat him - these two medics attack cops. How to make them ignore cops and CJ ? I tried making them to like cops and dislike CJ - nothing. They still try to defend him. I tried setting their pedtype to 4 - same.

 

0129: 11@ = create_actor_pedtype 18 model 28@ in_car 10@ driverseat
01C8: 12@ = create_actor_pedtype 18 model 28@ in_car 10@ passenger_seat 0
0E0B: mark_char_as_needed 11@
0E0B: mark_char_as_needed 12@
07DD: set_actor 11@ attack_rate 0 // previously known as temper_to
07DD: set_actor 12@ attack_rate 0 // previously known as temper_to
077A: set_actor 11@ acquaintance 2 to_actors_pedtype 0 // see ped.dat
077A: set_actor 12@ acquaintance 2 to_actors_pedtype 0 // see ped.dat
077A: set_actor 11@ acquaintance 1 to_actors_pedtype 6 // see ped.dat
077A: set_actor 12@ acquaintance 1 to_actors_pedtype 6 // see ped.dat

Tried setting their decision maker to 2

060B: set_actor 11@ decision_maker_to 2
060B: set_actor 12@ decision_maker_to 2

- no result.
Am I doing something wrong when setting up decision maker ?

Edited by vladvo
Link to comment
Share on other sites

spawn them as pedtype 24 and test it

you should post the whole script, then we can see if pedtype 18 make sense

Link to comment
Share on other sites

14 hours ago, ZAZ said:

spawn them as pedtype 24 and test it

Nope. Didn't work. They still attack cops. I don't really need pedtype 18 - the spawned medics are totally script-controlled.

Hold on. Checking stuff.
I screwed up. Changed a few lines in the script - no result. Turned out that at some point I pressed F5 instead of F6 in sanny and my script was compiled in game's cleo folder, not the one inside modloader.
After fixing this lame mistake - no, not working. Spawned actors still attack cops.

 

Update.

Solved. Works with pedtype 18 as well as pedtype 4. 

060A: create_decision_maker_type 0 store_to 25@ // decision\allowed\m_.ped files
060B: set_actor 11@ decision_maker_to 25@
060B: set_actor 12@ decision_maker_to 25@

Looks like it simply clears all char's decisions and reactions to events.

Edited by vladvo
Link to comment
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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.