Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

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

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

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    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. Design Your Own Mission
      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
    1. Announcements

    2. Support

    3. Suggestions

Add another actor in a stripped scm file


MeanpantheR
 Share

Recommended Posts

Hi, I have a stripped San Andreas main.scm file and i'm trying to figger out how to add another actor in it.

 

I've looked around the forum and everything i've founded hasnt helped me

 

-

(Reason I want to do this is to play about with memory addresses on the actor to make them run,jump,crouch etc.)

 

Cheers

Link to comment
Share on other sites

  • 3 weeks later...

 

Hi, I have a stripped San Andreas main.scm file and i'm trying to figger out how to add another actor in it.

 

I've looked around the forum and everything i've founded hasnt helped me

 

-

(Reason I want to do this is to play about with memory addresses on the actor to make them run,jump,crouch etc.)

 

Cheers

Read tutorials to find out, how to add a script to the main,

by using the create_thread command

http://www.gtaforums.com/index.php?showtopic=239912

 

To spawn a model with your script requires following steps:

1. call the file which should be used

 

0247: request_model #INFERNUS

 

 

2. check in a little loop if the model is available

 

:Load_Model_Check0001: wait  0 ms00D6: if  00248:   model #INFERNUS available004D: jump_if_false ££Load_Model_Check

 

 

3. Is the model file available, create your stuff by using the file name and define it with a variable name

 

00A5: $Auto1 = create_car #INFERNUS at 2487.5  -1660.5  13.350175: set_car $Auto1 z_angle_to 90.0

 

 

4. If the model file now isnt needed anymore, free the engine from it

 

0249: release_model #INFERNUS

 

 

5. If your spawned stuff now isnt needed for your script, release it. This also annul the defined variable.

 

01C3: remove_references_to_car $Auto1;; Like turning a car into any random car

 

 

 

 

..........................................................................

 

I will show you the structure of a thread with an exemble thread

CJ should go to a point to spawn an actor

Give the thread a name

Loop means, a jump instructions send the engine up to a previous Label to run again through the script

I will call this previous Label LoopAdress

The first opcode after a Loopadress must allways be a WAIT code

..........................................................................

 

 

Threadnamelabel

 

First LoopAdress

wait

player defined check

if the check is negativ jump up to First Loopadress

a conditional check, what should initialize the mod funktion (key-press or if actor near_point 1 (in-sphere)

if the check is negativ jump up to First Loopadress

 

if the check is passed, spawn the actor

request model

 

load_model_check

 

create actor or vehicle or other stuff

 

 

Second Loopadress

wait

player defined check

if the check is negativ jump up to Second Loopadress

a conditional check, what should happend to discharge the actor from your script (if actor killed or if not actor near actor)

if the check is negativ jump up to Second Loopadress

 

if the check is passed discharge the actor

Jump back to the first Loopadress

 

 

An exemble:

 

:3dModels_103A4: name_thread 'MODL':3dModels_20001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @3dModels_200D6: if  000FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0004D: jump_if_false @3dModels_20247: request_model #INFERNUS:Load_Model_Check0001: wait  0 ms00D6: if  00248:   model #INFERNUS available004D: jump_if_false @Load_Model_Check00A5: $Auto1 = create_car #INFERNUS at 2487.5  -1660.5  13.350175: set_car $Auto1 z_angle_to 90.00249: release_model #INFERNUS:3dModels_30001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @3dModels_300D6: if  080FF:   NOT   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0004D: jump_if_false @3dModels_301C3: remove_references_to_car $Auto1  // Like turning a car into any random car0002: jump @3dModels_2

 

 

A conditional check includes basicly

1. The IF-statement (by checking more then one conditons it needs to determine if AND or if OR))

2. The condition / question (maximum 8)

3. The Jump instruction by negation

 

 

The IF-statement (by checking more then one conditons it needs to determine if AND or if OR)

 

 

 

:BLKOP_30001: wait 000D6: if 5//----------------------------Old variation0248: model #SNIPER available0248: model #HEATSEEK available0248: model #DESERT_EAGLE available0248: model #M4 available0248: model #CR_AMMOBOX available0248: model #SWAT available004D: jump_if_false @BLKOP_3////////////////////////////////////////both works with sannybulder:BLKOP_30001: wait 0if and//----------------------------------New variation0248: model #SNIPER available0248: model #HEATSEEK available0248: model #DESERT_EAGLE available0248: model #M4 available0248: model #CR_AMMOBOX available0248: model #SWAT available004D: jump_if_false @BLKOP_3/////////////////////////////////////////////////////////////-----------------------------------------------------------------------------------------------------:MAIN_4214//sannybuilder codeif or  Garage.IsOpen('BODLAWN')  Garage.IsOpen('MODLAST')  Garage.IsOpen('MDSSFSE')  Garage.IsOpen('MDS1SFS')  Garage.IsOpen('VECMOD')jf @MAIN_4336:MAIN_40//BW missionbuilder code00D6: if  2403B0:   garage 'BODLAWN' door_open03B0:   garage 'MODLAST' door_open03B0:   garage 'MDSSFSE' door_open03B0:   garage 'MDS1SFS' door_open03B0:   garage 'VECMOD' door_open004D: jump_if_false ££MAIN_45

 

 

A load model check is a loop and must additional to the conditional check

include a WAIT-code

 

Exemble with more conditions to check, especially animations

 

