MegaFox Posted March 14, 2019 Share Posted March 14, 2019 (edited) NEW METHOD OF MODDING MAIN.SCM WITH SAVES SUPPORT (GTA SA Only) The script HOME_BRAINS 20 (:HMLES) is the only one not used, it can be loaded and used to import a mod without conflicts with saves. You need to remove unused lines and add one to avoid resizing the MAIN thread. External scripts create a isolated thread from MAIN, so the protection of the game not reacts to them. But for the script loaders will have to adjust the memory. You should not create a DEFINE of the new script, because the game checks this section separately, and there is nothing to delete. But fortunately there is an unused HOME_BRAINS script, use it. For those who do not know the reason for crash when loading saves: The data on the size of the DEFINE sections and the MAIN thread are saved in the save, and if they do not correspond to the size of the sections and the MAIN thread of your main.scm, then protection reatcs and the game closes. But this does not apply to EXTERNAL SCRIPT threads. //remove - these lines should be deleted //add - these lines should be added //replace - these lines/code blocks should be replaced ... :MAIN_1960 01E8: create_forbidden_for_cars_cube_cornerA 2500.0 -1677.0 20.0 cornerB 2430.0 -1653.0 0.0 0004: $671 = 0 0004: $673 = 0 0004: $676 = 0 0005: $691 = 1.0 //remove 0005: $692 = 1.6 //remove 0004: $693 = 200 //remove 0004: $694 = 200 //remove 0004: $695 = 200 //remove 0004: $696 = 255 //remove 0004: $697 = 100 0004: $698 = 100 0004: $699 = 100 0004: $700 = 255 0004: $701 = 20 0004: $702 = 20 0004: $703 = 20 0004: $704 = 255 014B: $4161 = init_car_generator #RHINO color -1 -1 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2435.302 -1671.848 12.8007 angle 90.0 014C: set_parked_car_generator $4161 cars_to_generate_to 0 ... 00D7: create_thread @Noname_7 // without extra params 00D7: create_thread @Noname_8 // without extra params 00D7: create_thread @HJ // without extra params 00D7: create_thread @CELLFON // without extra params 016A: fade 0 time 0 09BA: show_entered_zone_name 0 0001: wait 0 ms 0001: wait 0 ms //remove 03B7: process_cutscene_only 0 0169: set_fade_color_RGB 0 0 0 0001: wait 2000 ms 03B7: process_cutscene_only 1 01F0: set_max_wanted_level_to 4 ... :MAIN_5749 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @MAIN_7482 077E: get_active_interior_to $42 0652: $24 = integer_stat 181 07D0: $39 = weekday 09FB: $153 = current_language 0842: $3253 = player $PLAYER_CHAR town_number 01BD: $6668 = current_time_in_ms 00D6: if 0038: $671 == 1 004D: jump_if_false @MAIN_5888 0084: $6667 = $6668 // (int) 0060: $6667 -= $6669 // (int) 00D6: if 0028: $6667 >= 180000 004D: jump_if_false @MAIN_5888 0004: $671 = 0 0004: $673 = 0 0004: $6667 = 0 0004: $11398 = 0 0004: 0@ = 0 //add ... 0913: run_external_script 66 (CARMOD1) :MAIN_6003 0002: jump @MAIN_6014 //replace with 0002: jump @MAIN_8304 :MAIN_6010 090F: end_external_script 66 (CARMOD1) //ADD BELOW THIS COMMENT :MAIN_8304 0926: 0@ = external_script_status 20 (HOME_BRAINS) 00D6: if 0038: 0@ == 0 004D: jump_if_false @MAIN_6014 08A9: load_external_script 20 (HOME_BRAINS) 00D6: if 08AB: external_script 20 (HOME_BRAINS) loaded 004D: jump_if_false @MAIN_6014 0913: run_external_script 20 (HOME_BRAINS) //AND ABOVE THIS, CODE, THAT IS INSIDE :MAIN_6014 00D6: if 0491: actor $PLAYER_ACTOR has_weapon 46 004D: jump_if_false @MAIN_6088 0926: $712 = external_script_status 0 (PLAYER_PARACHUTE) 00D6: if 0038: $712 == 0 004D: jump_if_false @MAIN_6081 08A9: load_external_script 0 (PLAYER_PARACHUTE) 00D6: if 08AB: external_script 0 (PLAYER_PARACHUTE) loaded 004D: jump_if_false @MAIN_6081 0913: run_external_script 0 (PLAYER_PARACHUTE) :MAIN_6081 0002: jump @MAIN_6092 ... //------------- External script 20 (HOME_BRAINS) --------------- :HMLES //replace everything from the "EXTERNAL SCRIPT 20" comment to the "EXTERNAL SCRIPT 21" comment by this code 03A4: name_thread 'HMLES' 0001: wait 0 ms //your scripts here. //need to have its source to add. //:Label scripts should be connected: //:Label // START OF SCRIPT //:Label0 // END OF SCRIPT //jump @Label1 // START OF OTHER SCRIPT //:Label1 // END OF OTHER SCRIPT //jump @Label //end_thread //Remove all wait 0 at the beginning of the scripts before :Label, except wait 0 after name_thread 'HMLES'. //if some scripts are cyclic and more than 1, //then merge everything :Label into one cyclic chain, and put after the usual scripts, before end_thread 004E: end_thread //------------- External script 21 (POOL_SCRIPT) --------------- ... After that, your script will support saves The author of the solution is Megafox (before MegaFirefox)https://vk.com/megafirefoxhttps://gtaforums.com/profile/1143658-user1592591/ Tested on Android mainV1.scm, PC main.scm. Edited March 14, 2019 by user1592591 OrionSR and KaizoM 2 Link to comment Share on other sites More sharing options...
Super Shizuku Posted March 14, 2019 Share Posted March 14, 2019 @VENEZUELA Z I hope this guide can eliminate the need to start over to find out which mission in "San Andreas 2.0" is not working properly faster than ever. Link to comment Share on other sites More sharing options...
MegaFox Posted March 14, 2019 Author Share Posted March 14, 2019 Tell me who worked / did not work, it works for me, at least on Android Link to comment Share on other sites More sharing options...
ZAZ Posted March 15, 2019 Share Posted March 15, 2019 (edited) Nice method Another way, bit more easier, replace the useless camera script Just replace the conditional check: :MAIN_4418 00D6: if and <<<<<< REPLACE 0491: actor $PLAYER_ACTOR has_weapon 43 <<<<<< REPLACE 0038: $ONMISSION == 0 <<<<<< REPLACE 004D: jump_if_false @MAIN_4499 0926: $SCRIPT_STATUS = external_script_status 75 (CAMERA) 00D6: if 0038: $SCRIPT_STATUS == 0 004D: jump_if_false @MAIN_4492 08A9: load_external_script 75 (CAMERA) 00D6: if 08AB: external_script 75 (CAMERA) loaded 004D: jump_if_false @MAIN_4492 0913: run_external_script 75 (CAMERA) WITH THIS: 00D6: if or 0491: actor $PLAYER_ACTOR has_weapon 0 0491: actor $PLAYER_ACTOR has_weapon 1 to get this : :MAIN_4418 00D6: if or 0491: actor $PLAYER_ACTOR has_weapon 0 0491: actor $PLAYER_ACTOR has_weapon 1 004D: jump_if_false @MAIN_4499 0926: $SCRIPT_STATUS = external_script_status 75 (CAMERA) 00D6: if 0038: $SCRIPT_STATUS == 0 004D: jump_if_false @MAIN_4492 08A9: load_external_script 75 (CAMERA) 00D6: if 08AB: external_script 75 (CAMERA) loaded 004D: jump_if_false @MAIN_4492 0913: run_external_script 75 (CAMERA) Then replace External script 75 (CAMERA) with your script //-------------External script 75 (CAMERA)--------------- :CAMERA 03A4: name_thread 'CAMERA' //your scripts here. //-------------External script 76 (DEBT)--------------- P.S. what could be the reason that the modified AMUNAT script doesn't work? because it's more code inthere, than in the origin one? Edited March 15, 2019 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
MegaFox Posted March 16, 2019 Author Share Posted March 16, 2019 5 hours ago, ZAZ said: Nice method Another way, bit more easier, replace the useless camera script Just replace the conditional check: :MAIN_4418 00D6: if and <<<<<< REPLACE 0491: actor $PLAYER_ACTOR has_weapon 43 <<<<<< REPLACE 0038: $ONMISSION == 0 <<<<<< REPLACE 004D: jump_if_false @MAIN_4499 0926: $SCRIPT_STATUS = external_script_status 75 (CAMERA) 00D6: if 0038: $SCRIPT_STATUS == 0 004D: jump_if_false @MAIN_4492 08A9: load_external_script 75 (CAMERA) 00D6: if 08AB: external_script 75 (CAMERA) loaded 004D: jump_if_false @MAIN_4492 0913: run_external_script 75 (CAMERA) WITH THIS: 00D6: if or 0491: actor $PLAYER_ACTOR has_weapon 0 0491: actor $PLAYER_ACTOR has_weapon 1 to get this : :MAIN_4418 00D6: if or 0491: actor $PLAYER_ACTOR has_weapon 0 0491: actor $PLAYER_ACTOR has_weapon 1 004D: jump_if_false @MAIN_4499 0926: $SCRIPT_STATUS = external_script_status 75 (CAMERA) 00D6: if 0038: $SCRIPT_STATUS == 0 004D: jump_if_false @MAIN_4492 08A9: load_external_script 75 (CAMERA) 00D6: if 08AB: external_script 75 (CAMERA) loaded 004D: jump_if_false @MAIN_4492 0913: run_external_script 75 (CAMERA) Then replace External script 75 (CAMERA) with your script //-------------External script 75 (CAMERA)--------------- :CAMERA 03A4: name_thread 'CAMERA' //your scripts here. //-------------External script 76 (DEBT)--------------- P.S. what could be the reason that the modified AMUNAT script doesn't work? because it's more code inthere, than in the origin one? This script is based on cleared main.scm, so it will not work in saves. Code size is smaller than original. Link to comment Share on other sites More sharing options...
OrionSR Posted March 16, 2019 Share Posted March 16, 2019 ZAZ's snippet looks like PC decompiled with the thread + local offset setting. I usually use the thread + global offset setting because it helps with things like relaunching threads with cleo or killing saved missions. I'm expecting things to work as described. Useless camera script? Homies and girlfriends taking your picture? I'm not sure if I've ever tried that. I remember reading about it way back when but forgot about it completely. Link to comment Share on other sites More sharing options...
ZAZ Posted March 16, 2019 Share Posted March 16, 2019 6 hours ago, user1592591 said: This script is based on cleared main.scm, so it will not work in saves. Code size is smaller than original. I'm talking about the Extern script AMUNAT I posted it embedded in a stripped main at pastebin , so you can test it first to see that you can buy Rocketlauncher, Minigun and Firethrower Then of course copy only the Extern script AMUNAT and replace the original one of originally main.scm 4 hours ago, OrionSR said: Useless camera script? Homies and girlfriends taking your picture? I'm not sure if I've ever tried that. I remember reading about it way back when but forgot about it completely. it's glitchy , you'll get a bad picture because of a bad view i'm shure that nobody need it CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Super Shizuku Posted March 16, 2019 Share Posted March 16, 2019 On 3/15/2019 at 5:59 AM, user1592591 said: Tell me who worked / did not work, it works for me, at least on Android What? Link to comment Share on other sites More sharing options...
MegaFox Posted March 16, 2019 Author Share Posted March 16, 2019 7 hours ago, Light Syde Riandy said: What? Sorry, Google Translate translated incorrectly. I meant, does my method work for you? Link to comment Share on other sites More sharing options...
ElYisusKing Posted March 22, 2019 Share Posted March 22, 2019 On 3/14/2019 at 6:49 PM, Light Syde Riandy said: @VENEZUELA Z I hope this guide can eliminate the need to start over to find out which mission in "San Andreas 2.0" is not working properly faster than ever. you don't have to worry about it, the v1.2.0 all missions works so is not a problem beside, if I do not save something before modifying it then it will not crash, anyway, probably the update 1.2.3 is the last one I'll do so there's no problem 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