Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

[SA] Problem with followers


EAZYJ
 Share

Recommended Posts

Hello everyone,

 

At some point in my mission, the player is supposed to be followed by two peds. Only a specific one should attack whenever the player targets or is hit, and the other must remain unaggressive at all times.

 

In this case, I have put the one supposed to be helping the player against enemies in $PLAYER_GROUP, and the other just following with 0850: AS_actor follow_actor $PLAYER_ACTOR so he won't attack anybody. 

 

But if I happen to aim at the one supposed to just follow the player, the other in $PLAYER_GROUP starts shooting him and I don't want that to happen. I tried to put them both in $PLAYER_GROUP so they would get along but the one supposed to be passive will attack player targetted enemies no matter what.

 

So what would you recommand for that to work? I also tried 0746: set_acquaintance but $PLAYER_GROUP seems to ignore it.

Thank you for any help!

Link to comment
Share on other sites

:MISSION1_109
WAIT 0
0746: set_acquaintance 1 of_actors_pedtype 24 to_actors_pedtype 0
0746: set_acquaintance 1 of_actors_pedtype 24 to_actors_pedtype 24

060A: create_decision_maker_type 0 store_to [email protected]   
0709: set_decision_maker [email protected] on_event 31 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1  
0709: set_decision_maker [email protected] on_event 11 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1   
0709: set_decision_maker [email protected] on_event 36 task 1024 respect 0.0 hate 100.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 

060A: create_decision_maker_type 3 store_to [email protected]  
0709: set_decision_maker [email protected] on_event 31 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 
0709: set_decision_maker [email protected] on_event 11 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1  

