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

    1. Red Dead Redemption 2

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

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

aryaryan

is there a way to spawn peds without pedgrp.dat?

Recommended Posts

aryaryan

title

Share this post


Link to post
Share on other sites
ZAZ

with scm or cleo script, yes

Share this post


Link to post
Share on other sites
aryaryan
9 hours ago, ZAZ said:

with scm or cleo script, yes

Is there a tutorial on how to do so?

Share this post


Link to post
Share on other sites
ZAZ

There're tutorials to learn scripting but not a special one for yor plan

Share this post


Link to post
Share on other sites
aryaryan
On 2/2/2020 at 9:43 AM, ZAZ said:

There're tutorials to learn scripting but not a special one for your plan

is there nothing about creating (ped) actors?

Share this post


Link to post
Share on other sites
ZAZ

There's something about spawning actor inside this tut, when you scroll down to the chapter "Next Step/ Spawn a 3D model"
But the code blocks are messed up because the forums software has changed

 

In anyway do you need to build a script to can spawn actors
Therefor you need to learn the basics:
- how to build a useful script construct for your plan
- build conditional checks
- build a loop
- how to use variables
- load models
- make cleanup sections
- how to find the neccesary codes

 

Do you have any coding experience?
Do you wanna learn high level coding?

Share this post


Link to post
Share on other sites
aryaryan
52 minutes ago, ZAZ said:

There's something about spawning actor inside this tut, when you scroll down to the chapter "Next Step/ Spawn a 3D model"
But the code blocks are messed up because the forums software has changed

 

In anyway do you need to build a script to can spawn actors
Therefor you need to learn the basics:
- how to build a useful script construct for your plan
- build conditional checks
- build a loop
- how to use variables
- load models
- make cleanup sections
- how to find the necessary codes

 

Do you have any coding experience?
Do you wanna learn high level coding?

is there any updated tutorial? I'm very lost right now.

Share this post


Link to post
Share on other sites
aryaryan
1 hour ago, ZAZ said:

Do you have any coding experience?

sorta...

 

1 hour ago, ZAZ said:

Do you wanna learn high level coding?

I don't really know.

Share this post


Link to post
Share on other sites
ZAZ

 

1 hour ago, aryaryan said:

sorta...

 

I don't really know.

 

The progressive way of coding is "high level"
Building constructs by "argument > end"

while true
end
if
then
end

 

We think that the R* scripting was done in that way and that it was based on visual basic
Some ingenious modders decrypted R* scripts by reverse engineering and made tools to compile source scripts into data for the game.
Or reverse, decompile main.scm into source script.
Most popular is sannybuilder.
But when you decompile main.scm or a downloaded cleo script, the compiler gives you allways a source text in "low level" syntax

Decompiling main.scm or a downloaded cleo mod scripts and look how R* or the modder did it, is one way to learn coding
Therefor you need to understand "low level" syntax

 

Now i show you some simple scripts to spawn an actor

 

First one in low level
press key 9 ingame to spawn the actor infront of CJ

{$CLEO .cs}
thread 'ACTOR'

:ACTOR_2
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @ACTOR_2
if
0AB0:   key_pressed 57//--------------------------------- key 9
jf @ACTOR_2
0247: request_model #BFYBE

:ACTOR_5
wait 0
if
0248:   model #BFYBE available
jf @ACTOR_5


04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0  4.0  0.2
009A: 0@ = create_actor_pedtype 5 model #BFYBE at 11@ 12@ 13@
0249: release_model #BFYBE


:ACTOR_13
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @ACTOR_57
wait 5000
jump @ACTOR_57

if
not Actor.Dead(0@)
jf @ACTOR_57
jump @ACTOR_13

:ACTOR_57
Actor.RemoveReferences(0@)
jump @ACTOR_2

 

 


Next one in high level
press add key + to spawn 10 homies infront of CJ
then you can recruit them

{$CLEO .cs}
:Actorspawn_Gangmember
thread 'Actor'
0@ = 105
1@ = 106
2@ = 107
3@ = 105
4@ = 106
5@ = 107
6@ = 105
7@ = 106
8@ = 107
9@ = 105
10@ = 106
16@ = 9
14@ = -3.0
0629: change_integer_stat 64 to 1000

while true
wait 0
    if
        0256:   player $PLAYER_CHAR defined
    then
            if
                0AB0:   key_pressed 107// 	add key +
            then    
                
                for 15@ = 0 to 10
                    if
                        001D:   15@ > 16@
                    then
                        break
                    end
                    gosub @Load_model_sub
                    04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 14@  5.0  0.2
                    009A: 20@(15@,12i) = create_actor  8 0@(15@,12i) at  11@ 12@ 13@
                    14@ += 0.7
                end
                
                15@ = 0   
                
                for 15@ = 0 to 10
                    if
                        001D:   15@ > 16@
                    then
                        break
                    end
                    0249: release_model 0@(15@,12i)
                    wait 200
                    01C2: remove_references_to_actor 20@(15@,12i)
                end

            15@ = 0
            14@ = -3.0
            end
   
    end
