Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
Jottha

[SA] Help recruiting specific CivMale or CivFemale ped types

Recommended Posts

Jottha

Hi there fellas,

 

I'm getting wrecked trying to make a little mod that allows CJ to recruit specific pedestrian models, in this case, CivMale or CivFemale ped type actors, that I've placed in the game.

CJ should be able to recruit this peds just like he does with normal gang members, aiming at them and pressing recruit key.

The peds should act like a gang2 member even if they don't belong to the player's group, meaning they respect the player and gang2 members, and hate the other gang members.

The gang2 should respect those peds like gang2 members as well, meaning they don't kill themselves in a friendly fire situation for example.

At last, if CJ gets busted or dies, the group should end, destroying the peds and making them respawn in the same location they were created, to begin all over again.

 

When I tried to create the peds using gang2 as ped type, the gang2 members disappeared from the areas they usually belongs to, just those driving vehicles remained.

I think it's because the peds are created in a non-gang2 area, Las Colinas. The only way I found to solve this was set them to CivMale and CivFemale ped types.

 

Another thing that I noticed: when I start a new game the peds don't appear in the right location (coords).

 

Here's my noob code, I hope anyone can help me with this. Many thanks and Merry Christmas to ALL!

{$CLEO .cs}// Tópico:MODELthread "MODEL"// Load models0247: load_model #FAM10247: load_model #mina1  0247: load_model #FAM3   0247: load_model #mina2     0247: load_model #ak47    0247: load_model #DESERT_EAGLE0247: load_model #MICRO_UZI038B: load_requested_models:MODEL_LOAD00D6: if or8248:   not model #FAM1 available 8248:   not model #mina1 available8248:   not model #FAM3 available8248:   not model #mina2 available  8248:   not model #ak47 available8248:   not model #DESERT_EAGLE available8248:   not model #MICRO_UZI available004D: jump_if_false @MODEL_SPAWN 0001: wait 0 ms 0002: jump @MODEL_LOAD :MODEL_SPAWN07AF: [email protected] = player $PLAYER_CHAR group 0630: put_actor $PLAYER_ACTOR in_group [email protected] [email protected] = Actor.Create(CivMale, #FAM1, 2143.4961, -986.8321, 61.0115)Actor.Angle([email protected]) = 197.8533actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 300631: put_actor [email protected] in_group [email protected]: set_actor [email protected] acquaintance 1 to_actors_pedtype 8 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 7 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 9 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 10 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 11 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 12 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 13 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 14 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 17 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 20 // see ped.dat                           [email protected] = Actor.Create(CivFemale, #mina1, 2141.127, -986.0018, 60.5824)Actor.Angle([email protected]) = 131.1361actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 24 ammo 10000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 240631: put_actor [email protected] in_group [email protected]: set_actor [email protected] acquaintance 1 to_actors_pedtype 8 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 7 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 9 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 10 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 11 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 12 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 13 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 14 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 17 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 20 // see ped.dat [email protected] = Actor.Create(CivMale, #FAM3, 2135.2534, -1009.4327, 66.2344)Actor.Angle([email protected]) = 332.9246actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 300631: put_actor [email protected] in_group [email protected]: set_actor [email protected] acquaintance 1 to_actors_pedtype 8 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 7 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 9 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 10 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 11 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 12 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 13 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 14 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 17 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 20 // see ped.dat [email protected] = Actor.Create(CivFemale, #mina2, 2147.3555, -991.6095, 62.0219)Actor.Angle([email protected]) = 149.8156actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 28 ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 28081A: set_actor [email protected] weapon_skill_to 20631: put_actor [email protected] in_group [email protected]: set_actor [email protected] acquaintance 1 to_actors_pedtype 8 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 7 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 9 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 10 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 11 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 12 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 13 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 14 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 17 // see ped.dat 077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 20 // see ped.dat //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #mina10249: release_model #FAM30249: release_model #mina20249: release_model #ak470249: release_model #DESERT_EAGLE0249: release_model #MICRO_UZI01EB: set_traffic_density_multiplier_to 1.0 03DE: set_pedestrians_density_multiplier_to 1.0 03C7: set_sensitivity_to_crime 1.0jump @MODEL_LOOP if orwasted_or_busted    Actor.Dead([email protected] [email protected] [email protected] [email protected])jf @MODEL_LOOP 06C9: remove_actor [email protected] [email protected] [email protected] [email protected] from_group Actor.RemoveReferences([email protected] [email protected] [email protected] [email protected])Actor.DestroyInstantly([email protected] [email protected] [email protected] [email protected]):MODEL_LOOPPlayer.CanMove($PLAYER_CHAR) = TrueActor.SetImmunities([email protected] [email protected] [email protected] [email protected], 0, 0, 0, 0, 0)Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)    0A93: end_custom_thread                          
Edited by Jottha

Share this post


Link to post
Share on other sites
Gramps

Have moved your thread to the Coding section.

Share this post


Link to post
Share on other sites
OrionSR

I can't help you with the recruitment, but just so you know, any changes you make to the acquaintances of any of the ped types will be saved. You may want to consider strategies for putting things back the way they were.

Share this post


Link to post
Share on other sites
Silent

He's setting them per-char rather than per-pedtype, won't that be safe?

Share this post


Link to post
Share on other sites
ZAZ

i think no ^, but i believe, that it won't work, to set acquaintance 4 to 10 different pedtypes

 

you should first make tests, if it works for one pedtype

077A: set_actor [email protected] acquaintance 1 to_actors_pedtype 8 // see ped.dat

077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 8 // see ped.dat

 

then expand and test if it works for two pedtypes and so on

 

furthermore does the script needs a default loop with condition to activate spawnment as well as a jump for repeating

also, wasted_or_busted don't work in cs files

Share this post


Link to post
Share on other sites
Jottha

@Silent, what do you mean I'm using per-char rather than ped-type? Is there another way to do this without using ped types?

 

@ZAZ, your mods inspire me, I'm glad you reply to my topic. I'm no programmer as you can see, but I think it's possible to use gang2 as ped type without messing with their original locations (grove street for example) when the peds spawn.

When I use gang 2 for this, gang2 members on foot disappear from their turfs, only those in vehicles remain. It's really frustrating when you try to do something apparently easy and doesn't work. Here's my script using 'gang2' as ped_type in a single ped, in this case, FAM1.

{$CLEO .cs}// Tópico:MODELthread "MODEL"            // Load models0247: load_model #FAM1     0247: load_model #AK47038B: load_requested_models:MODEL_LOAD00D6: if or8248:   not model #FAM1 available  8248:   not model #AK47 available004D: jump_if_false @MODEL_SPAWN 0001: wait 0 ms 0002: jump @MODEL_LOAD :[email protected] = Actor.Create(GANG2, #FAM1, 2147.3555, -991.6095, 62.0219)Actor.Angle([email protected]) = 149.8156actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 30   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #AK4704ED: load_animation "RAPPING"  // FAM1repeatwait 0until 04EE:   animation "RAPPING" loaded 0605: actor [email protected] perform_animation_sequence "RAP_A_Loop" IFP_file "RAPPING" 10.0 loop 1 0 0 0 time -1 04EF: release_animation "RAPPING"0A93: end_custom_thread                          

Thank you all for helping me!

Share this post


Link to post
Share on other sites
OrionSR

He's setting them per-char rather than per-pedtype, won't that be safe?

Yes, at least I think so. He's using 077A: set_actor and not 0746: set_acquaintance which adjusts saved information. I didn't check closely enough.

Share this post


Link to post
Share on other sites
Jottha

Well, I just realized this last script I posted is working, at least the gang2 ped type part.

I started a new game and killed some enemies to be able to recruit gang members, went to Las Colinas, recruited the ped (FAM1) as a gang member, got to grove street and the gang was there walking on the streets again.

