12jango Posted June 15, 2016 Share Posted June 15, 2016 I need some help about getting a ped and define them as [email protected] (or whatever number) so you can actually interact with them, like performing desired animations on them etc. As far as I know you can use the opcodes below to catch a ped 073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected] 089E: get_actor_in_sphere [email protected] [email protected] [email protected] radius 5.0 handle_as [email protected] // versionB 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 50.0 handle_as [email protected] even this :0A3E: unknown_get_actor_in_sphere $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 radius 0.6 0.6 1.0 handle_as [email protected] I don't know about this :091C: get_actor_in_sphere $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 radius 1.5 model #KB_BANDIT_U external_script_named "PEDSLOT" handle_as [email protected] But it seems the same type, but don't know how it work. But they're limited only for normal peds, can't be used for gangs, drug dealer, also actors that appear in a mission. However, the opcode below actually can catch all those types. 0AE1: $actor = random_actor_near_point [email protected] [email protected] [email protected] in_radius 10.0 find_next 1 pass_deads 1 //IF and SET But, even if you can catch them, adding marker, or adding weaps on them, etc. But for performing animation, normal peds react immeadiately, but the drug dealer don't, and the gangs randomly deny the command (sometimes react after few seconds). So please tell me an absolute way of catching ped without having problems like this. Cheers! Link to comment Share on other sites More sharing options...
Nova7GFU Posted June 16, 2016 Share Posted June 16, 2016 Mate, maybe you can find a solution in the tutorial CLEO by ZAZ in the "RandomActor_for_to_step_method" part in "catch_random_actor". I hope I've helped. Link to comment Share on other sites More sharing options...
12jango Posted June 16, 2016 Author Share Posted June 16, 2016 I didn't see that one even though I've visit his tutorial for many times. Anyway, thanks for your help. Link to comment Share on other sites More sharing options...
X-Falcon Posted June 16, 2016 Share Posted June 16, 2016 (edited) It seems you are familiar with old mystery year ago, too! very wonder, i didn't get anything!after this incomplete line: if and 803B: not $PLAYER_ACTOR == [email protected] 00FE: actor [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius [email protected] [email protected] [email protected] But now i didn't understand what you mean! every opcode looks like not strange. cus i testing 0AE1 without trouble to scan everything ped but it's very harm! than 0A3E. 0A3E have own limit not like 0AE1 blind everything whatever it's actor in vehicle and my gang members.//------------------------- About this, i guess this opcode more directed to what is ped work it look like how scm work to make drugger be drug seller, or etc but i really not sure! 091C: get_actor_in_sphere $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 radius 1.5 model #KB_BANDIT_U external_script_named "PEDSLOT" handle_as [email protected] Anyway, You can try my example to see how it's work. When it said Actor Handle '-1' it's meaning there no any random ped in player radius, and coords it just to routine test if opocode still way. Oh and try to uncomment anim loop plus delete 0321 too. {$CLEO}const// Player Coords PX = [email protected] PY = [email protected] PZ = [email protected]//////////////////////// ANY_RANDOM_PED = [email protected] ANY_TYPE_IFP = "GANGS"end0000: WHILE TRUE wait 0if0256: player 0 defined //make sure Player is not dead or bustedjf continue[..............] //any wanted to add...//let's scan everything 00A0: store_actor $PLAYER_ACTOR position_to PX PY PZ 0AE1: ANY_RANDOM_PED = find_all_random_chars_in_sphere PX PY PZ radius 8.0 find_next 1 skip_dead 1 //hidden opocode, eh. ~commentaries opcodes gtag//collecting info what we've got and surely current coords still way 0AD1: show_formatted_text_highpriority "Actor Handle: %d, PX: %.1f PY: %.1f PZ: %.1f" time 250 [email protected] [email protected] [email protected] [email protected]//make sure the random ped avaiblleif 0019: ANY_RANDOM_PED <> -1jf continueif and 056D: actor ANY_RANDOM_PED defined // if we've got an actor 8038: NOT $PLAYER_ACTOR == ANY_RANDOM_PED // make sure it's not Playerjf continue//collecting info his model id and pedtype, when we had got that 0665: get_actor ANY_RANDOM_PED model_to [email protected] 089F: get_actor ANY_RANDOM_PED pedtype_to [email protected] 0AD1: show_formatted_text_highpriority "ID: %d, Type: %d" time 1500 [email protected] [email protected][..............] //doing something or...{// Anim loop04ED: load_animation ANY_TYPE_IFPwhile 84EE: NOT animation ANY_TYPE_IFP loaded wait [email protected] = -10605: actor ANY_RANDOM_PED perform_animation "prtial_hndshk_01" IFP ANY_TYPE_IFP framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time [email protected] 8019: NOT [email protected] > 1500 wait 00AD1: show_formatted_text_highpriority "Time: %d" time 250 [email protected]: release_animation ANY_TYPE_IFP}0321: AS_actor ANY_RANDOM_PED die_headshotted//in the end hypnotis him!01C2: remove_references_to_actor ANY_RANDOM_PED // Like turning an actor into a random pedestrianEND and this is the another commentaries from gtag may can clarify what the opocode doing: { 08E5: get_actor_in_sphere PX PY PZ radius 8.0 handle_as 0 089E: get_random_char_in_sphere_only_drugs_buyers PX PY PZ radius 8.0 store_to 0 073F: get_random_char_in_sphere PX PY PZ radius 8.0 with_pedtype civilian 1 gang 1 criminal 1 store_to 0 0AE1: 0 = find_all_random_chars_in_sphere PX PY PZ radius 8.0 find_next 0 skip_dead 1 0A3E: get_random_char_in_area_offset_no_save PX PY PZ radius 8.0 8.0 8.0 store_to 0} Good luck! Edit: I still not yet check everything. Edited June 16, 2016 by X-Falcon Link to comment Share on other sites More sharing options...
Nova7GFU Posted June 18, 2016 Share Posted June 18, 2016 @X-Falcon, I have a question. How I can save two actors in different variables? Because I try to make myself a bodyguard (variable 1) to immediately attack the enemy actor/ped (variable 2), but not mix the 2 actors in a single variable (variable 1 or variable 2). Link to comment Share on other sites More sharing options...
12jango Posted June 18, 2016 Author Share Posted June 18, 2016 (edited) Man, I gotta say seems none of them can surpass the 0AE1. This is what I've been thinking; the drugman, also the actors in a store (eg; bar), and those is missions(vagos near the house in burning desire& the ballas in the green sabre) share the same similarities. Like some sort of command from the scm that always be their 1st priority! So even though Cleo mod allows us to add external script, the game prefer the scm commands over the cleo. :sigh:Well, I've been thinking something different, like turn invisible the targetted actor, create a custom one with same weaps,health&pedtype, then put him on the same place so he could act like the targetted actor. But it sounds complicated, right? Edited June 18, 2016 by 12jango Link to comment Share on other sites More sharing options...
X-Falcon Posted June 19, 2016 Share Posted June 19, 2016 (edited) How I can save two actors in different variables? Because I try to make myself a bodyguard (variable 1) to immediately attack the enemy actor/ped (variable 2), but not mix the 2 actors in a single variable (variable 1 or variable 2). Nova7GFU, umm if you talking VC then may it would bit hard for right now. But if VC have similiar opocode with function we method in this topic like SA, Then first time to get random actor in any radius as actor handle for attacked would be easily. But only this opocode that left for fire support condition (both for SA, VC): if or //fill with reason why random actor must attacked 051A: actor ANY_RANDOM_PED damaged_by_actor $PLAYER_ACTOR 02E0: actor ANY_RANDOM_PED firing_weapon 0457: player $PLAYER_CHAR aiming_at_actor ANY_RANDOM_PED Actually this week i try to make same partner/bodyguard too, for SA. I image the partner would more support player before before his Dead. May this what you mean (if it SA) but i sorry some part opocode seems not support VC it's out my experience: {$CLEO}0000:const //temporary var PARTNER_ACTOR = [email protected] PPX = [email protected] PPY = [email protected] PPZ = [email protected] ANY_RANDOM_PED = [email protected]: store_coords_to PPX PPY PPZ from_actor $PLAYER_ACTOR with_offset 1.0 1.0 1.0//009A: PARTNER_ACTOR = create_actor_pedtype 4 model 103 at PPX PPY PPZ09B5: set_actor PARTNER_ACTOR signal_after_kill 0[.............]gosub @DeadPoint[.............]:DeadPointwait 0 //routine support until player or actor dead00A0: store_actor PARTNER_ACTOR position_to PPX PPY PPZ0AB1: call_scm_func @FireSupport 4 store_actor_to PARTNER_ACTOR store_coords_to PPX PPY PPZ at_radius 25.0 //ped_handle [email protected][.............]if or NOT Actor.Dead(PARTNER_ACTOR) 0256: player 0 defined 056D: actor PARTNER_ACTOR definedjf @[email protected] = 0while NOT [email protected] > 3000 wait 0end 020C: create_explosion_with_radius 0 at PPX PPY PPZ Actor.RemoveReferences(PARTNER_ACTOR) 009B: destroy_actor PARTNER_ACTORreturn:FireSupport0AE1: ANY_RANDOM_PED = find_all_random_chars_in_sphere [email protected] [email protected] [email protected] radius [email protected] find_next 1 skip_dead 1 //not avaible in vcif 2 0019: ANY_RANDOM_PED > -1 8038: NOT $PLAYER_ACTOR == ANY_RANDOM_PED // make sure it's not Player 803B: NOT [email protected] == ANY_RANDOM_PED // (int) // make sure it's not Sweetthenif or //condition body reason random actor must attacked 051A: actor ANY_RANDOM_PED damaged_by_actor $PLAYER_ACTOR 02E0: actor ANY_RANDOM_PED firing_weapon 0457: player $PLAYER_CHAR aiming_at_actor ANY_RANDOM_PEDthen05E2: AS_actor [email protected] kill_actor ANY_RANDOM_PED //while 8118: NOT actor ANY_RANDOM_PED dead wait 0if 0104: actor ANY_RANDOM_PED near_actor [email protected] radius 25.0 25.0 20.0 sphere 0 //check out ai radius jf break endendend0AB2: ret 0 //[email protected] same part from Wesser and ZAZ's post year ago Man, I gotta say seems none of them can surpass the 0AE1. This is what I've been thinking; the drugman, also the actors in a store (eg; bar), and those is missions(vagos near the house in burning desire& the ballas in the green sabre) share the same similarities. Like some sort of command from the scm that always be their 1st priority! So even though Cleo mod allows us to add external script, the game prefer the scm commands over the cleo. Yes.. in the short you are right scm is forcing Drug seller to not doing anything, he cannot out at his position as "DEALER" orignally, But maybe ZAZ can help you for edit Drug Dealer. Well, I've been thinking something different, like turn invisible the targetted actor, create a custom one with same weaps,health&pedtype, then put him on the same place so he could act like the targetted actor. But it sounds complicated, right? Sir, It cool idea! I think you are very more know it! isn't targetted actor also using on Throwing Knife? 1. Set any pedtype or ped relationship. In scm can like by create actor or set manually by 077A and 0746: 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 0 // see ped.dat 0746: set_acquaintance 1 of_actors_pedtype 8 to_actors_pedtype 0 2. Health it sound not complicate but Armor is yes! im using memorry address to make my ped armored: //add wild armour //Actor.AddArmour([email protected], 100) 0A96: [email protected] = actor ACTOR_SWEET struct //Any Actor Now Cped. 000A: [email protected] += 0x548 // Armor flag. 0A8C: write_memory [email protected] size 4 value 300.0 virtual_protect false // //========================================= 3. 0AD2 is way to put at Actor Target as Handle and for future to doing something with target, have similiar way get random ped on foot: {$CLEO}const PLAYER_TARGET = [email protected] PX = [email protected] PY = [email protected] PZ = [email protected]//Foot Controls AIM_KEY = 6 FIRE_KEY = 17end0000:WHILE TRUE wait 0 0AD2: PLAYER_TARGET = player $PLAYER_CHAR targeted_actor //IF and SET gosub @AnyTargetif PLAYER_TARGET <> -1jf continue 00A0: store_actor PLAYER_TARGET position_to PX PY PZ 0AD1: show_formatted_text_highpriority "Target: %d, PX: %.1f, PY: %.1f" time 1000 PLAYER_TARGET PX PY if 00E1: player 0 pressed_key FIRE_KEY //Fire then //put all here 0321: AS_actor PLAYER_TARGET die_headshotted jf break end END:AnyTargetif 056D: actor PLAYER_TARGET definedjf @back_with_result 089F: get_actor PLAYER_TARGET pedtype_to [email protected] if and [email protected] == 8 [email protected] > 23jf @back_with_result//can add more condtion to skip target//089F: get_actor ANY_RANDOM_PED pedtype_to [email protected]_TARGET = -1 //force assign not target:back_with_result0AD1: show_formatted_text_highpriority "Target: %d" time 250 PLAYER_TARGETreturn (Correct Me if Im Wrong) Edited June 19, 2016 by X-Falcon Link to comment Share on other sites More sharing options...
Nova7GFU Posted June 19, 2016 Share Posted June 19, 2016 1) CLEO 2 does have available the 0AE1 Opcode. 2) I have done tests this opcode (0AE1) and it works. 3) I created my bodyguard correctly, the only problem I found is if you apply the opcode (actor BODYGUARD tie actor $PLAYER_ACTOR) this one will follow you and act like a normal bodyguard (attacking only some actors) but without applying this opcode bodyguard attacks and kills any actor who attack the player (including all those pesky cops). Sorry for my english, sir. Link to comment Share on other sites More sharing options...
X-Falcon Posted June 20, 2016 Share Posted June 20, 2016 (edited) 1) CLEO 2 does have available the 0AE1 Opcode. 2) I have done tests this opcode (0AE1) and it works. It's very good to know! Because i only use original opocode sanny builder and not found that. 3) I created my bodyguard correctly, the only problem I found is if you apply the opcode (actor BODYGUARD tie actor $PLAYER_ACTOR) this one will follow you and act like a normal bodyguard (attacking only some actors) but without applying this opcode bodyguard attacks and kills any actor who attack the player (including all those pesky cops). WOT! in the short what is your main script problem? This mean, in VC you call group members player as Ped Tie but in SA I using three way: //put to actor group 07AF: [email protected] = player 0 group 0630: put_actor $PLAYER_ACTOR in_group [email protected] as_leader 0631: put_actor ACTOR_SWEET in_group [email protected] From scratch you said have problem because Mix 2 variable handle: but not mix the 2 actors in a single variable (variable 1 or variable 2). So i write how to use random ped to seperate that variable. And who is the enemy ped you mean? you didn't said it specific and i didn't know who is! a bodyguard (variable 1) to immediately attack the enemy actor/ped (variable 2) So i thinking condition body to claim if they as enemy. Edited June 20, 2016 by X-Falcon Link to comment Share on other sites More sharing options...
X-Falcon Posted June 20, 2016 Share Posted June 20, 2016 (edited) My suggest Post the Script. Edited June 20, 2016 by X-Falcon Link to comment Share on other sites More sharing options...
12jango Posted June 20, 2016 Author Share Posted June 20, 2016 (edited) {$CLEO}const PLAYER_TARGET = [email protected] PX = [email protected] PY = [email protected] PZ = [email protected]//Foot Controls AIM_KEY = 6 FIRE_KEY = 17end0000:WHILE TRUE wait 0 0AD2: PLAYER_TARGET = player $PLAYER_CHAR targeted_actor //IF and SET gosub @AnyTargetif PLAYER_TARGET <> -1jf continue 00A0: store_actor PLAYER_TARGET position_to PX PY PZ 0AD1: show_formatted_text_highpriority "Target: %d, PX: %.1f, PY: %.1f" time 1000 PLAYER_TARGET PX PY if 00E1: player 0 pressed_key FIRE_KEY //Fire then //put all here 0321: AS_actor PLAYER_TARGET die_headshotted jf break end END:AnyTargetif 056D: actor PLAYER_TARGET definedjf @back_with_result 089F: get_actor PLAYER_TARGET pedtype_to [email protected] if and [email protected] == 8 [email protected] > 23jf @back_with_result//can add more condtion to skip target//089F: get_actor ANY_RANDOM_PED pedtype_to [email protected]_TARGET = -1 //force assign not target:back_with_result0AD1: show_formatted_text_highpriority "Target: %d" time 250 PLAYER_TARGETreturn Always feel amazed with your way of making codes. Targetting a ped then kill him with fire button, yeah? Btw I just tried these trio: 07AF: [email protected] = player 0 group0630: put_actor $PLAYER_ACTOR in_group [email protected] as_leader0631: put_actor ACTOR_SWEET in_group [email protected] And hoping it will do something with "the overly obidient peds" (y'know the ones I told you before) but nothing different. So, I want to share what I've been doing with 0AE1: {$CLEO .cs} thread 'T' :Triggerwait 0if00E1: player 0 pressed_key 17jf @Trigger04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 1.0 [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 0.8 find_next 0 pass_deads 1 //IF and SETifActor.Defined([email protected] @Trigger0226: [email protected] = actor [email protected] health:Loop wait 0 if and 80DF: not actor $PLAYER_ACTOR driving 8965: not actor $PLAYER_ACTOR swimming 80DF: not actor [email protected] driving 8965: not actor [email protected] swimming jf @Trigger if and 80E1: not player 0 pressed_key 15 0104: actor $PLAYER_ACTOR near_actor [email protected] radius 1.0 1.0 1.0 sphere 0 jf @Trigger 0792: disembark_instantly_actor [email protected] 0851: set_actor [email protected] decrease_health_by 50 flag 1 0792: disembark_instantly_actor [email protected] 0812: AS_actor [email protected] perform_animation "KO_SKID_FRONT" IFP_file "PED" 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB if Actor.Animation([email protected]) == "KO_SKID_FRONT" jf @Loop 0223: set_actor [email protected] health_to [email protected] 0812: AS_actor [email protected] perform_animation "ABSEIL" IFP_file "PED" 4.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1 // versionB jump @Trigger This script catch a ped with left-click and let him do "ABSEIL" anim. Look carefully there are unusual things I put there: 1. At the top, I checked if the Actor [email protected] is defined after 0AE1. Because if I don't do that the game will crash.(FYI:it seems 0AE1 only work if you use [email protected] as the variable for the actor. If you use other it will crash too! 2. See the Loop label? Above it there is 0226 to define actor's current health. And these combination forces the actor to do "ABSEIL" anim by keep decreasing his health as well as disembarking him before and after health decreased then confirm whether he is ready to do anim by testing him to do "KO_SKID_FRONT" then check if he obey, then restore his health back with 0223 then do the "ABSEIL" anim. 0792: disembark_instantly_actor [email protected]: set_actor [email protected] decrease_health_by 50 flag 10792: disembark_instantly_actor [email protected]: AS_actor [email protected] perform_animation "KO_SKID_FRONT" IFP_file "PED" 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionBifActor.Animation([email protected]) == "KO_SKID_FRONT"jf @Loop0223: set_actor [email protected] health_to [email protected]: AS_actor [email protected] perform_animation "ABSEIL" IFP_file "PED" 4.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1 // versionBjump @Trigger With this script, drug man will respons as quickly as normal peds. But for gangs sometimes they respons slowly. But still, for the ones in the bar/missions(try Burning Desire or Green Sabre mission) it doesn't work. 3. And lastly in case it going loop these will break it. 80E1: not player 0 pressed_key 15 0104: actor $PLAYER_ACTOR near_actor [email protected] radius 1.0 1.0 1.0 sphere 0 Also I never remove refferences, release anim, also release model. And everything seems to be Ok 'till now. Edited June 20, 2016 by 12jango Link to comment Share on other sites More sharing options...
Nova7GFU Posted June 20, 2016 Share Posted June 20, 2016 My suggest Post the Script. No problem, sir! {$CLEO .cs}thread 'BGUARD'CONST // Player Positions XPOS = [email protected] YPOS = [email protected] ZPOS = [email protected] // Bodyguard's properties BODYGUARD = [email protected] PED_MODEL = 103 WEAPON_MODEL = 278 WEAP_NUMBER = 20 // Things for testing MARKER_TEST = [email protected] // Only for testing SWITCH = [email protected] TRUEwait 0 IF Player.Defined($PLAYER_CHAR) THEN IF 0AB0: key_pressed 0x73 // press F4 key THEN Model.Load(PED_MODEL) Model.Load(WEAPON_MODEL) WHILE TRUE wait 0 IF AND Model.Available(PED_MODEL) Model.Available(WEAPON_MODEL) THEN 04C4: create_coordinate XPOS YPOS ZPOS from_actor $PLAYER_ACTOR offset 1.0 1.0 0.0 Actor.Create(BODYGUARD, CIVMALE, PED_MODEL, XPOS, YPOS, ZPOS) 01B2: give_actor BODYGUARD weapon WEAP_NUMBER ammo 1000 02E2: set_actor BODYGUARD weapon_accuracy_to 95 0223: set_actor BODYGUARD health_to 500 0446: set_actor BODYGUARD dismemberment_possible 0 0319: set_actor BODYGUARD running 1 04F5: unknown_actor BODYGUARD kiss_player $PLAYER_CHAR on 1 Marker.CreateAboveActor(MARKER_TEST, BODYGUARD) Marker.SetColor(MARKER_TEST, 2) Model.Destroy(PED_MODEL) Model.Destroy(WEAP_NUMBER) break END END [email protected] = 0 SWITCH = 0 WHILE Player.Defined($PLAYER_CHAR) wait 0 02FD: text_2numbers_lowpriority 'RACETM' BODYGUARD [email protected] 2000 ms 1 // ~b~RACE TIME: ~1~:~1~ IF not Actor.Dead(BODYGUARD) THEN IF AND 0039: SWITCH == 0 001B: 1 > [email protected] THEN IF 00E9: player $PLAYER_CHAR 0 BODYGUARD radius 100.0 100.0 THEN IF 8320: not actor BODYGUARD in_range_of_player $PLAYER_CHAR THEN 01DF: tie_actor BODYGUARD to_player $PLAYER_CHAR END ELSE break END 0AB1: call_scm_func @GET_ACTOR_DAMAGING_ACTOR 1 $PLAYER_ACTOR store_damaging_actor_to [email protected] END IF AND 0039: SWITCH == 0 0029: [email protected] >= 1 THEN 01C9: actor BODYGUARD kill_actor [email protected] SWITCH = 1 END IF AND 0039: SWITCH == 1 0029: [email protected] >= 1 THEN IF Actor.Dead([email protected]) THEN Actor.RemoveReferences([email protected]) [email protected] = 0 SWITCH = 0 END END ELSE break END END IF 0019: [email protected] > 1 THEN Actor.RemoveReferences([email protected]) [email protected] = 0 END [email protected] = 0 SWITCH = 0 Actor.DestroyWithFade(BODYGUARD) Marker.Disable(MARKER_TEST) 03E5: text_box 'FEM_OFF' END ENDEND:GET_ACTOR_DAMAGING_ACTOR // I got this code thanks to Mr. Silent0A96: [email protected] = actor [email protected] [email protected] += 0x59C0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] = 0IF not [email protected] == 0THEN // Check if the entity is a ped 0A8E: [email protected] = [email protected] + 0x50 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 0B17: [email protected] _&= 7 IF [email protected] == 3 THEN 0AEA: [email protected] = actor_struct [email protected] handle ENDEND0AB2: ret 1 [email protected] Ok, I'll explain. When the opcode: '01DF' is applied, the bodyguard protects me normally (ie, does not attack all actors who attack the player), the bodyguard does not attack the f*cking cops! When the opcode: '01DF' is not applied, the bodyguard never follow the $PLAYER_ACTOR, BUT! when an actor (either: ped / cops / gangs / ANYONE) attacks the player, the bodyguard immediately attacks him to death. But, sometimes the bodyguards killed the same player if he shoots any weapon. Thanks and sorry for my english. Link to comment Share on other sites More sharing options...
X-Falcon Posted June 23, 2016 Share Posted June 23, 2016 (edited) First, I'm sorry for late reply guys. Actually I'm little bussy in real life this week. 3 day ago i try find R* stuff in main.scm, second day ago i panic with problem HDD, my HDD is not connect then, i guess i must reboot and lost all datas.But now all end. Because the cable of HDD just a bit saggy may it's because mouse home! Now day i know what you the both doing! So, I want to share what I've been doing with 0AE1: So you use Double disembark, damaging actor, then break anim! 0792: disembark_instantly_actor [email protected]: set_actor [email protected] decrease_health_by 50 flag 10792: disembark_instantly_actor [email protected]: AS_actor [email protected] perform_animation "KO_SKID_FRONT" IFP_file "PED" 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionBifActor.Animation([email protected]) == "KO_SKID_FRONT"jf @Loop0223: set_actor [email protected] health_to [email protected]: AS_actor [email protected] perform_animation "ABSEIL" IFP_file "PED" 4.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1 // versionBjump @Trigger @12jango the trickster! Smart guy why don't you ask before! I Notice, But you will killing the ACTOR permanent. 0851: set_actor [email protected] decrease_health_by 50 flag 1 I improve the code with how you force anim, plus with the test code i had post: {$CLEO}const// Unused constans ANIMATION_1 = "KO_SKID_FRONT" ANIMATION_2 = "ABSEIL" ANIMATION_3 = "DEALER_IDLE"//---------------------- IFP_A = "PED" IFP_B = "DEALER"//----------------------// Applied constans CURRENT_MODEL = [email protected] CURRENT_PEDTYPE = [email protected]// Coordinate Radius XRAD = [email protected] YRAD = [email protected] ZRAD = [email protected]::Triggerwait 0gosub @BREAK_FORCE_TOOGLE 00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 1.0 find_next 1 pass_deads 0 //IF and SETif 0AB1: call_scm_func @IS_ACTOR_HANDLE_PASSED 1 store_any_actor; [email protected] result_actor_handle; [email protected] @GoBack XRAD = 1.0 YRAD = 1.0 ZRAD = 0.5 //////////////////////////////// 0665: get_actor [email protected] model_to CURRENT_MODEL 089F: get_actor [email protected] pedtype_to CURRENT_PEDTYPE gosub @LoopA gosub @LoopB:GoBackjump @Trigger//-------------Loop A (Break)---------------:LoopAconst TOTAL_HEALTH = [email protected] TEMP_HEALTH = [email protected] 0if [email protected] == 0x1jf @returnA06D2: [email protected] = "PED" // @v = string////////////////////////////////////0226: TOTAL_HEALTH = actor [email protected] health:TestAif and 80E1: not player 0 pressed_key 15 0104: actor $PLAYER_ACTOR near_actor [email protected] radius XRAD YRAD ZRAD sphere 1jf @cleartaskwait 00AD1: show_formatted_text_highpriority "ID: %d, Type: %d, HP: %d" time 500 CURRENT_MODEL CURRENT_PEDTYPE TOTAL_HEALTH0792: disembark_instantly_actor [email protected]: set_actor [email protected] decrease_health_by TOTAL_HEALTH flag 10792: disembark_instantly_actor [email protected]//Anim1088A: actor [email protected] perform_animation "KO_SKID_FRONT" IFP [email protected] 1000.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 disable_force 0 disable_lockZ 1//0812: AS_actor [email protected] perform_animation "KO_SKID_FRONT" IFP_file [email protected] 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1 // versionBif NOT Actor.Animation([email protected]) == "KO_SKID_FRONT"jf @NextAjump @TestA:NextA018C: play_sound 1052 at 0.0 0.0 0.00226: TEMP_HEALTH = actor [email protected] health//Anim2088A: actor [email protected] perform_animation "ABSEIL" IFP [email protected] 1000.0 loopA 1 lockX 0 lockY 0 lockF 1 time -1 disable_force 0 disable_lockZ 0//0812: AS_actor [email protected] perform_animation "ABSEIL" IFP_file [email protected] 1000.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1 // versionBwhile 0AB0: key_pressed 49 wait 0 0AD1: show_formatted_text_highpriority "ID: %d, Type: %d, temp_HP: %d" time 500 CURRENT_MODEL CURRENT_PEDTYPE TEMP_HEALTHend:cleartask0223: set_actor [email protected] health_to TOTAL_HEALTH0687: clear_actor [email protected] task01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian:returnAreturn//-------------Loop B (Test)---------------:LoopB//- R* scm Method GET ANIMATION TIME, i found this! const TOTAL_TIME = [email protected] //Int TIMERA = [email protected] [email protected] == 0x2 then 06D2: [email protected] = "DEALER" // @v = string //////////////////////////////////// // Anim loop 04ED: load_animation [email protected] while 84EE: NOT animation [email protected] loaded wait 0 end 0792: disembark_instantly_actor [email protected] 088A: actor [email protected] perform_animation "DEALER_IDLE" IFP [email protected] 8.0 loopA 1 lockX 0 lockY 0 lockF 1 time -1 disable_force 0 disable_lockZ 0 //get next total length 061A: get_actor [email protected] animation; "DEALER_IDLE" total_time_to [email protected] 0092: TOTAL_TIME = float [email protected] to_integer TIMERA = 0 while 0611: actor [email protected] performing_animation "DEALER_IDLE" wait 0 if 0019: TIMERA > TOTAL_TIME then 018C: play_sound 1054 at 0.0 0.0 0.0 breakend 0AD1: show_formatted_text_highpriority "ID: %d, Type: %d, Total: %d, Time: %d" time 1000 CURRENT_MODEL CURRENT_PEDTYPE TOTAL_TIME TIMERA if 0104: actor $PLAYER_ACTOR near_actor [email protected] radius XRAD YRAD ZRAD sphere 1 jf breakend 0687: clear_actor [email protected] task 04EF: release_animation [email protected] //01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrianendreturn//- - - - - - - - - - - - - -:IS_ACTOR_HANDLE_PASSEDif 056D: actor [email protected] definedthen if 87D6: NOT [email protected] == $PLAYER_ACTOR // @ == $ (int) // make sure it's not Player! //similliar with; 87D6 or 8038then else [email protected] = -1 //clear handle if either condition false [email protected] > 10AB2: ret 1 [email protected]//- - - - - - - - - - - - - -:BREAK_FORCE_TOOGLEvar [email protected] : Int [email protected] : Intend//step0if 0AB0: key_pressed 48then [email protected] = 0x0else //step1 if 0AB0: key_pressed 49 then [email protected] = 0x1 end //step2 if 0AB0: key_pressed 50 then [email protected] = 0x2 end end if [email protected] <> [email protected] 0AD1: show_formatted_text_highpriority "Current Int: %d" time 500 [email protected]@ = [email protected] should work to gangs, but i didn't test to DEALER since i have problem to find Dealer/game for 15 minutes check out address :BREAK_FORCE_TOOGLE too Hold some button to pause, and press 1 time repeat in loop. I checked if the Actor [email protected] is defined after 0AE1.Because if I don't do that the game will crash. I had show you correct way defined them, this part way Wesser defined actor year ago.Same as with the code that implanted, see below: {Sample: <IF statement>call_scm_func @IS_ACTOR_HANDLE_PASSED 1 store_any_actor; [email protected] pass_actor [email protected]}:IS_ACTOR_HANDLE_PASSEDif 056D: actor [email protected] definedjf @returning_resultif 87D6: NOT [email protected] == $PLAYER_ACTOR // @ == $ (int) // make sure it's not Player! //803B: NOT $PLAYER_ACTOR == [email protected] //SIMILIAR AS; 87D6 or 8038...jf @clear_handlejump @returning_result //go to return with pass handle.:[email protected] = -1 //clear ACTOR handle when there either condition false:[email protected] > 1 //single condition body; The Pass actor Handle it's must be more than -1 or 0, Make sure we had got Actor Handle.//0AD1: show_formatted_text_highpriority "Actor Handle: %d" time 100 [email protected]: ret 1 [email protected] And check out Wesser topic to know 0AB1 tips: SCM functions Also I never remove refferences, release anim, also release model. And everything seems to be Ok 'till now. Hm! not all OK tou me!Ok Good luck, again M4! Also, I wanna tell you i had no other idea to force the anim played, after all. Edit: Script Reupdated & grammar. Edited June 24, 2016 by X-Falcon Link to comment Share on other sites More sharing options...
X-Falcon Posted June 23, 2016 Share Posted June 23, 2016 (edited) Ok, I'll explain. When the opcode: '01DF' is applied, the bodyguard protects me normally (ie, does not attack all actors who attack the player), the bodyguard does not attack the f*cking cops! When the opcode: '01DF' is not applied, the bodyguard never follow the $PLAYER_ACTOR, BUT! when an actor (either: ped / cops / gangs / ANYONE) attacks the player, the bodyguard immediately attacks him to death. But, sometimes the bodyguards killed the same player if he shoots any weapon. Thanks and sorry for my english. Strange! But Silent has give you code to get who actor damaging you, and Looks like it's enough to protect you, isn't ? You ask it like the Ped Tie limit you, tie psyco Dog in VC! But SA luckily we tie bad Kitty Cat. First I dunno if my last code :FIRE_SUPPORT is work in VC or no, In SA i test the code and can works charm until ask to attacking anything around him. //get actor-handle coordinates00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] //1 hm! the both is no different!?//00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected] //1 hm! the both is no different!?//0054: store_player $PLAYER_CHAR position_to [email protected] [email protected] [email protected] //2{Parameter: [email protected] Friend Actor Handle [email protected] X Coord [email protected] Y Coord [email protected] Z Coord [email protected] Radius searching Any Actor- Return; Pass Any Actor Handle}0AB1: call_scm_func @FIRE_SUPPORT 5 store_actor_to BODYGUARD {[email protected]} store_coords_to [email protected] [email protected] [email protected] distance_searched 50.0 pass_handle [email protected] // after testing protect then get pass handle :FIRE_SUPPORTwait 005EF: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius [email protected] find_next 1 pass_deads 0//0AE1: [email protected] = find_all_random_chars_in_sphere [email protected] [email protected] [email protected] radius [email protected] find_next 1 skip_dead 0 //start active get actor handle around coords// 0AB1: call_scm_func @CHECK_ACTOR_HANDLE_RESULT 2 store_friend_actor; [email protected] store_any_actor; [email protected] 05F5: call_scm_func @IS_ACTOR_HANDLE_PASS 2 bodyguard_handle; [email protected] any_actor_handle; [email protected] then if 00E1: player 0 pressed_button 4 //by Action control //0AB0: key_pressed 0x46 //by 'F' Key //051A: actor ANY_RANDOM_PED damaged_by_actor $PLAYER_ACTOR //0457: player $PLAYER_CHAR aiming_at_actor ANY_RANDOM_PED //0457: player $PLAYER_CHAR aiming_at_actor [email protected] //attack at spcific actor by Aim at them then 01C9: actor [email protected] kill_actor [email protected] 0085: [email protected] = [email protected] // (int) gosub @CHECK_BREAK_TASK 022F: set_actor [email protected] stop_looking //VC-Untested //0647: AS_actor [email protected] clear_look_task //SA endend05F6: ret 0 [email protected]//0AB2: ret 1 [email protected]:IS_ACTOR_HANDLE_PASSif 056D: actor [email protected] defined //if ANY RANDOM ACTOR defined.then if 1 //803A: NOT $PLAYER_ACTOR == [email protected] //VC-Untested; Which either of 803A, 803B or 803C to check it's not PLAYER handle //803B: NOT $PLAYER_ACTOR == [email protected] 803C: NOT $PLAYER_ACTOR == [email protected] 803B: NOT [email protected] == [email protected] // make sure it's not your BODYGUARD handle thenelse [email protected] = -1 //clear actor handle by -1 [email protected] >= 1 //make sure we really get ANY RANDOM ACTOR05F6: ret 0//0AB2: ret 0:CHECK_BREAK_TASKwhile NOT Actor.Dead([email protected]) wait 0if 21 02CB: is_char_on_screen [email protected] 00F2: actor [email protected] near_actor [email protected] radius 50.0 {[email protected]} 50.0 {[email protected]} sphere 0 //Untested; jf breakendreturn If address :FIRE_SUPPORT is had work, i would like to ask another method from my part cleo //0AB1: call_scm_func @FIRE_AT_WILL 4 store_actor_to BODYGUARD {[email protected]} store_coords_to [email protected] [email protected] [email protected] store_pass_handle [email protected] distance_only 40.0 store_bool [email protected] // send reaper continous blind attack! If worst! please try the alternative method.But, You know how many opocodes VC i dig until deep hole... i never never test on VC. You can use search threat is to make your BODYGUARD set your who is ENEMY. I have sense it's have mehod ped relathionship SA.Search list GTA pedtype/threat on gtamodding to know more; 03F1: pedtype 4 add_threat 0011A: set_actor [email protected] search_threat 0 //untested01ED: clear_actor [email protected] threat_search0243: set_actor [email protected] ped_stats_to 16 Not sure, but You have problem with ped tie, i suggest to use normal one to make Bodyguard just follow you but you need add more command to ask him protect you: 01D1: actor follow_actor $PLAYER_ACTOR01D2: actor [email protected] follow_player $PLAYER_CHAR And, you can still make my code more wider, remember cus every code i write may not work i not coder VC.But unless you adapt for VC, then i'm sure would work, the mainly purpose is you know to use that. btw, the code Silent has give to you is also can you edit more too, Cus you can reverse position ACTOR handle.Example: you as player_actor handle that damaging at any ACTOR handle, then it posible with; IF player damaging any actor, BODYGUARD start Task Killing to any ACTOR that you attack. Really, I very avoid hardcore memory address since opocode easy to used. But the sneaky guy know that's Edited June 23, 2016 by X-Falcon Link to comment Share on other sites More sharing options...
Nova7GFU Posted June 23, 2016 Share Posted June 23, 2016 @X-Falcon Thanks. I'll try and then I will report. Link to comment Share on other sites More sharing options...
12jango Posted June 24, 2016 Author Share Posted June 24, 2016 @X-Falcon:Dude, I could compile your script but it crash the game. and what you mean by not Ok to not releasing everything? Is there any side effects for that? Link to comment Share on other sites More sharing options...
X-Falcon Posted June 24, 2016 Share Posted June 24, 2016 (edited) EDIT : CHECK again! script updated also check Wesser page. You don't wanna miss awesome one, isn't. cus Wesser had writing that's in form short entity ped search method and i only write point in part manipulate var from his 0AB1 knowledge. SCM functions (including TraversePoolEntities algorithms) Edited June 24, 2016 by X-Falcon 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