MeanpantheR Posted January 25, 2008 Share Posted January 25, 2008 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 More sharing options...
2pacproducer Posted February 16, 2008 Share Posted February 16, 2008 I cant understand what you mean , but I think here is the code for making new actors. [email protected] = Actor.Create(Gang2, #FAM2, 2489.309, -1645.702, 14.07031) [email protected] = Actor.Create(PedType, #FAM2, coordinates) Link to comment Share on other sites More sharing options...
ZAZ Posted February 16, 2008 Share Posted February 16, 2008 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
pimpnstripprz Posted February 16, 2008 Share Posted February 16, 2008 (edited) rofl - you hit the add reply button before I did ZAZ edit: no fair, you copy and pasted from 2pac's thread! Edited February 16, 2008 by pimpnstripprz Link to comment Share on other sites More sharing options...
ZAZ Posted February 16, 2008 Share Posted February 16, 2008 rofl - you hit the add reply button before I did ZAZ edit: no fair, you copy and pasted from 2pac's thread! Oh, sorry. Maybe you can explain it in two words. CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
pimpnstripprz Posted February 17, 2008 Share Posted February 17, 2008 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 More sharing options...
Shadow-Link Posted February 17, 2008 Share Posted February 17, 2008 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 More sharing options...
ZAZ Posted February 17, 2008 Share Posted February 17, 2008 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. CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
pimpnstripprz Posted February 17, 2008 Share Posted February 17, 2008 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 I snatched these examples off of one of my existing scripts which employs more checks and overlooked it and glad to know ZAZ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now