end

:Load_model_sub
0247: request_model 0@(15@,12i)

:Load_models_check
wait  0
if
0248:   model 0@(15@,12i) available
jf @Load_models_check
return

 


Third one in low level
go into red spot in grove street to spawn a SWAT
the swat will run along the given coordinates

{$CLEO .cs}
:Actor_Walk_on_SCMPATH
thread 'MODL'

:ActorWalk_2
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @ActorWalk_2
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
jf @ActorWalk_2

0247: request_model #SWAT

:Load_Model_Check
0001: wait  0 ms
if
0248:   model #SWAT available
jf @Load_Model_Check

009A: 1@ = create_actor_pedtype 22 model #SWAT at 2487.5  -1660.5  13.35
0173: set_actor 1@ z_angle_to 255.3781
0249: release_model #SWAT

0615: define_action_sequences 13@
05D6: clear_scmpath
05D7: add_point_to_scmpath  2474.4036 -1671.1002 13.3314
05D7: add_point_to_scmpath  2482.3828 -1682.174 13.3304
05D7: add_point_to_scmpath  2480.8169 -1726.5841 13.5547
05D7: add_point_to_scmpath  2522.562 -1725.4154 13.5469  

05D7: add_point_to_scmpath  2522.7358 -1718.514 13.5312
05D7: add_point_to_scmpath  2535.6318 -1706.942 13.4372
05D7: add_point_to_scmpath  2528.6187 -1690.41 13.7015
05D7: add_point_to_scmpath  2509.6377 -1676.5874 13.5469
05D8: AS_assign_scmpath to_actor -1 flags  7  3  
0616: define_action_sequences_end 13@
0618: assign_actor 1@ to_action_sequences 13@
061B: remove_references_to_AS_pack 13@ 



:ActorWalk_3
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @ActorWalk_3
if  or
0118:   actor 1@ dead
80FF:   not   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  100.0  100.0  2.0
jf @ActorWalk_3
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
jump @ActorWalk_2

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
Recommended

While I appreciate Zaz's work, and trust me, he's a true veteran when it comes to coding, I'm gonna add in my own way of actor spawning for simplicity. Call it a basic alternative way of doing this.

 

Here is a template for an actor spawn I made awhile ago:

 

{$CLEO .cs}
thread "ACTORSPAWN"

:ACTORSPAWN_0
wait 0
if and
Player.Defined($PLAYER_CHAR)
0AB0:   key_pressed 51
else_jump @ACTORSPAWN_0
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 -0.5 0.0
Model.Load(#FAM1)         
038B: load_requested_models

:ACTORSPAWN_1
wait 0
if
Model.Available(#FAM1)
else_jump @ACTORSPAWN_1
[email protected] = Actor.Create(Gang2, #FAM1, [email protected], [email protected], [email protected])                                                                                      
Actor.SetImmunities([email protected], 0, 0, 0, 0, 0)
Actor.Health([email protected]) = 200
0173: set_actor [email protected] Z_angle_to 0.0
0568: set_actor [email protected] untargetable 1
093B: set_actor [email protected] upper_body_damage_anims_only 0
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 0
0446: set_actor [email protected] dismemberment_possible 0
04D8: set_actor [email protected] drowns_in_water 0
0A28: set_actor [email protected] swimming_speed_to 5
02A9: set_actor [email protected] immune_to_nonplayer 0
0489: set_actor [email protected] muted 0
0856: set_actor [email protected] enable_crouch 1
060F: set_actor [email protected] melee_accuracy_to 85.0
07DD: set_actor [email protected] attack_rate 65
087E: set_actor [email protected] weapon_droppable 0
07FE: set_actor [email protected] fighting_style_to 6 moves 6
0850: AS_actor [email protected] follow_actor $PLAYER_ACTOR
Model.Destroy(#FAM1)
wait 250

:ACTORSPAWN_2
wait 0
if
Actor.Dead([email protected])
else_jump @ACTORSPAWN_3
Actor.RemoveReferences([email protected])
jump @ACTORSPAWN_0

:ACTORSPAWN_3
wait 0
if
0AB0:   key_pressed 51
else_jump @ACTORSPAWN_2
Actor.DestroyInstantly([email protected])
wait 250
jump @ACTORSPAWN_0

 

This script is in full working order, so if you like, you can try that and mess around with all the values to get a grip of how it works. This is just a basic quick and simple way of doing it.

 

There's many other things you can do with it like change the condition so instead of it being when a key is pressed, they spawn when the player is in a certain area, etc.

Edited by Recommended

Share this post


Link to post
Share on other sites
aryaryan
Quote

There's many other things you can do with it like change the condition so instead of it being when a key is pressed, they spawn when the player is in a certain area, etc

where do i learn that?

 

P.S: sorry if I'm annoying y'all.

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.


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