Note: the ped does not spawn at the right location (coordinates) when a new game is started. Could it be because of CJ's starting position (Jefferson)?

Trying to dismiss the ped from the group does not work tough, the ped keeps following you and also his mark stays on the radar. For test purposes, I got killed right on the street behind CJ's house, and only then, the group ended and the ped radar mark removed. Back from the hospital to grove street I made a discover: the gang members disappeared again! :facedesk:

Back to the point I got wasted, the ped was not there. He was almost at the GYM's corner, same street. What does it means?

Now the craziest part, I recruited him again and boom! The gang is back on the streets walking! :blink:

And once more I could not end the group.

I never thought that such a little script would cause weird things like that. Maybe something is missing?

I'm still studying it.

Edited by Jottha

Share this post


Link to post
Share on other sites
ZAZ

At first you have to learn same basics.

You need to know how to make loops and use conditional checks.

You need to build your script in a structure that beginns with a "Basic_Stage_Loop" where nothing happens until a specified condition will be passed

then spawn the needed stuff (this is your current script)

then a loop after the spawn, a loop that checks if the action is finished, that checks if the actor is dead or/and other things

at last a cleanup block to recycle the stuff, in your case does it need to remove the reference of the actor handle as well to unload the animation

 

I try to show you what i mean in the script below and gave the Labels representative names

 

The "Basic_Stage_Loop" where nothing happens until a specified condition will be passed contains a condition to check if CJ is gone into the red marker (nearby the actor spawn)

 

00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius 3.0 3.0 3.0
the red marker (sphere) will be shown if the sphere parameter is set to 1: actor $PLAYER_ACTOR 1 (in-sphere)

the red marker (sphere) will NOT be shown if the sphere parameter is set to 0: actor $PLAYER_ACTOR 0 (in-sphere)

but the condition still works and can be passed if CJ goes to that point

 

{$CLEO .cs}:RecruitPedsthread 'RECRUIT':Basic_Stage_Loopwait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loopif00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius  3.0  3.0  3.0jf @Basic_Stage_Loop//////////////////////////////////////////////////////////////////////////// Load models0247: load_model #FAM1     0247: load_model #AK47038B: load_requested_models:MODEL_LOAD00D6: if or8248:   not model #FAM1 available  8248:   not model #AK47 available004D: jump_if_false @MODEL_SPAWN 0001: wait 0 ms 0002: jump @MODEL_LOAD :[email protected] = Actor.Create(GANG2, #FAM1, 2147.3555, -991.6095, 62.0219)Actor.Angle([email protected]) = 149.8156actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 30   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #AK4704ED: load_animation "RAPPING"  // FAM1repeatwait 0until 04EE:   animation "RAPPING" loaded 0605: actor [email protected] perform_animation_sequence "RAP_A_Loop" IFP_file "RAPPING" 10.0 loop 1 0 0 0 time -1 04EF: release_animation "RAPPING"//////////////////////////////////////////////////////////////////////////:Action_Loopwait  0if0256:   player $PLAYER_CHAR definedjf @Cleanupif  or0118:   actor [email protected] dead80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius  80.0  80.0  80.0jf @Action_Loop:Cleanup01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian04EF: release_animation "RAPPING"jump @Basic_Stage_Loop
Edited by ZAZ

Share this post


Link to post
Share on other sites
Jottha

ZAZ, your corrections are perfect! Everything seems to work just fine. I will try to add more gang members and change the red mark location and size.

Also, I realized that you cannot command the ped to hold/stop, if he's in your group, of course. Is there a way to do this?

Another question is: can I place different red marks to spawn different groups of peds using the same script file?

Merry Christmas and many thanks for this present! :santa:

Edited by Jottha

Share this post


Link to post
Share on other sites
ZAZ

Yes, you can do a lot, depending to your coding skills.
But it needs to differentiate the cases for using different methods
I wanna give some examples to expand the given script from previous post

Case 1:
The script should spawn another actor if CJ go into another spot
Basicly would the spawn be the same, just an actor that do an animation
but at another location and other models
So we can keep the most part of the script but with variable content
and submit the informations for the variables by passing the initial conditional check

{$CLEO .cs}:RecruitPedsthread 'RECRUIT':Basic_Stage_Loop_01wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop_01if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius  3.0  3.0  3.0jf @Basic_Stage_Loop_03// else jump to next block [email protected] = 2147.3555// X [email protected] = -991.6095// Y [email protected] = 62.0219// Z [email protected] = 149.8156// [email protected] = 105// Fam1 model [email protected] = 355//AK47 model [email protected] = 30// AK47 weapon [email protected] = 90//[email protected] = 2000//actor.healthjump @Load_models:Basic_Stage_Loop_03if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2151.0466 -1009.9727 62.72 radius  3.0  3.0  3.0jf @[email protected] = 2156.2114// X [email protected] = -1012.34// Y [email protected] = 63.1// Z [email protected] = 67.5// [email protected] = 120// TRIBOSS model [email protected] = 351// Combat Shotgun model [email protected] = 27// Combat Shotgun weapon [email protected] = 80//[email protected] = 1500//actor.healthjump @Load_models//////////////////////////////////////////////////////////////////////////:Load_models0247: load_model [email protected]     0247: load_model [email protected]: load_requested_models:MODEL_LOAD00D6: if or8248:   not model [email protected] available  8248:   not model [email protected] available004D: jump_if_false @MODEL_SPAWN 0001: wait 0 ms 0002: jump @MODEL_LOAD :[email protected] = Actor.Create(GANG2, [email protected], [email protected], [email protected], [email protected])Actor.Angle([email protected]) = [email protected]([email protected])= [email protected]([email protected]) = [email protected]: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon [email protected] ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to [email protected]   //Here you do what you want to do with the actor.0249: release_model [email protected]: release_model [email protected]: load_animation "RAPPING"  // FAM1repeatwait 0until 04EE:   animation "RAPPING" loaded 0605: actor [email protected] perform_animation_sequence "RAP_A_Loop" IFP_file "RAPPING" 10.0 loop 1 0 0 0 time -1 04EF: release_animation "RAPPING"//////////////////////////////////////////////////////////////////////////:Action_Loopwait  0if0256:   player $PLAYER_CHAR definedjf @Cleanupif  or0118:   actor [email protected] dead80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot [email protected] [email protected] [email protected] radius  80.0  80.0  80.080FF:  not actor [email protected]  0 (in-sphere)near_point_on_foot [email protected] [email protected] [email protected] radius  80.0  80.0  80.0jf @Action_Loop:Cleanup01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian04EF: release_animation "RAPPING"jump @Basic_Stage_Loop_01

Case 2:
One actor do animation, the other actor should kill CJ
This needs to make a switch in the middle of the script by using a variable

