Ig0r98 Posted January 27 Share Posted January 27 Hello, i have a problem with loading a save file. So i've been creating this myth mod for gta sa and i want it to have progress. Basically after killing each monster you would save the game and load it next time that you are playing. I created my own save point and here is the code: :SAVE1 script_name 'SAVE1' wait 1000 save_this_custom_script [email protected] = 1194.91 [email protected] = -832.1778 [email protected] = 1103.636 [email protected] = 1191.801 [email protected] = -832.22 [email protected] = 1103.636 [email protected] = 1103.636 Pickup.Create([email protected], 1277, 3, [email protected], 2@, [email protected]) 0570: [email protected] = create_asset_radar_marker_with_icon 35 at [email protected] [email protected] [email protected] 018B: set_marker [email protected] radar_mode 2 :SAVE1_130 wait 0 if Player.Defined($PLAYER_CHAR) jf @SAVE1_245 if Pickup.Picked_up([email protected]) jf @SAVE1_245 if $ONMISSION == 0 jf @SAVE1_186 03D8: show_save_screen :SAVE1_186 wait 0 Actor.PutAt($PLAYER_ACTOR, [email protected], [email protected], [email protected]) Actor.Angle($PLAYER_ACTOR) = [email protected] Player.CanMove($PLAYER_CHAR, True) wait 1000 Pickup.Create([email protected], 1277, 3, [email protected], [email protected], [email protected]) 090D: highlight_all_inactive_gang_zones_as_available_for_gangwars :SAVE1_245 jump @SAVE1_130 And everything's working great except for loading that file. The game just crashes. I also have fastman92 limit adjuster so it gave me a log. Here is the log: Game crashed unfortunately, here's a crash log: Current process ID: 8388 Current thread ID: 11976 Last file to be loaded: Free ID list generator.cs Last library loaded: NOT SET Exception address: 0x005D532A ("GTA_SA.EXE"+0x1D532A) Exception code: 0xC0000005 Exception name: EXCEPTION_ACCESS_VIOLATION Inaccessible memory address: 0x0 General registers: EAX: 0x00000000 (0) EBX: 0x00000000 (0) ECX: 0x00000000 (0) EDX: 0x159AC5E8 (362464744) ESI: 0x00000000 (0) EDI: 0x00000000 (0) EBP: 0x0000000A (10) ESP: 0x0177FACC (24640204) EIP: 0x005D532A (6116138) EFL: 0x00210246 (2163270) Segment registers: CS: 0023 DS: 002B ES: 002B FS: 0053 GS: 002B SS: 002B FPU registers: ST0: 3124998.000000 bytes: 00 00 00 00 00 18 BC BE 14 40 ST1: 1.000000 bytes: 00 00 00 00 00 00 00 80 FF 3F ST2: -1562500.000000 bytes: 00 00 00 00 00 20 BC BE 13 C0 ST3: 1.000000 bytes: 00 00 00 00 00 00 00 80 FF 3F ST4: -1562499.000000 bytes: 00 00 00 00 00 18 BC BE 13 C0 ST5: 63.000000 bytes: 00 00 00 00 00 00 00 FC 04 40 ST6: 63.000000 bytes: 00 00 00 00 00 00 00 FC 04 40 ST7: 1440.000000 bytes: 00 00 00 00 00 00 00 B4 09 40 CTRL: 007F STAT: 0122 TAGS: FFFF MMX registers, 8 bytes: MM0: 00 00 00 00 00 18 BC BE MM1: 00 00 00 00 00 00 00 80 MM2: 00 00 00 00 00 20 BC BE MM3: 00 00 00 00 00 00 00 80 MM4: 00 00 00 00 00 18 BC BE MM5: 00 00 00 00 00 00 00 FC MM6: 00 00 00 00 00 00 00 FC MM7: 00 00 00 00 00 00 00 B4 XMM registers, 16 bytes: XMM0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM5: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XMM7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Also worth to mention I am coding on main.scm that has no missions on it. So the monsters are counting as missions and defeating them also gives you progress ingame. If anyone know why is this happening and if there is a fix please let me know. Link to comment Share on other sites More sharing options...
OrionSR Posted January 28 Share Posted January 28 2 hours ago, Ig0r98 said: BTThe game just crashes. Add a is player defined/playing check before trying to move the actor. This is a likely source of a crash when loading. Saving the custom script isn't necessary for scripts in a main.scm. Local variables and instruction pointers are maintained in the save. I doubt thread saving will crash anything, but best to avoid possible conflicts. Your respawn angle is borked. You can use model IDs instead of model numbers in SCM. Link to comment Share on other sites More sharing options...
Ig0r98 Posted January 28 Author Share Posted January 28 Can you please explain "is player defined/playing check" I don't seem to quite understand that. Can you please write that code here. Also I can delete save_this_custom_script and change the angle. But in-game after player walks in to the save point normally everything's working fine the save screen pop out and after saving script moves player a bit forward of save point so the player don't get stuck in infinitive Save srceen. Link to comment Share on other sites More sharing options...
ZAZ Posted January 28 Share Posted January 28 Your script was made for Cleo, therefore this code: save_this_custom_script For using in main.scm you must remove it Also, we can see in your crash log that cleo scripts are running and these can cause problems Basicly, if you wanna find out reason of problem, then test it on unmodded game That means, take an unmodded GTA SA installation, of course do you need your favourite gta_sa.exe furthermore asi loader and silent patch but nothing else Run your modded main.scm and script.img and test it. I assume that you need modloader because of the monsters Don't do that, use instead existing model names of original game First make sure that your script works fine. Then expand it and other files to realize your plans Ig0r98 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Ig0r98 Posted January 28 Author Share Posted January 28 Hello, i've deleted the code save_this_custom_script and that just makes things worst. So the game crashes upon starting new game. Which didnt happend before. I also tryed removeing some cleo script that may be the problem but no success. I also dont use modloader all my scripts for monsters and so on are in main.scm and models and txd are in my custom .img that i created. I also installed clean vesrion of gta and i've just copyed the save script and it works fine. Link to comment Share on other sites More sharing options...
ZAZ Posted January 28 Share Posted January 28 so next step, integrate the custom.img into the clean version of gta and nothing else and without cleo and test the main.scm with the monster mission and save and load savegame Ig0r98 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Ig0r98 Posted January 28 Author Share Posted January 28 Alright, so now i moved my custom.img to clean gta and just take bigfoot script from my main moded gta and compiled it to cleo and put it in clean version, after defeating myth and saving it works on that clean version. I think this has something to do with no missions on that main main.scm im working on. Link to comment Share on other sites More sharing options...
ZAZ Posted January 28 Share Posted January 28 But with bigfoot script in main.scm, the save and load savegame doesn't work? If so, then post main.scm script inclusiv bigfoot script, post it at pastebin Or is it ok now for you ? CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
OrionSR Posted January 29 Share Posted January 29 (edited) 16 hours ago, Ig0r98 said: Can you please explain "is player defined/playing check" This stuff included earlier in your script: Player.Defined($PLAYER_CHAR). Basic rule is to always include a player check before using opcodes that manipulate the player. When you load a save, your script will try to resume after the wait following the save screen. The previous player check won't be valid when loading, and loading is one of those times when the player is least likely to be defined. You should include a save done check and wait loop after the save screen. Check the standard PSAVE script for examples. The save process needs to park running scripts on a wait statement. You don't want your script to move on to the next wait. Then wait for the player to be defined before trying to move him. Be aware that almost anything you change in main.scm at this stage will make previous saves incompatible. I've never trusted cleo saves; they can confound test results. Edited January 29 by OrionSR Ig0r98 1 Link to comment Share on other sites More sharing options...
Ig0r98 Posted February 1 Author Share Posted February 1 Hi guys btw i found what was the problem. It was problem in on of my monster script. I fixed it and now everythings working great. Thank you for your help also. 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