[email protected] = Actor.Create(Mission1, #VMAFF4, 0.0, 0.0, 0.0)
Actor.Angle([email protected]) = 0.0
01B2: give_actor [email protected] weapon 31 ammo 999999 
060B: set_actor [email protected] decision_maker_to [email protected] 
01B9: set_actor [email protected] armed_weapon_to 31  
0245: set_actor [email protected] walk_style_to "PLAYER" 
0446: set_actor [email protected] dismemberment_possible 0 
0223: set_actor [email protected] health_to 1000 
07DD: set_actor [email protected] attack_rate 100 
02E2: set_actor [email protected] weapon_accuracy_to 40 
087E: set_actor [email protected] weapon_droppable 0 
0860: link_actor [email protected] to_interior 0 
0350: set_actor [email protected] maintain_position_when_attacked 1 
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 0
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 24 
077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1


[email protected] = Actor.Create(Mission1, #swmyhp1, 0.0, 0.0, 0.0)  
060B: set_actor [email protected] decision_maker_to [email protected] 
0245: set_actor [email protected] walk_style_to "PLAYER" 
0223: set_actor [email protected] health_to 500
0446: set_actor [email protected] dismemberment_possible 0 
087E: set_actor [email protected] weapon_droppable 0 
0860: link_actor [email protected] to_interior 0    
0350: set_actor [email protected] maintain_position_when_attacked 1 
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 0 
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 24 
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1

 

This is their spawning script. 

[email protected] is the assailant, [email protected] is the follower. I also tried to mess around with decision makers but I'm not quite familiar with it yet. 

 

 

Link to comment
Share on other sites

did you tried to spawn it as homie gang member?

 

PedType.Gang2 instead Mission1

 

1@ = Actor.Create(PedType.Gang2, #VMAFF4, 0.0, 0.0, 0.0)
2@ = Actor.Create(PedType.Gang2, #swmyhp1, 0.0, 0.0, 0.0)

 

or just the number

1@ = Actor.Create(8, #VMAFF4, 0.0, 0.0, 0.0)
2@ = Actor.Create(8, #swmyhp1, 0.0, 0.0, 0.0)

 

Edited by ZAZ
Link to comment
Share on other sites

I haven't thought of that, I just did but the aggressive (in_group) follower still shoots at the passive (follow_actor) one when targetted.

Link to comment
Share on other sites

You could try adding both actors as followers but still using [email protected] actor to kill targeted actors except [email protected] actor.

This is the code. I didn't try it yet but I think it should work:
 

:MISSION1_109
WAIT 0
0746: set_acquaintance 1 of_actors_pedtype 24 to_actors_pedtype 0
0746: set_acquaintance 1 of_actors_pedtype 24 to_actors_pedtype 24

060A: create_decision_maker_type 0 store_to [email protected]   
0709: set_decision_maker [email protected] on_event 31 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1  
0709: set_decision_maker [email protected] on_event 11 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1   
0709: set_decision_maker [email protected] on_event 36 task 1024 respect 0.0 hate 100.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 

060A: create_decision_maker_type 3 store_to [email protected]  
0709: set_decision_maker [email protected] on_event 31 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 
0709: set_decision_maker [email protected] on_event 11 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1  

[email protected] = Actor.Create(Mission1, #VMAFF4, 0.0, 0.0, 0.0)
Actor.Angle([email protected]) = 0.0
01B2: give_actor [email protected] weapon 31 ammo 999999 
060B: set_actor [email protected] decision_maker_to [email protected] 
01B9: set_actor [email protected] armed_weapon_to 31  
0245: set_actor [email protected] walk_style_to "PLAYER" 
0446: set_actor [email protected] dismemberment_possible 0 
0223: set_actor [email protected] health_to 1000 
07DD: set_actor [email protected] attack_rate 100 
02E2: set_actor [email protected] weapon_accuracy_to 40 
087E: set_actor [email protected] weapon_droppable 0 
0860: link_actor [email protected] to_interior 0 
0350: set_actor [email protected] maintain_position_when_attacked 1 
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 0
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 24 
077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1
0850: AS_actor [email protected] follow_actor $PLAYER_ACTOR  // [email protected] actor as a follower

[email protected] = Actor.Create(Mission1, #swmyhp1, 0.0, 0.0, 0.0)  
060B: set_actor [email protected] decision_maker_to [email protected] 
0245: set_actor [email protected] walk_style_to "PLAYER" 
0223: set_actor [email protected] health_to 500
0446: set_actor [email protected] dismemberment_possible 0 
087E: set_actor [email protected] weapon_droppable 0 
0860: link_actor [email protected] to_interior 0    
0350: set_actor [email protected] maintain_position_when_attacked 1 
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 0 
077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 24 
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1
0850: AS_actor [email protected] follow_actor $PLAYER_ACTOR  // [email protected] actor as a follower

:Loop
wait 0
gosub @Target
gosub @Follow
jump @Loop

:Follow
if or
00E1:   player 0 pressed_key 8 // group control foward (usually 'G' button)
8104:   not actor [email protected] near_actor $PLAYER_ACTOR radius 7.0 7.0 2.0 sphere 0  // if [email protected] actor outside 7 meter radius, he will fall back to follow the player
jf @return
0850: AS_actor [email protected] follow_actor $PLAYER_ACTOR
return

:Target
0AD2: [email protected] = player $PLAYER_CHAR targeted_actor // IF and SET
if
056D:   actor [email protected] defined
jf @return
if
803B:  not [email protected] == [email protected]  // check if targeted actor is not [email protected] 
jf @return
if
00E1:   player 0 pressed_key 17 // fire button (left-click)
jf @return
05E2: AS_actor [email protected] kill_actor [email protected]
return 

:return
return

 

Link to comment
Share on other sites

Hey thank you man, your script works quite okay. I just did some adjustments to make it fit mine. Is there any way to make actor [email protected] react to the shots he's under ? Sometimes he gets hit and he doesn't fire back like he should. 

Link to comment
Share on other sites

If the actor doesn't respond to enemies attack, you could try different alternatives from the script or just increase the radius to 20.0 or greater. To make it functional, add "gosub @React" inside the loop.

// Alternative 1
:React
00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
0AE1: [email protected] = random_char_near_point [email protected] [email protected] [email protected] in_radius 15.0 find_next 1 pass_deads 1
if
056D:   actor [email protected] defined
jf @return
if
803B:  not [email protected] == [email protected]  // (int)
jf @return
if
051A:   actor [email protected] damaged_by_actor [email protected]
jf @return          
05E2: AS_actor [email protected] kill_actor [email protected]
054E: clear_actor [email protected] damage
return

--------------------------------------------------------------------------------------

// Alternative 2
:React
00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
0AE1: [email protected] = random_char_near_point [email protected] [email protected] [email protected] in_radius 15.0 find_next 1 pass_deads 1
if
056D:   actor [email protected] defined
jf @return
if
803B:  not [email protected] == [email protected]  // (int)
jf @return
if
051A:   actor [email protected] damaged_by_actor [email protected]
jf @React_2          
05E2: AS_actor [email protected] kill_actor [email protected]

:React_2
054E: clear_actor [email protected] damage
return

 

Link to comment
Share on other sites

Appreciate your help, thanks ! Though the follower isn't always responding with much fluidity, had to make some adjustments too because the actors stick too close. I'll most likely figure out something with the scripts you provided.

 

EDIT: I found a solution. It is to keep the aggressive actor in player_group, but when conditions are met (that he's aiming at the actor he isn't supposed to or actor gets damaged) to instantly remove him from player's group, clear his task then put him back in the group, it works. As for the other being too close, just clear the following actor's task when in a radius of 5.0 and make him follow again when out of it.  

 

Edited by EAZYJ
Link to comment
Share on other sites

  • 3 months later...

try this if you still need good function what you looking for 

 

 

:MISSION1_109
WAIT 0
0747: clear_acquaintance 3 of_actors_pedtype 24 to_actors_pedtype 0 // see ped.dat
0747: clear_acquaintance 3 of_actors_pedtype 24 to_actors_pedtype 24 // see ped.dat
0747: clear_acquaintance 4 of_actors_pedtype 24 to_actors_pedtype 0 // see ped.dat
0747: clear_acquaintance 4 of_actors_pedtype 24 to_actors_pedtype 24 // see ped.dat

//if you set them you better clear as i did above
0746: set_acquaintance 0 of_actors_pedtype 24 to_actors_pedtype 0
0746: set_acquaintance 0 of_actors_pedtype 24 to_actors_pedtype 24

 

 

[email protected] = Actor.Create(Mission1, #VMAFF4, 0.0, 0.0, 0.0)
[email protected] = Actor.Create(Mission1, #swmyhp1, 0.0, 0.0, 0.0)
0ab1: @if_you_using_same_stuff_why_need_copy 1 [email protected]
0ab1: @if_you_using_same_stuff_why_need_copy 1 [email protected]

//useless trust me
{

//Delete then man its garbage
060A: create_decision_maker_type 0 store_to [email protected]   
0709: set_decision_maker [email protected] on_event 31 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1  
0709: set_decision_maker [email protected] on_event 11 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1   
0709: set_decision_maker [email protected] on_event 36 task 1024 respect 0.0 hate 100.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 
060A: create_decision_maker_type 3 store_to [email protected]  
0709: set_decision_maker [email protected] on_event 31 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 
0709: set_decision_maker [email protected] on_event 11 task 200 respect 0.0 hate 0.0 like 0.0 dislike 0.0 in_car 0 on_foot 1 
0860: link_actor [email protected] to_interior 0  //useless here in you creat them interior you dont have to link them only if you teleport from outside to interior or interior to outside then you need it
077A: set_actor [email protected] acquaintance 0 to_actors_pedtype 0
077A: set_actor [email protected] acquaintance 0 to_actors_pedtype 24 
077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6   
Actor.Angle([email protected]) = 0.0 if they follow you why you need it  ?
}

  
:if_you_using_same_stuff_why_need_copy
01B2: give_actor [email protected] weapon 31 ammo 999999 
060B: set_actor [email protected] decision_maker_to 2 //this is what you need notherelse  
0245: set_actor [email protected] walk_style_to "PLAYER" 
0446: set_actor [email protected] dismemberment_possible 0 
0223: set_actor [email protected] health_to 1000 
07DD: set_actor [email protected] attack_rate 1000 
02E2: set_actor [email protected] weapon_accuracy_to 1000 
087E: set_actor [email protected] weapon_droppable 0 
0350: set_actor [email protected] maintain_position_when_attacked 1 
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1
01B9: set_actor [email protected] armed_weapon_to 31
0ab2: 0

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
 Share

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