example for a case [email protected] = [email protected] == 0jf @next1<case 1>:[email protected] == 1jf @next2<case 2>
{$CLEO .cs}:RecruitPedsthread 'RECRUIT':Basic_Stage_Loop_01wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop_01if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius  3.0  3.0  3.0jf @Basic_Stage_Loop_03// else jump to next block [email protected] = 2147.3555// X [email protected] = -991.6095// Y [email protected] = 62.0219// Z [email protected] = 149.8156// [email protected] = 105// Fam1 model [email protected] = 355//AK47 model [email protected] = 30// AK47 weapon [email protected] = 90//[email protected] = 2000//act[email protected] = 8// pedtype [email protected] = 0// case switchjump @Load_models:Basic_Stage_Loop_03if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2151.0466 -1009.9727 62.72 radius  3.0  3.0  3.0jf @[email protected] = 2156.2114// X [email protected] = -1012.34// Y [email protected] = 63.1// Z [email protected] = 67.5// [email protected] = 120// TRIBOSS model [email protected] = 351// Combat Shotgun model [email protected] = 27// Combat Shotgun weapon [email protected] = 80//[email protected] = 1500//[email protected] = 24// ped type [email protected] = 1// case switchjump @Load_models//////////////////////////////////////////////////////////////////////////:Load_models0247: load_model [email protected]     0247: load_model [email protected]: load_requested_models:MODEL_LOAD00D6: if or8248:   not model [email protected] available  8248:   not model [email protected] available004D: jump_if_false @MODEL_SPAWN 0001: wait 0 ms 0002: jump @MODEL_LOAD :[email protected] = Actor.Create([email protected], [email protected], [email protected], [email protected], [email protected])Actor.Angle([email protected]) = [email protected]([email protected])= [email protected]([email protected]) = [email protected]: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon [email protected] ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to [email protected]   //Here you do what you want to do with the actor.0249: release_model [email protected]: release_model [email protected]: load_animation "RAPPING"  // FAM1repeatwait 0until 04EE:   animation "RAPPING" loaded [email protected] == 0// check for case switchjf @Action_Task_010605: actor [email protected] perform_animation_sequence "RAP_A_Loop" IFP_file "RAPPING" 10.0 loop 1 0 0 0 time -1 jump @Action_Task_03:Action_Task_0105E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:Action_Task_0304EF: release_animation "RAPPING"//////////////////////////////////////////////////////////////////////////:Action_Loopwait  0if0256:   player $PLAYER_CHAR definedjf @Cleanupif  or0118:   actor [email protected] dead80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot [email protected] [email protected] [email protected] radius  80.0  80.0  80.080FF:  not actor [email protected]  0 (in-sphere)near_point_on_foot [email protected] [email protected] [email protected] radius  80.0  80.0  80.0jf @Action_Loop:Cleanup01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian04EF: release_animation "RAPPING"jump @Basic_Stage_Loop_01

Case 3:
Spawning total different stuff needs to support the stuff by making different script blocks

Script below spawns a car with 2 actors if CJ goes into second sphere

{$CLEO .cs}:RecruitPedsthread 'RECRUIT':Basic_Stage_Loop_01wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop_01if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius  3.0  3.0  3.0jf @Basic_Stage_Loop_03jump @Load_models_01:Basic_Stage_Loop_03if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2151.0466 -1009.9727 62.72 radius  3.0  3.0  3.0jf @Basic_Stage_Loop_01jump @Load_models_03//////////////////////////////////////////////////////////////////////////:Load_models_010247: load_model #FAM1     0247: load_model #AK47038B: load_requested_models:MODEL_LOAD_0100D6: if or8248:   not model #FAM1 available  8248:   not model #AK47 available004D: jump_if_false @MODEL_SPAWN_01 0001: wait 0 ms 0002: jump @MODEL_LOAD_01 :[email protected] = Actor.Create(GANG2, #FAM1, 2147.3555, -991.6095, 62.0219)Actor.Angle([email protected]) = 149.8156actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 30000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 30   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #AK4704ED: load_animation "RAPPING"  // FAM1repeatwait 0until 04EE:   animation "RAPPING" loaded 0605: actor [email protected] perform_animation_sequence "RAP_A_Loop" IFP_file "RAPPING" 10.0 loop 1 0 0 0 time -1 04EF: release_animation "RAPPING"jump @Action_Loop_01////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////:Load_models_030247: request_model #SLAMVAN0247: request_model #fam20247: request_model #MP5LNG0247: request_model #AK470247: request_model #SAWNOFF06E9: request_car_component #NTO_B_S023C: load_special_actor 'cesar' as 4:MODEL_LOAD_0300D6: if or823D:   NOT   special_actor  4 loaded8248:   NOT   model #MP5LNG available8248:   NOT   model #AK47 available8248:   NOT   model #SAWNOFF available8248:   NOT   model #fam2 available8248:   NOT   model #SLAMVAN available86EA:   NOT car_component_available #NTO_B_S004D: jump_if_false @MODEL_SPAWN_03 0001: wait 0 ms023C: load_special_actor 'cesar' as 40002: jump @MODEL_LOAD_03 :MODEL_SPAWN_0300A5: [email protected] = create_car #SLAMVAN at 2186.7671 -1006.3813 62.90175: set_car [email protected] z_angle_to 72.10229: set_car [email protected] color_to  1  106ED: set_car [email protected] paintjob  106E7: [email protected] = add_car_component #NTO_B_S to_car [email protected]: [email protected] = create_actor  8 #SPECIAL04 in_car [email protected] driverseat01C8: [email protected] = create_actor  8 #fam2 in_car [email protected] passenger_seat  001B2: give_actor [email protected] weapon  30 ammo  99999 // Load the weapon model before using this01B2: give_actor [email protected] weapon  29 ammo  99999 // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  10002E2: set_actor [email protected] weapon_accuracy_to  1000223: set_actor [email protected] health_to  30000223: set_actor [email protected] health_to  10000001: wait  1000 ms04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset  0.0  0.0  1.000A7: car [email protected] drive_to [email protected] [email protected] [email protected]: set_car [email protected] max_speed_to 35.000AF: set_car [email protected] driver_behaviour_to  100AE: unknown_set_car [email protected] to_ignore_traffic_lights  [email protected] = 0jump @Action_Loop_03//////////////////////////////////////////////////////////////////////////:Action_Loop_01wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup_01if  or0118:   actor [email protected] dead80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2147.3 -995.6 62.02 radius  80.0  80.0  80.0jf @Action_Loop_01jump @Cleanup_01//////////////////////////////////////////////////////////////////////////:Action_Loop_03wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup_03if  and8119:   NOT   car [email protected] wrecked81F4:   NOT   car [email protected] flipped00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2151.0466 -1009.9727 62.72 radius  20.0  20.0  20.0jf @Cleanup_0304C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset  0.0  0.0  1.000A7: car [email protected] drive_to [email protected] [email protected] [email protected]:   actor $PLAYER_ACTOR near_car [email protected] radius  10.0  10.0 sphere  0jf @Action_Loop_0400AD: set_car [email protected] max_speed_to  0.00001: wait  0 ms0633: AS_actor [email protected] exit_vehicle0633: AS_actor [email protected] exit_vehiclejump @Cleanup_03:[email protected] > 10000jf @Action_Loop_03020B: explode_car [email protected] @Cleanup_03//////////////////////////////////////////////////////////////////////////:Cleanup_0101C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian04EF: release_animation "RAPPING"jump @Basic_Stage_Loop_01//////////////////////////////////////////////////////////////////////////:Cleanup_030249: release_model #SLAMVAN0249: release_model #AK470249: release_model #fam20249: release_model #SAWNOFF0249: release_model #MP5LNG06EB: release_car_component #NTO_B_S0296: unload_special_actor  401C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C3: remove_references_to_car [email protected] @Basic_Stage_Loop_03

After you studied and tested the scripts you'll notice that always only one case is possible, initialisation either from first or from second sphere.

It's also possible to let start the first case while it's still possible start also the second case and have then both cases running at same time.

But this will be very complicate and i think that you understand that it needs advanced coding skills.

Edited by ZAZ

Share this post


Link to post
Share on other sites
Jottha

Man, the last script you wrote was amazing! I have no words to describe!

I will try the other two later.

I was trying to write a script for the second gang member as he smokes a "cigar". Easy breeze this part.

The problem now is to add the "EXHALE" effect to him. I need it to loop as the animation "SMKCIG_PRTL" runs, and end when it stops, handling him a weapon.

The attempts I made was hilarious, with he smoking the weapon like a cigar, or blowing infinity smoke. :miranda:

I guess I'm beginning to understand a very little bit of scripting.

Here's my last attempt, if you have time please try to find what I did wrong.

Many thanks for all your help, ZAZ!

