Irsis Posted August 12, 2019 Share Posted August 12, 2019 Hi everyone, is there a way to store ped's current task in variable? I have a mod, which make player can interact with pedestrian and replied by waving back(animation) at player. But after ped perform the animation, they stay in the place and dont do anything like they done before performing animation. I dont want to use 'ped walk into ped path' opcode because it will ruin his original task. (For example: his original task is to stay put, after performing animation they will walk away, ruin his original task) Is there a solution for this? Thank you @ZAZ @Strs Link to comment Share on other sites More sharing options...
thalilmythos Posted August 13, 2019 Share Posted August 13, 2019 disembark istantly actor could work. Irsis 1 Link to comment Share on other sites More sharing options...
ZAZ Posted August 13, 2019 Share Posted August 13, 2019 post your script CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Irsis Posted August 14, 2019 Author Share Posted August 14, 2019 (edited) On Tue Aug 13 2019 at 9:18 AM, thalilmythos said: disembark istantly actor could work. 23 hours ago, ZAZ said: post your script Im sorry my bad. Turns out random ped didnt lose original task even after performing animation coded by external script. New question. Can we store actor/car/object into cleo global variable? For example: - 1st script If Actor [email protected] defined Jf blabla 0AB3: var 100 = [email protected] - 2nd script If Actor [email protected] defined Jf blabla 0AB4: [email protected] = var 100 If Not [email protected] == [email protected] Jf blabla Im trying to avoid catching the same random ped catched by another script. Edited August 14, 2019 by Irsis Link to comment Share on other sites More sharing options...
ZAZ Posted August 14, 2019 Share Posted August 14, 2019 (edited) Test the script below to see how to detect all peds around red smoke above actor indicates each catched actor {$CLEO .cs} :RandomActor thread 'RANDACT' :RDACT_11 wait 0 if 0256: player $PLAYER_CHAR defined jf @RDACT_11 gosub @RDACT_Loop wait 0 jump @RDACT_11 :RDACT_Loop 31@ = 0 27@ = 0 :RDACT_MainLoop 0085: 30@ = 31@ 29@ = 0 :RDACT_innerLoop if and 056D: actor 30@ defined 803C: not $PLAYER_ACTOR == 30@ jf @RDACT_Skip 04C4: create_coordinate 25@ 26@ 28@ from_actor 30@ offset 0.0 0.0 1.2 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 1.0 RGBA 1.0 0.0 0.0 1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 3.0 RGBA 1.0 0.0 0.0 1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 5.0 RGBA 1.0 0.0 0.0 1.0 size 0.5 last_factor 0.1//red 27@ += 1 jump @RDACT_continue :RDACT_Skip 30@ += 1 29@ += 1 29@ > 127 jf @RDACT_innerLoop :RDACT_continue 31@ += 256 if or 27@ > 24 31@ > 35584 jf @RDACT_MainLoop return then test this script, it use opcode 0AE1 to detect all peds around {$CLEO .cs} :RandomActor_Cleo4_OPCODE_0AE1 thread 'RANDACT' wait 5000 while true wait 0 if 0256: player $PLAYER_CHAR defined then gosub @restore gosub @RandomActor_sub wait 1000 end end :restore for 27@ = 0 to 20 step 1 0@(27@,32i) = -1 end 27@ = 0 0@(23@,32i) = 0 return :RandomActor_sub for 27@ = 0 to 20 00A0: store_actor $PLAYER_ACTOR position_to 29@ 30@ 31@ if 0AE1: 0@(27@,32i) = random_actor_near_point 29@ 30@ 31@ in_radius 50.0 find_next 1 pass_deads 1 then 04C4: create_coordinate 25@ 26@ 28@ from_actor 0@(27@,32i) offset 0.0 0.0 1.2 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 1.0 RGBA 1.0 0.0 0.0 1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 3.0 RGBA 1.0 0.0 0.0 1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at 25@ 26@ 28@ velocity 0.0 0.0 5.0 RGBA 1.0 0.0 0.0 1.0 size 0.5 last_factor 0.1//red end end return Edited August 14, 2019 by ZAZ Irsis 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Another GTA Fan Posted August 14, 2019 Share Posted August 14, 2019 um... couldn't you just remove references to the ped after you've interacted with them using that mod? When you remove references to an actor, it basically turns them into a pedestrian so they should return back to walking around and doing what pedestrains do. You said you've got a mod that lets you interact with peds, but after they've performed the animation, they just stand still, right? Just remove their references afterwards, unless I'm missing the point here? Link to comment Share on other sites More sharing options...
Irsis Posted August 14, 2019 Author Share Posted August 14, 2019 @ZAZ Both script still catching the same ped? And about my earlier question, can i store actor into cleo global variable? If i cant, how can i store them and retrieve them in another script so i can check if they are the same ped or not? Thank you 1 hour ago, Recommended said: um... couldn't you just remove references to the ped after you've interacted with them using that mod? When you remove references to an actor, it basically turns them into a pedestrian so they should return back to walking around and doing what pedestrains do. You said you've got a mod that lets you interact with peds, but after they've performed the animation, they just stand still, right? Just remove their references afterwards, unless I'm missing the point here? What if ped's job is standing(security ped for example) and after interacted them then use remove reference, they will just walk away. They lost their original task, which is to stay put. Beside, I'll never use remove reference after using 0AE1. it will screw your other script that also meddling with random peds. Link to comment Share on other sites More sharing options...
Another GTA Fan Posted August 15, 2019 Share Posted August 15, 2019 oh I see now. In that case, this will work: 0687: clear_actor [email protected] task I also use a mod that allows me to talk to any ped, so I have this code clear up the animations when no longer being used. It works totally fine for me, and the ped/actor's return back to whatever they're doing, including if they run from a script where they act like guards, etc. This shouldn't break their script. Link to comment Share on other sites More sharing options...
Irsis Posted August 15, 2019 Author Share Posted August 15, 2019 39 minutes ago, Recommended said: oh I see now. In that case, this will work: 0687: clear_actor [email protected] task I also use a mod that allows me to talk to any ped, so I have this code clear up the animations when no longer being used. It works totally fine for me, and the ped/actor's return back to whatever they're doing, including if they run from a script where they act like guards, etc. This shouldn't break their script. Its okay. like my earlier post, turns out random ped wont lose their task even after performing animation. so 'disembark instantly' and 'clear actor task' isnt necessary. but thanks for your help Link to comment Share on other sites More sharing options...
thalilmythos Posted August 15, 2019 Share Posted August 15, 2019 (edited) You could make the actor do the animation with the first script, and catch him doing the animation in the second script. It would work like this Script one: Actor [email protected] perform animation Script 2: store player position Get random actor [email protected] at player's position. (i believe Junior explained to you how to do this somwhere around the forums) If actor [email protected] performing animation :stillperforming if not actor [email protected] performing animation jf @still performing This is where you say the actor stand still right? Well, make him do whatever it's going to do, Edited August 15, 2019 by thalilmythos Link to comment Share on other sites More sharing options...
Irsis Posted August 15, 2019 Author Share Posted August 15, 2019 44 minutes ago, thalilmythos said: You could make the actor do the animation with the first script, and catch him doing the animation in the second script. It would work like this Script one: Actor [email protected] perform animation Script 2: store player position Get random actor [email protected] at player's position. (i believe Junior explained to you how to do this somwhere around the forums) If actor [email protected] performing animation :stillperforming if not actor [email protected] performing animation jf @still performing This is where you say the actor stand still right? Well, make him do whatever it's going to do, Problem about ped stand still, actor task, etc. Is pretty much solved. The new problem is about the possibility of storing actor into var and retrieve it in another script, so i wont catching the same ped. About your example, what if ped didnt do particular animation? Scenario: - Script 1 [email protected] Catch random actor If Actor [email protected] defined Jf - Script 2 [email protected] catch random actor If Actor [email protected] defined Jf --> how to check if actor [email protected] from script 2 is different from Script 1? Using cleo global var? Link to comment Share on other sites More sharing options...
In45do Posted August 15, 2019 Share Posted August 15, 2019 Let say you have these two separate script file: Script_Example_One.cs [...] 009A: [email protected] = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0 0AB3: var 100 = [email protected] [...] Script_Example_Two.cs [...] 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 10.0 find_next 1 pass_deads 1 if 056D: actor [email protected] defined jf @Somewhere_Around_This_Script 0AB4: [email protected] = var 100 if 003B: [email protected] == [email protected] // (int) check if this script catch the same actor from the first script (notice var is 100) jf @Somewhere_Around_This_Script [you finally catch the same actor] [now do something in this part] I hope this helps. Irsis 1 Link to comment Share on other sites More sharing options...
Irsis Posted August 15, 2019 Author Share Posted August 15, 2019 1 hour ago, In45do said: Let say you have these two separate script file: Script_Example_One.cs [...] 009A: [email protected] = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0 0AB3: var 100 = [email protected] [...] Script_Example_Two.cs [...] 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 10.0 find_next 1 pass_deads 1 if 056D: actor [email protected] defined jf @Somewhere_Around_This_Script 0AB4: [email protected] = var 100 if 003B: [email protected] == [email protected] // (int) check if this script catch the same actor from the first script (notice var is 100) jf @Somewhere_Around_This_Script [you finally catch the same actor] [now do something in this part] I hope this helps. So its possible to store actor/object/vehicle into cleo global var? Not just float/Integer value? Thanks In45do 1 Link to comment Share on other sites More sharing options...
Strs Posted August 24, 2019 Share Posted August 24, 2019 topic was (SA) Store pedestrian's current task? i was about to help but looks like you got what you looking for by reading title (SA) Store pedestrian's current task?i thought you need script to store task of ped what he was doing example if he was attacking some one or doing anything if he dies and you can restore that task and paste to any ped so new ped do same thing as ped who dies or you can copy task and paste to all peds so all peds do same thing Link to comment Share on other sites More sharing options...