EAZYJ Posted January 29 Share Posted January 29 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 More sharing options...
ZAZ Posted January 30 Share Posted January 30 by what ped type did the ped spawn? please post the script CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
EAZYJ Posted January 30 Author Share Posted January 30 :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 More sharing options...
ZAZ Posted January 30 Share Posted January 30 (edited) 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 January 30 by ZAZ EAZYJ 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
EAZYJ Posted January 30 Author Share Posted January 30 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 More sharing options...
In45do Posted February 3 Share Posted February 3 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 EAZYJ 1 Link to comment Share on other sites More sharing options...
EAZYJ Posted February 4 Author Share Posted February 4 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 More sharing options...
In45do Posted February 4 Share Posted February 4 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 EAZYJ 1 Link to comment Share on other sites More sharing options...
EAZYJ Posted February 5 Author Share Posted February 5 (edited) 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 February 5 by EAZYJ Link to comment Share on other sites More sharing options...
Strs Posted May 20 Share Posted May 20 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now