{$CLEO .cs}:RecruitPeds2thread 'RECRUIT2':Basic_Stage_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop2if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  1.0  1.0  1.0jf @Basic_Stage_Loop2//////////////////////////////////////////////////////////////////////////// Load models0247: load_model #FAM10247: load_model #FAM6   0247: load_model #AK470247: load_model #MP5LNG038B: load_requested_models:MODEL_LOAD200D6: if or8248:   not model #FAM1 available 8248:   not model #FAM6 available8248:   not model #AK47 available8248:   not model #MP5LNG available004D: jump_if_false @MODEL_SPAWN2 0001: wait 0 ms 0002: jump @MODEL_LOAD2 :[email protected] = Actor.Create(gang2, #FAM1, 2141.1428, -986.0502, 60.5906)Actor.Angle([email protected]) = 143.9829actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 201B9: set_actor [email protected] armed_weapon_to 300446: set_actor [email protected] immune_to_headshots [email protected] = Actor.Create(gang2, #FAM6, 2147.7366, -988.5807, 62.3792)Actor.Angle([email protected]) = 159.8052actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 29 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 2//01B9: set_actor [email protected] armed_weapon_to 0      0446: set_actor [email protected] immune_to_headshots 00291: set_actor [email protected] attack_when_provoked 1   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #FAM60249: release_model #AK47     0249: release_model #MP5LNG04ED: load_animation "COP_AMBIENT" // FAM104ED: load_animation "GANGS" repeatwait 0until 04EE:   animation "COP_AMBIENT" loaded repeatwait 0until 04EE:   animation "GANGS" loaded 0605: actor [email protected] perform_animation_sequence "Copbrowse_loop" IFP_file "COP_AMBIENT" 10.0 loop 1 0 0 0 time -1 [email protected] = Object.Init(3044, 0.0, 0.0, 0.0)//0470: [email protected] = actor [email protected] current_weapon 070A: AS_actor [email protected] attach_to_object [email protected] offset 0.04 0.1 0.05 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time -10605: actor [email protected] perform_animation "SMKCIG_PRTL" IFP "GANGS" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 0669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064C: make_particle [email protected] visible :EXALAR           //EXHALE STARTwait 0if 0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"//0470: [email protected] = actor [email protected] current_weapon jump @SOLTARFUMACAifnot Object.Destroy([email protected])jf @FIMFUMACA:SOLTARFUMACA         //BLOW SMOKE PARTwait 40000669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064C: make_particle [email protected] visiblejump @EXALAR:FIMFUMACA        //STOP BLOWING SMOKE AND ARM THE GUY0650: destroy_particle [email protected]: set_actor [email protected] armed_weapon_to 29   04EF: release_animation "COP_AMBIENT"04EF: release_animation "GANGS" //////////////////////////////////////////////////////////////////////////:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  or0118:   actor [email protected] [email protected] dead80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.0jf @Action_Loop2:Cleanup201C2: remove_references_to_actor [email protected] [email protected]// Like turning an actor into a random pedestrian04EF: release_animation "COP_AMBIENT"04EF: release_animation "GANGS" jump @Basic_Stage_Loop2
Edited by Jottha

Share this post


Link to post
Share on other sites
Jottha

I fixed the Exhale part, now it's working like I wanted.

Here's my correction, is it acceptable?

:EXALAR           //EXHALE STARTwait 0  if8611: actor [email protected] performing_animation "SMKCIG_PRTL"jf @SOLTARFUMACAifnot Object.Destroy([email protected]) jf @FIMFUMACA:SOLTARFUMACA         //BLOW SMOKE PARTwait 70000669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064C: make_particle [email protected] visiblejump @EXALAR:FIMFUMACA        //STOP BLOWING SMOKE AND ARM THE GUY 04EF: remove_animation "SMKCIG_PRTL"064E: stop_fx_system [email protected]: destroy_particle [email protected]: set_actor [email protected] armed_weapon_to 29

My next step is the gang members following paths/routes.

:lol:

Edited by Jottha

Share this post


Link to post
Share on other sites
ZAZ

oh, that's nice

if  or0118:   actor [email protected] [email protected] dead

this also

01C2: remove_references_to_actor [email protected] [email protected]

sannybuilder may never compile such mistakes


I fixed the Exhale part, now it's working like I wanted.
Here's my correction, is it acceptable?

:EXALAR           //EXHALE STARTwait 0  if8611: actor [email protected] performing_animation "SMKCIG_PRTL"jf @SOLTARFUMACAifnot Object.Destroy([email protected]) jf @FIMFUMACA:SOLTARFUMACA         //BLOW SMOKE PARTwait 70000669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064C: make_particle [email protected] visiblejump @EXALAR:FIMFUMACA        //STOP BLOWING SMOKE AND ARM THE GUY 04EF: remove_animation "SMKCIG_PRTL"064E: stop_fx_system [email protected]: destroy_particle [email protected]: set_actor [email protected] armed_weapon_to 29
My next step is the gang members following paths/routes.
:lol:

 

no,
Object.Destroy([email protected]) removes an object from game, this code can't be used as condition

ifnot Object.Destroy([email protected])jf @FIMFUMACA

long wait times like wait 7000 is n00bish
let the code run in a loop while it checks the neccesary facts, e.g. if player $PLAYER_CHAR defined or if actor [email protected] is dead

there're nice methods to get time lapses

the variables [email protected] and [email protected] are reserved for using in time checks
the containing values are permanently counting ascending in milliseconds
[email protected] and [email protected] can't be used for anything else or game can crash
They are allways integer values
We can restore the counting by setting the variable to zero

@33 = 0

After this is it permanently counting again ascending from the specified value
Then it is possible to check if a specified time is passed

if
[email protected] > 5000
else_jump @back

test this script:

{$CLEO .cs}thread "TIME":Timecheck_2wait 0 ms03F0: enable_text_draw 1045A: text_draw_1number  250.0  50.0 'NUMBER' [email protected]@ > 5000jf @[email protected] = 0jump @Timecheck_2

another way that makes the most sense in your case is the check for the animation time

if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @Action_Loop20613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" timeif [email protected] > 0.50.55 > [email protected] @Action_Loop3

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

 

then you should read something about particles effects: click

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

 

i would it write in this way

{$CLEO .cs}:RecruitPeds2thread 'RECRUT2':Basic_Stage_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop2if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  1.0  1.0  1.0jf @Basic_Stage_Loop2//////////////////////////////////////////////////////////////////////////// Load models0247: load_model #FAM10247: load_model #FAM3   0247: load_model #AK470247: load_model #MP5LNG038B: load_requested_models:MODEL_LOAD200D6: if or8248:   not model #FAM1 available 8248:   not model #FAM3 available8248:   not model #AK47 available8248:   not model #MP5LNG available004D: jump_if_false @MODEL_SPAWN2 0001: wait 0 ms 0002: jump @MODEL_LOAD2 :[email protected] = Actor.Create(gang2, #FAM1, 2141.1428, -986.0502, 60.5906)Actor.Angle([email protected]) = 143.9829actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 201B9: set_actor [email protected] armed_weapon_to 300446: set_actor [email protected] immune_to_headshots [email protected] = Actor.Create(gang2, #FAM3, 2147.7366, -988.5807, 62.3792)//Actor.Angle([email protected]) = 159.8052Actor.Angle([email protected]) = 339.9actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 29 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 2//01B9: set_actor [email protected] armed_weapon_to 0      0446: set_actor [email protected] immune_to_headshots 00291: set_actor [email protected] attack_when_provoked 1   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #FAM30249: release_model #AK47     0249: release_model #MP5LNG04ED: load_animation "COP_AMBIENT" // FAM104ED: load_animation "GANGS" repeatwait 0until 04EE:   animation "COP_AMBIENT" loaded repeatwait 0until 04EE:   animation "GANGS" loaded 0605: actor [email protected] perform_animation_sequence "Copbrowse_loop" IFP_file "COP_AMBIENT" 10.0 loop 1 0 0 0 time -1 [email protected] = Object.Init(3044, 0.0, 0.0, 0.0)//0470: [email protected] = actor [email protected] current_weapon 070A: AS_actor [email protected] attach_to_object [email protected] offset 0.04 0.1 0.05 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time -10605: actor [email protected] perform_animation "SMKCIG_PRTL" IFP "GANGS" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 0669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected] //////////////////////////////////////////////////////////////////////////:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118: not  actor [email protected] dead8118: not  actor [email protected] dead00FF: actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.000FF: actor [email protected]  0 (in-sphere)near_point_on_foot 2141.1428 -986.0502 60.59 radius  10.0  10.0  10.000FF: actor [email protected]  0 (in-sphere)near_point_on_foot 2147.7366 -988.5807 62.37 radius  10.0  10.0  10.0jf @Cleanup2if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @Action_Loop20613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" timeif [email protected] > 0.50.55 > [email protected] @Action_Loop3if3 > [email protected] @Action_Loop20669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected]@ += 1jump @Action_Loop2:[email protected] = 0jump @Action_Loop2:Cleanup2Object.Destroy([email protected])01C2: remove_references_to_actor [email protected]// Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected]: release_animation "COP_AMBIENT"04EF: release_animation "GANGS" jump @Basic_Stage_Loop2