:PedAnim_103A4: name_thread 'PAN':PedAnim_20001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @PedAnim_200D6: if  000FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0004D: jump_if_false @PedAnim_2:Animation204ED: load_animation "MISC"04ED: load_animation "GANGS":Animations2_load_check0001: wait  0 msif  and04EE:   animation "MISC" loaded04EE:   animation "GANGS" loaded004D: jump_if_false @Animations2_load_again0002: jump @PedAnim_3:Animations2_load_again04ED: load_animation "MISC"04ED: load_animation "GANGS"0002: jump @Animations2_load_check:PedAnim_30247: request_model #male010247: request_model #blade:LoadModelCheck0001: wait  0 msif  and0248:   model #male01 available0248:   model #blade available004D: jump_if_false @LoadModelCheck00A5: [email protected] = create_car #blade at 2487.5  -1660.5  13.350175: set_car [email protected] z_angle_to 90.00129: [email protected] = create_actor_pedtype 4 model #male01 in_car [email protected] driverseat0249: release_model #male010249: release_model #blade0001: wait  1000 ms05CD: AS_actor [email protected] exit_car [email protected]: AS_actor [email protected] go_to 2482.753 -1656.834 13.32293 speed 4 7000 ms:ASS_1690wait 0ifPlayer.Defined($PLAYER_CHAR)else_jump @ASS_1690if8101:   not actor [email protected] stopped_near_point 2482.753 -1656.834 13.32293 radius 1.0 1.0 1.0 sphere 0else_jump @ASS_1800jump @ASS_1690:ASS_18000001: wait  1000 ms0605: actor [email protected] perform_animation_sequence "PRTIAL_GNGTLKA" from_file "GANGS" 4.0 loop 1 0 0 0 -1 ms:PedAnim_40001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @PedAnim_4if  or Actor.Dead([email protected])80FF:   NOT   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  100.0  100.0  2.0004D: jump_if_false @PedAnim_404EF: release_animation "MISC"04EF: release_animation "GANGS"01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C3: remove_references_to_car [email protected];; Like turning a car into any random car0002: jump @PedAnim_2

 

Link to comment
Share on other sites

pimpnstripprz

rofl - you hit the add reply button before I did ZAZ icon14.gif

 

edit: no fair, you copy and pasted from 2pac's thread! tounge2.gif

Edited by pimpnstripprz
Link to comment
Share on other sites

pimpnstripprz

not at all ZAZ... impossible. I'm not trying to get on your bad side here, I was merely joking with you. I've got nothing but respect for you and how you teach, as a matter of fact, here, I'll post what I was going to so you can approve or disapprove... then I'll disappear *poof* - I'm gone

 

 

you'll want to create a small thread by naming your thread with an 03A4:, then defining your player model with a conditional check, then by creating a load model check - if the conditional and load model checks pass, you'll then create the new actor model - for example...

 

 

:ACT_20001: wait 000D6: if 00256:   player $PLAYER_CHAR defined004D: jf @ACT_200FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -545.9601 2594.1699 53.5156 radius 50.0 50.0 50.0004D: jf @ACT_20247: request_model #WFYST

 

 

Next finish your load model check and create the new actor- example

 

 

:ACT_30001: wait 000D6: if and0248: model #WFYST available004D: jf @ACT_3009A: $actor00 = create_actor_pedtype 22 model #WFYST at -440.4827 2604.635 47.26860173: set_actor $actor00 z_angle_to 210.00249: release_model #WFYST

 

 

then create another conditional check which will check to see if you are outside of the given radius

 

 

:ACT_40001: wait 000D6: if0256:   player $PLAYER_CHAR defined004D: jf @ACT_480FE:   NOT  actor $PLAYER_ACTOR sphere 0 in_sphere -545.9601 2594.1699 53.5156 radius 55.0 55.0 55.0004D: jf @ACT_401C2: remove_references_to_actor $actor00 // Like turning an actor into a random pedestrian0002: jump @ACT_2

 

 

don't forget that you need to create the thread with an 004F: and name the thread with an 03A4: (ACT_1) - also take into consideration that this thread has no actions defined for the actor, it will only spawn and stand there when you enter the defined radius

Link to comment
Share on other sites

 

Next finish your load model check and create the new actor- example

 

 

:ACT_30001: wait 000D6: if and0248: model #WFYST available004D: jf @ACT_3009A: $actor00 = create_actor_pedtype 22 model #WFYST at -440.4827 2604.635 47.26860173: set_actor $actor00 z_angle_to 210.00249: release_model #WFYST

 

 

then create another conditional check which will check to see if you are outside of the given radius

 

Why are you using a "00D6: if and"?

You are checking one single thing so you can use "00D6: if" like you did with the other if checks. Use "if and" when you want to check for two or more things. (Correct me if I am wrong)

Not trying to insult you, I just noticed it.

Link to comment
Share on other sites

 

Why are you using a "00D6: if and"?

 

Its a tiny failure. We all do it often by building conditional checks. Im too.

Its the most popular cause for failures.

 

hey pimpnstripprz, should also be a joke:

 

Oh, sorry. Maybe you can explain it in two words.
Link to comment
Share on other sites

pimpnstripprz
Next finish your load model check and create the new actor- example

 

 

:ACT_30001: wait 000D6: if and0248: model #WFYST available004D: jf @ACT_3009A: $actor00 = create_actor_pedtype 22 model #WFYST at -440.4827 2604.635 47.26860173: set_actor $actor00 z_angle_to 210.00249: release_model #WFYST

 

 

then create another conditional check which will check to see if you are outside of the given radius

 

Why are you using a "00D6: if and"?

You are checking one single thing so you can use "00D6: if" like you did with the other if checks. Use "if and" when you want to check for two or more things. (Correct me if I am wrong)

Not trying to insult you, I just noticed it.

no insult taken, good eye icon14.gif I snatched these examples off of one of my existing scripts which employs more checks and overlooked it tounge.gif

 

and glad to know ZAZ biggrin.gif

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

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