Share this post


Link to post
Share on other sites
Jottha

 

oh, that's nice

if or0118: actor [email protected] [email protected] dead

this also

01C2: remove_references_to_actor [email protected] [email protected]

sannybuilder may never compile such mistakes

 

I see, so you have to use one opcode per actor, like:

if or0118: actor [email protected] dead0118: actor [email protected] dead

and

01C2: remove_references_to_actor [email protected]: remove_references_to_actor [email protected]

correct?

 

 

long wait times like wait 7000 is n00bish

let the code run in a loop while it checks the neccesary facts, e.g. if player $PLAYER_CHAR defined or if actor [email protected] is dead

there're nice methods to get time lapses

the variables [email protected] and [email protected] are reserved for using in time checks
the containing values are permanently counting ascending in milliseconds
[email protected] and [email protected] can't be used for anything else or game can crash
They are allways integer values
We can restore the counting by setting the variable to zero

@33 = 0

After this is it permanently counting again ascending from the specified value
Then it is possible to check if a specified time is passed

if
[email protected] > 5000
else_jump @back

test this script:

{$CLEO .cs}thread "TIME":Timecheck_2wait 0 ms03F0: enable_text_draw 1045A: text_draw_1number  250.0  50.0 'NUMBER' [email protected]@ > 5000jf @[email protected] = 0jump @Timecheck_2

another way that makes the most sense in your case is the check for the animation time

if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @Action_Loop20613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" timeif [email protected] > 0.50.55 > [email protected] @Action_Loop3

 

Ok, [email protected] and [email protected] for timing things.

Opcode 0613 for controlling time of an actor animation. Much easier!

 

I really need to learn the basics of coding, I will find some free time to do it.

Great tutorial about particle effects, I will study that too.

 

My game crashed for some reason that I could not repair so I'm reinstalling it.

I had some other cleo mods and stuff there, don't know which of them caused the crash so I'm gonna let the game original as possible.

Thanks again for all the shared knowledge ZAZ!

Edited by Jottha

Share this post


Link to post
Share on other sites
Jottha
Ok, I fixed my game. Was the main.scm that had 5 kb size, I just replaced it with the one in my backup.

Here's a little demonstration of what I've being doing, modifying Las Colinas and trying to add specific gang members:


295raex.jpg


ZAZ, you're da man!

Edited by Jottha

Share this post


Link to post
Share on other sites
ZAZ

nice screenie, you're on good way ;)

Share this post


Link to post
Share on other sites
Jottha

Thx ZAZ. I gotta a little problem when I go inside any car near the members. I have a car parked in the location they spawn, when I get inside of it, the script clears their references and they walk away.

I would like it to clear their references only if I go far from the location they spawn. I tried to increase the opcode 00FF radius, tried to change (in-sphere)near_point_on_foot to (in-sphere)near_point_in_car, tried to use both on_foot and in_car together, tried also to use opcode 00F7, no success. Is it that hard to do?

 

I was also creating a little path to each member to follow until they reach their animation loop spot. I did it with those two girls you see on the screenshot. The girl using Denise model, spawns behind the house you see, and walk to the animation spot. I thought would be nicer than they appearing from nowhere. The other girl spaws behind the other house and do the same thing. First I tried the animation path codes, here's what I did:

0754: define_new_animation_path 0755: add_animation_path_3D_coord 2135.9907 -979.444 59.7895 animation "NONE" IFP_file "NONE"0755: add_animation_path_3D_coord 2136.5801 -983.8848 60.4427 animation "NONE" IFP_file "NONE"0755: add_animation_path_3D_coord 2142.9468 -984.5752 60.7774 animation "NONE" IFP_file "NONE" 0817: assign_actor [email protected] to_animation_path_with_walk_mode 4 route_mode 00754: flush_patrol_route

But I wanted the actor to loop an animation when the path ends, so after the opcode 0754, I added the code 0804:

0804: AS_actor [email protected] walk_to 2142.9468 -984.5752 60.7774 angle 283.145 radius 0.2 animation "RAP_A_Loop" IFP_file "RAPPING" 10.0 LA 1 LX 0 LY 0 LF 0 LT -1

The result was the actor going straight for last the location, instead of following the path before doing so.

 

Then I realized the opcode 0804 can do all that. Well, works at least. Here's what i did:

0804: AS_actor [email protected] walk_to 2136.582 -983.6541 60.5244 angle 223.5618 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2142.9468 -984.5752 60.7774 angle 283.145 radius 0.2 animation "RAP_A_Loop" IFP_file "RAPPING" 10.0 LA 1 LX 0 LY 0 LF 0 LT -1

Is that correct? Is there a better way to do it?

 

Opcodes are pure magic! :D

Edited by Jottha

Share this post


Link to post
Share on other sites
Jottha

Ok ZAZ, I corrected the problem of clearing the references when going inside a vehicle.

Also, added a way to go far away from the gang members without clearing their references either, making it go back to the basic stage loop.

Now I can spawn more of them if I want to. :lol:

Here's the full code, tell me if it's ok:

{$CLEO .cs}:RecruitPedsthread 'RECRUIT':Basic_Stage_Loopwait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loopif00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2143.7 -983.8954 60.9297 radius  1.0  1.0  1.0jf @Basic_Stage_Loop//////////////////////////////////////////////////////////////////////////// Load models0247: load_model #MINA1     0247: load_model #DESERT_EAGLE   0247: load_model #MINA2     0247: load_model #MICRO_UZI038B: load_requested_models:MODEL_LOAD00D6: if or8248:   not model #MINA1 available  8248:   not model #DESERT_EAGLE available    8248:   not model #MINA2 available  8248:   not model #MICRO_UZI available004D: jump_if_false @MODEL_SPAWN 0001: wait 0 ms 0002: jump @MODEL_LOAD :[email protected] = Actor.Create(GANG2, #MINA1, 2158.1418, -986.1246, 62.9218)Actor.Angle([email protected]) = 134.1654 actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 24 ammo 1000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 24  081A: set_actor [email protected] weapon_skill_to 2  0446: set_actor [email protected] immune_to_headshots 00291: set_actor [email protected] attack_when_provoked 1 [email protected] = Actor.Create(GANG2, #MINA2, 2136.0151, -980.0492, 59.9104)Actor.Angle([email protected]) = 194.287actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 28 ammo 3000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 28081A: set_actor [email protected] weapon_skill_to 20446: set_actor [email protected] immune_to_headshots 00291: set_actor [email protected] attack_when_provoked 1      //Here you do what you want to do with the actor.0249: release_model #MINA10249: release_model #DESERT_EAGLE0249: release_model #MINA20249: release_model #MICRO_UZI04ED: load_animation "RAPPING"  // FAM1repeatwait 0until 04EE:   animation "RAPPING" loaded 0804: AS_actor [email protected] walk_to 2156.6648 -988.1798 62.8493 angle 103.101 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2148.5569 -986.2345 62.8386 angle 78.8089 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2144.301 -983.5867 60.9297 angle 140.2427 radius 0.2 animation "RAP_C_Loop" IFP_file "RAPPING" 10.0 LA 1 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2136.582 -983.6541 60.5244 angle 223.5618 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2142.9468 -984.5752 60.7774 angle 283.145 radius 0.2 animation "RAP_A_Loop" IFP_file "RAPPING" 10.0 LA 1 LX 0 LY 0 LF 0 LT -104EF: release_animation "RAPPING"//////////////////////////////////////////////////////////////////////////:Action_Looprepeatwait 0until 00FF: not actor [email protected]  0 (in-sphere)near_point_on_foot 2144.301 -983.5867 60.9297 radius  10.0  10.0  10.0repeatwait 0until 00FF: not actor [email protected]  0 (in-sphere)near_point_on_foot 2142.9468 -984.5752 60.7774 radius  10.0  10.0  10.0repeatwait 0until 80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2143.7 -983.8954 60.9297 radius  10.0  10.0  10.0jf @Action_Loop_2:Action_Loop_2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanupif  and0118:   not actor $PLAYER_ACTOR dead0118:   not actor [email protected] dead0118:   not actor [email protected] dead jf @Basic_Stage_Loop:Cleanup01C2: remove_references_to_actor [email protected]// Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected]: release_animation "RAPPING"jump @Basic_Stage_Loop

Girls in action:

e7axk8.jpg

Edited by Jottha

Share this post


Link to post
Share on other sites
ZAZ

first 2 lines will be overwritten from 3. line

0804: AS_actor [email protected] walk_to 2156.6648 -988.1798 62.8493 angle 103.101 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2148.5569 -986.2345 62.8386 angle 78.8089 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2144.301 -983.5867 60.9297 angle 140.2427 radius 0.2 animation "RAP_C_Loop" IFP_file "RAPPING" 10.0 LA 1 LX 0 LY 0 LF 0 LT -1

only 3. command will be executed

 

I would like it to clear their references only if I go far from the location they spawn. I tried to increase the opcode 00FF radius, tried to change (in-sphere)near_point_on_foot to (in-sphere)near_point_in_car, tried to use both on_foot and in_car together, tried also to use opcode 00F7, no success. Is it that hard to do?

you got confuse and made wrong jump notes, look ...

...my template:

:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118: not  actor [email protected] dead8118: not  actor [email protected] dead00FF: actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.000FF: actor [email protected]  0 (in-sphere)near_point_on_foot 2141.1428 -986.0502 60.59 radius  10.0  10.0  10.000FF: actor [email protected]  0 (in-sphere)near_point_on_foot 2147.7366 -988.5807 62.37 radius  10.0  10.0  10.0jf @Cleanup2 <<<<<<<<<<<<<<<<<<<<<<<<<-------code goes to cleanup if any condition is false|code goes to jump to "Loop adress" :Action_Loop2 if all conditions are true|Vjump @Action_Loop2

...your new script:

:Action_Loop_2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanupif  and0118:   not actor $PLAYER_ACTOR dead0118:   not actor [email protected] dead0118:   not actor [email protected] dead jf @Basic_Stage_Loop<<<<<<---code goes to script beginn if any condition is false|code goes to cleanup if all conditions are true|V:Cleanup

these doesn't make sense

Edited by ZAZ

Share this post


Link to post
Share on other sites
Jottha

 

 

first 2 lines will be overwritten from 3. line

0804: AS_actor [email protected] walk_to 2156.6648 -988.1798 62.8493 angle 103.101 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2148.5569 -986.2345 62.8386 angle 78.8089 radius 0.2 animation "none" IFP_file "none" 10.0 LA 0 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2144.301 -983.5867 60.9297 angle 140.2427 radius 0.2 animation "RAP_C_Loop" IFP_file "RAPPING" 10.0 LA 1 LX 0 LY 0 LF 0 LT -1

only 3. command will be executed

 

Yeah, you're right ZAZ. I think they were going correctly for the locations, because there's a car parked at the house's front yard, and the ped was avoiding it. lol
Is there a method to follow a path and then stop for loop animation? Will I have to use the [email protected] and [email protected] to create a time count for this? I'm asking it because increasing the 'wait' time, you can make the actor pass through the route paths and then go for animation loop using the opcode 0804.

 

 

 

 

I would like it to clear their references only if I go far from the location they spawn. I tried to increase the opcode 00FF radius, tried to change (in-sphere)near_point_on_foot to (in-sphere)near_point_in_car, tried to use both on_foot and in_car together, tried also to use opcode 00F7, no success. Is it that hard to do?

you got confuse and made wrong jump notes, look ...

...my template:

:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118: not  actor [email protected] dead8118: not  actor [email protected] dead00FF: actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.000FF: actor [email protected]  0 (in-sphere)near_point_on_foot 2141.1428 -986.0502 60.59 radius  10.0  10.0  10.000FF: actor [email protected]  0 (in-sphere)near_point_on_foot 2147.7366 -988.5807 62.37 radius  10.0  10.0  10.0jf @Cleanup2 <<<<<<<<<<<<<<<<<<<<<<<<<-------code goes to cleanup if any condition is false|code goes to jump to "Loop adress" :Action_Loop2 if all conditions are true|Vjump @Action_Loop2

...your new script:

:Action_Loop_2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanupif  and0118:   not actor $PLAYER_ACTOR dead0118:   not actor [email protected] dead0118:   not actor [email protected] dead jf @Basic_Stage_Loop<<<<<<---code goes to script beginn if any condition is false|code goes to cleanup if all conditions are true|V:Cleanup

these doesn't make sense

 

In this case I changed my mind. I wanted to be able to recruit the peds again (your script was clearing their references when I went in a vehicle) so I did this to start all over again. If CJ dies, only then, their references must be erased.
If CJ and the peds are a little far from the 'calling point', then the red mark should appear again and I can call 2 more peds:
:Action_Looprepeatwait 0until 00FF: not actor [email protected]  0 (in-sphere)near_point_on_foot 2144.301 -983.5867 60.9297 radius  10.0  10.0  10.0repeatwait 0until 00FF: not actor [email protected]  0 (in-sphere)near_point_on_foot 2142.9468 -984.5752 60.7774 radius  10.0  10.0  10.0repeatwait 0until 80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2143.7 -983.8954 60.9297 radius  10.0  10.0  10.0jf @Action_Loop_2

Does not matter if the peds die, I always have a couple more at anytime. I tried to explain what I did but I was too much excited by the result. lol

To do what I just described is the code correct?
Edited by Jottha

Share this post


Link to post
Share on other sites
Jottha

Can't place this on your code, the actor do not blow smoke:

0804: AS_actor [email protected] walk_to 2147.7366 -988.5807 62.3792 angle 159.8052 radius 0.2 animation "SMKCIG_PRTL" IFP_file "GANGS" 4.0 LA 1 LX 0 LY 0 LF 0 LT -1

I was adding paths for them as I did with the other two. If was hard to set the smoke on a stopped ped, should be much more for a walking one. Here's my code:

{$CLEO .cs}:RecruitPeds2thread 'RECRUT2':Basic_Stage_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop2if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  1.0  1.0  1.0jf @Basic_Stage_Loop2//////////////////////////////////////////////////////////////////////////// Load models0247: load_model #FAM10247: load_model #FAM6   0247: load_model #AK470247: load_model #MP5LNG038B: load_requested_models:MODEL_LOAD200D6: if or8248:   not model #FAM1 available 8248:   not model #FAM6 available8248:   not model #AK47 available8248:   not model #MP5LNG available004D: jump_if_false @MODEL_SPAWN2 0001: wait 0 ms 0002: jump @MODEL_LOAD2 :[email protected] = Actor.Create(gang2, #FAM1, 2136.0151, -980.0492, 59.9104)Actor.Angle([email protected]) = 194.287actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 201B9: set_actor [email protected] armed_weapon_to 300446: set_actor [email protected] immune_to_headshots [email protected] = Actor.Create(gang2, #FAM6, 2158.1418, -986.1246, 62.9218)Actor.Angle([email protected]) = 134.1654actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 29 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 2//01B9: set_actor [email protected] armed_weapon_to 0      0446: set_actor [email protected] immune_to_headshots 00291: set_actor [email protected] attack_when_provoked 1   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #FAM60249: release_model #AK47     0249: release_model #MP5LNG04ED: load_animation "COP_AMBIENT" // FAM104ED: load_animation "GANGS" repeatwait 0until 04EE:   animation "COP_AMBIENT" loaded repeatwait 0until 04EE:   animation "GANGS" loaded 0804: AS_actor [email protected] walk_to 2141.1428 -986.0502 60.5906 angle 143.9829 radius 0.2 animation "Copbrowse_loop" IFP_file "COP_AMBIENT" 10.0 LA 1 LX 0 LY 0 LF 0 LT -1//0605: actor [email protected] perform_animation_sequence "Copbrowse_loop" IFP_file "COP_AMBIENT" 10.0 loop 1 0 0 0 time -1 [email protected] = Object.Init(3044, 0.0, 0.0, 0.0)//0470: [email protected] = actor [email protected] current_weapon 070A: AS_actor [email protected] attach_to_object [email protected] offset 0.04 0.1 0.05 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time -10804: AS_actor [email protected] walk_to 2147.7366 -988.5807 62.3792 angle 159.8052 radius 0.2 animation "SMKCIG_PRTL" IFP_file "GANGS" 4.0 LA 1 LX 0 LY 0 LF 0 LT -1//0605: actor [email protected] perform_animation "SMKCIG_PRTL" IFP "GANGS" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 0669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected] //////////////////////////////////////////////////////////////////////////:Action_Loop6repeatwait 0until 00FF: not actor [email protected]  0 (in-sphere)near_point_on_foot 2141.1428 -986.0502 60.5906 radius  10.0  10.0  10.0repeatwait 0until 00FF: not actor [email protected]  0 (in-sphere)near_point_on_foot 2147.7366 -988.5807 62.3792 radius  10.0  10.0  10.0repeatwait 0until 80FF:  not actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  10.0  10.0  10.0jf @Action_Loop5:Action_Loop5wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and0118:   not actor $PLAYER_ACTOR dead0118:   not actor [email protected] dead0118:   not actor [email protected] dead jf @Basic_Stage_Loop2if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @Action_Loop50613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" timeif [email protected] > 0.50.55 > [email protected] @Action_Loop4if3 > [email protected] @Action_Loop50669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected]@ += 1          jump @Action_Loop5       :[email protected] = 0jump @Action_Loop5:Cleanup2Object.Destroy([email protected])01C2: remove_references_to_actor [email protected]// Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected]: release_animation "COP_AMBIENT"04EF: release_animation "GANGS" jump @Basic_Stage_Loop2
Edited by Jottha

Share this post


Link to post
Share on other sites
ZAZ

Is there a method to follow a path and then stop for loop animation?

yes but i have effort to correct your mistakes of basic coding

 

conditions can be done in 2 versions

1. normal version

2. "NOT"-version(opposite)

 

the difference is the first digit of the opcode, 8 instead 0

normal version: 00FF: actor near_point

"NOT"-version: 80FF: actor near_point

 

i assume that you didn't know that, because you merged it wrong

normal version: 00FF: but with the key_word "not"

repeatwait 0until 00FF: not actor [email protected] 0 (in-sphere)near_point_on_foot 2141.1428 -986.0502 60.5906 radius 10.0 10.0 10.0repeatwait 0until 00FF: not actor [email protected] 0 (in-sphere)near_point_on_foot 2147.7366 -988.5807 62.3792 radius 10.0 10.0 10.0

it's still the normal version and makes sense to check if the actors at the place to make animation

 

but this one, below, checks if CJ is NOT at place to let the code continue

 

repeatwait 0until 80FF: not actor $PLAYER_ACTOR 0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius 10.0 10.0 10.0(I don't know what you wanna check)

same here

0118: not actor [email protected] dead0118: not actor [email protected] dead

i adapted your mistake in an example above

 

 

 

I wanted to be able to recruit the peds again (your script was clearing their references when I went in a vehicle) so I did this to start all over again. If CJ dies, only then, their references must be erased.

If CJ and the peds are a little far from the 'calling point', then the red mark should appear again and I can call 2 more peds:

 

NO, you have to consider that your script needs a cleanup

Cleanup means that the spawned actors gets clearing their references, spawned vehicle also, as well as spawned objects, basicly everything what your script creates

when? when the stuff isn't needed anymore

If CJ dies or gets arrested, he respwans at another location. Then your scene should be cleared and then the code can go back to script beginn and the scene can be repeated

therefor this check: 0256: player $PLAYER_CHAR defined

Also if the Player leave the location, also if other conditions are acomplished, related to your plan

 

If you want to spawn more actors, you need to use more variables, more actor instances

needs also to support these actors e.g. check if they're dead

 

If you want to spawn new actors by using the same variables again, you need first to clear the references of the first ones, or delete them with 009B: destroy_actor [email protected]

{$CLEO .cs}:RecruitPeds2thread 'RECRUT2':Basic_Stage_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Basic_Stage_Loop2if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius  1.0  1.0  1.0jf @Basic_Stage_Loop2// Load models0247: load_model #FAM10247: load_model #FAM3   0247: load_model #AK470247: load_model #MP5LNG038B: load_requested_models:MODEL_LOAD200D6: if or8248:   not model #FAM1 available 8248:   not model #FAM3 available8248:   not model #AK47 available8248:   not model #MP5LNG available004D: jump_if_false @MODEL_SPAWN2 0001: wait 0 ms 0002: jump @MODEL_LOAD2 :[email protected] = Actor.Create(24, #FAM1, 2136.0151, -980.0492, 59.9104)Actor.Angle([email protected]) = 194.287actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 20000350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 30 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 201B9: set_actor [email protected] armed_weapon_to 300446: set_actor [email protected] immune_to_headshots [email protected] = Actor.Create(24, #FAM3, 2158.1418, -986.1246, 62.9218)Actor.Angle([email protected]) = 134.1654actor.WeaponAccuracy([email protected])= 90actor.Health([email protected]) = 2000//0350: toggle_actor [email protected] maintain_position_when_attacked 1// give the actor a weapon01B2: give_actor [email protected] weapon 29 ammo 3000 // Load the weapon model before using this081A: set_actor [email protected] weapon_skill_to 201B9: set_actor [email protected] armed_weapon_to 0      0446: set_actor [email protected] immune_to_headshots 0//0291: set_actor [email protected] attack_when_provoked 1   //Here you do what you want to do with the actor.0249: release_model #FAM10249: release_model #FAM30249: release_model #AK47     0249: release_model #MP5LNG04ED: load_animation "COP_AMBIENT" // FAM104ED: load_animation "GANGS" repeatwait 0until 04EE:   animation "COP_AMBIENT" loaded repeatwait 0until 04EE:   animation "GANGS" loaded [email protected] = Object.Init(3044, 0.0, 0.0, 0.0)0804: AS_actor [email protected] walk_to 2141.1428 -986.0502 60.5906 angle 143.9829 radius 0.2 animation "Copbrowse_loop" IFP_file "COP_AMBIENT" 10.0 LA 1 LX 0 LY 0 LF 0 LT -10804: AS_actor [email protected] walk_to 2147.7366 -988.5807 62.3792 angle 159.8052 radius 0.2 animation "SMKCIG_PRTL" IFP_file "GANGS" 4.0 LA 1 LX 0 LY 0 LF 0 LT -1//////////////////////////////////////////////////////////////////////////:Action_Loop1wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118:   not actor [email protected] dead8118:   not actor [email protected] dead 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.0jf @Cleanup2if00FE:   actor [email protected] sphere 0 in_sphere 2147.7366 -988.5807 62.379 radius 1.5 1.5 2.0jf @Action_Loop1070A: AS_actor [email protected] attach_to_object [email protected] offset 0.04 0.1 0.05 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time -1:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118:   not actor [email protected] dead8118:   not actor [email protected] dead 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.0jf @Cleanup2if  and00FE:   actor [email protected] sphere 0 in_sphere 2141.1428 -986.0502 60.5906 radius 10.5 10.5 20.000FE:   actor [email protected] sphere 0 in_sphere 2147.7366 -988.5807 62.379 radius 10.5 10.5 20.0jf @Cleanup2if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @Action_Loop20613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" timeif [email protected] > 0.50.55 > [email protected] @Action_Loop3if3 > [email protected] @Action_Loop20669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected]@ += 1          jump @Action_Loop2       :[email protected] = 0jump @Action_Loop2:Cleanup2Object.Destroy([email protected])01C2: remove_references_to_actor [email protected]// Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected]: release_animation "COP_AMBIENT"04EF: release_animation "GANGS" jump @Basic_Stage_Loop2

Share this post


Link to post
Share on other sites
Jottha

 

Is there a method to follow a path and then stop for loop animation?

yes but i have effort to correct your mistakes of basic coding

conditions can be done in 2 versions
1. normal version
2. "NOT"-version(opposite)

the difference is the first digit of the opcode, 8 instead 0
normal version: 00FF: actor near_point
"NOT"-version: 80FF: actor near_point

i assume that you didn't know that, because you merged it wrong

Yeah, I didn't know, sorry.

 

 

Well, I was testing your code and some things happened.

First, I was not being able to recruit the peds, so I changed their ped type to 8 (gang2).

Second, when recruiting [email protected], he was not getting the MP5, he was getting dual colts instead of it (weapon skill 2), so I added 01B9: set_actor [email protected] armed_weapon_to 29 in Action_Loop3.

The third I'm trying to solve now. As the red mark appears again, it clears their references, even if they are in your group. I don't want that. They need to stay there and in group.

 

 

but this one, below, checks if CJ is NOT at place to let the code continue

repeatwait 0until 80FF: not actor $PLAYER_ACTOR 0 (in-sphere)near_point_on_foot 2137.5771 -983.8047 60.5616 radius 10.0 10.0 10.0(I don't know what you wanna check)

 

That's right, If CJ is not near this point (this is the red mark location, where everything starts), the code continues and the red mark spawns again.

 

Your efforts are much appreciated ZAZ! Thanks once again!

Share this post


Link to post
Share on other sites
Jottha

Ok, I made some changes and now they are staying there, in group or not, just like I wanted.

The red mark is appearing again and I can call more of them.

 

Here's what I modified from Action_Loop2 and 3:

:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118:   not actor [email protected] dead8118:   not actor [email protected] dead 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2137.5771 -983.8047 60.5616 radius  80.0  80.0  80.0jf @Cleanup2if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @Action_Loop20613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" timeif [email protected] > 0.50.55 > [email protected] @Action_Loop3if3 > [email protected] @Action_Loop20669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected]@ += 1          //jump @Action_Loop2       jf @Action_Loop2  // changed to jf  if  and    // moved this to here so @13 can perform animation and/or reach for his gun.80FE:  not actor $PLAYER_ACTOR sphere 0 in_sphere 2137.5771 -983.8047 60.5616 radius  10.0  10.0  10.0   // if cj is out of range the code might begin again.//00FE:   actor [email protected] sphere 0 in_sphere 2141.1428 -986.0502 60.5906 radius 10.5 10.5 20.0     // I think I don't need this condition checked.//00FE:   actor [email protected] sphere 0 in_sphere 2147.7366 -988.5807 62.379 radius 10.5 10.5 20.0      // same as above.jump @Basic_Stage_Loop2  // changed to begin all over again.:[email protected] = 001B9: set_actor [email protected] armed_weapon_to 29 // added this to [email protected] get his mp5 instead of dual colts.jump @Action_Loop2

Bug1: if you recruit [email protected] before he reaches his destination (smoke animation point) he gets dual colts. Same if he have to reach for his gun before arriving his destination (if there's a gun fight on the street, for example).

Bug2: [email protected] blows smoke only one time, I did something that removed the exhale loop. Maybe adding the 01B9 opcode to Action_Loop3? I will try to figure what is wrong.

 

I feel we're are almost done! :lol:

Sorry for being such a pain ZAZ.

Have a happy new year my friend!

Edited by Jottha

Share this post


Link to post
Share on other sites
Jottha

Bro, I'm tired. It's 6 in the morning here. lol

I was studying some basics and stuff.

Well, please disconsider the last code I posted, I made some changes and I think there's progress.

Here:

////////////// 1:Action_Loop1wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118:   not actor [email protected] dead8118:   not actor [email protected] dead 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2139.6602 -984.1639 60.624 radius  300.0  300.0  300.0   // if I increase here I can go more far, right?jf @Cleanup2if00FE:   actor [email protected] sphere 0 in_sphere 2147.7366 -988.5807 62.379 radius 1.5 1.5 2.0    // didn't understand this condition.jf @Action_Loop1////////////// 2:Action_Loop2wait  0if0256:   player $PLAYER_CHAR definedjf @Cleanup2if  and8118:   not actor [email protected] dead8118:   not actor [email protected] dead 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2139.6602 -984.1639 60.624 radius  300.0  300.0  300.0   jf @Cleanup2if0611: is_char_playing_anim [email protected] anim "SMKCIG_PRTL"jf @MP5GANG   //----------------------------------------> changed to equip him.0613: [email protected] = actor [email protected] animation "SMKCIG_PRTL" time  if [email protected] > 0.50.55 > [email protected]   jf @Action_Loop3if3 > [email protected] jf @Action_Loop2    0669: [email protected] = attach_particle "EXHALE" to_actor [email protected] with_offset 0.05 0.2 -0.05 type 2 0883: attach_particle [email protected] to_actor [email protected] mode 5 064F: make_temp_particle_visible_and_remove_references [email protected]@ += 1          jump @Action_Loop2   //////////////// 3:[email protected] = 0jump @Action_Loop2    /////////////// mp5:MP5GANG   01B9: set_actor [email protected] armed_weapon_to 29  //-------------> now he has his mp5 in hands to screw around.jump @Action_Loop2 ////////////// clean up:Cleanup2Object.Destroy([email protected])01C2: remove_references_to_actor [email protected]// Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected]: release_animation "COP_AMBIENT"04EF: release_animation "GANGS" jump @Basic_Stage_Loop2
I could not set back the red mark without interfering in the exhale part. Everytime I had the red mark again [email protected] exhaled just once.
Another thing are the group references. If I get too far from the sphere radius they leave the group. Stunt jumps from a car or bike in movement are also included. :sigh:
Those are the things I need to do, but now I'm going to sleep. The next year is just around the corner. :zZz:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

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