Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,672 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. 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

    2. Red Dead Redemption

    3. 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. Forum Support

    2. Site Suggestions

Sign in to follow this  
HeresOtis

main.scm crashing

Recommended Posts

HeresOtis

I started a main.scm mod from a stripped version. The game loading bar goes all the way, waits a second, then the game crashes. Is this due to main.scm?? If so, then I'll link my script for review.

Share this post


Link to post
Share on other sites
ZAZ

yes, crash after loading bar is finished indicates script failure, either main.scm or cleoscript

or incompatible savegame, did you try to start new game?

btw. about which game are you talking?

Edited by ZAZ

Share this post


Link to post
Share on other sites
KeeJay

I think, he's talking about your (ZAZ) Stripped Main.

Share this post


Link to post
Share on other sites
HeresOtis

It's SA. And I did start a new game. I used CLEO opcodes in the main.scm too. I have CLEO.asi loaded and no scripts in the folder.

 

http://pastebin.com/Jikm2QyU

Share this post


Link to post
Share on other sites
ZAZ

It works for me, i mean i got ingame without crash ... after i corrected the misstake in first line

DEFINE MISSIONS 1//DEFINE MISSION {ID} 0 AT {LABEL} @DEFINE MISSION 0 AT @SHOOTTT

the misstake was

DEFINE MISSIONS 0

in that case sanny gave an error message by compiling

could you compile that?

Share this post


Link to post
Share on other sites
HeresOtis

It works for me, i mean i got ingame without crash ... after i corrected the misstake in first line

could you compile that?

I can compile it but I still get crash after loading bar is full.

You got ingame with it?

Share this post


Link to post
Share on other sites
HeresOtis

It even crashes with an unmodified stripped version of main.scm? It only works with the default main.scm. But ZAZ's main.scm with ext scripts works fine as well. I need a working, simplified version so I can add my mods.

Share this post


Link to post
Share on other sites
ZAZ

 

It works for me, i mean i got ingame without crash ... after i corrected the misstake in first line

could you compile that?

I can compile it but I still get crash after loading bar is full.

 

even after correcting the mission amount?

 

You got ingame with it?

yes

 

 

It even crashes with an unmodified stripped version of main.scm?

what's an unmodified stripped version of main.scm?

try the total stripped below

 

 

DEFINE OBJECTS  1DEFINE OBJECT (dummyobject) // This is an unused object. You can put anything here.DEFINE MISSIONS  0DEFINE EXTERNAL_SCRIPTS  -1DEFINE UNKNOWN_EMPTY_SEGMENT  0DEFINE UNKNOWN_THREADS_MEMORY  0//-------------MAIN---------------:MAIN_103A4: name_thread 'MAIN'016A: fade  0 (in)  0 ms042C: set_total_missions_to  0030D: set_total_mission_points_to  001F0: set_max_wanted_level_to  60111: set_wasted_busted_check_to  0 (disabled)00C0: set_current_time  23  004E4: unknown_refresh_game_renderer_at  2494.5 -1668.503CB: set_camera  2494.5 -1668.5 13.40053: $PLAYER_CHAR = create_player #NULL at  2494.5 -1668.5 13.407AF: $PLAYER_GROUP = player $PLAYER_CHAR group01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR0173: set_actor $PLAYER_ACTOR z_angle_to  7.00373: set_camera_directly_behind_player070D: $PLAYER_CHAR0629: change_stat  181 (islands unlocked) to  4  // integer see statdisp.dat01B6: set_weather  104BB: select_interior  0  // select render area01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)01B7: release_weather016C: restart_if_wasted at  2494.5 -1668.5 13.4 angle  180.0 unknown  0016D: restart_if_busted at  2494.5 -1668.5 13.4 angle  180.0 unknown  0016A: fade  1 (out)  1000 ms0001: wait  100 ms03E6: remove_text_box0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here:MAIN_30001: wait 2500 ms//end_thread0002: jump @MAIN_3
Edited by ZAZ

Share this post


Link to post
Share on other sites
HeresOtis

even after correcting the mission amount?

what's an unmodified stripped version of main.scm?

try the total stripped below

I corrected the mission amount and it still crashed.

 

Yes, it didn't work with the stripped version.

 

What do you think can still be wrong? Which cleo are you using?

Share this post


Link to post
Share on other sites
ZAZ

maybe you compiled and copied into wrong dir and started game always with same invalid main? :catspider:
I tested on cleo3 and CLEO 4.1.1.30f by Alien, also with old sanny 3.04 and with new version 3.2.1 and i'm still on XP
did you test if your cleo works: originally main and a cleoscript?
have you other scriptmods(asi) installed? if yes, remove it

 

It could also caused by a map failure, if player spawns near an invalid ipl object

Heavy map failures e.g. LOD failure or map system failures like wrong entry in gta.dat let the game crash while loading bar loads

 

But if map system data is ok and just an object model is invalid, let the game crash when player comes in range of that object

Same if object limit was hit

To find the problem: use an unmodded game installation
and test the total stripped main, i posted above

if works then test your main script again but remove first the cleo codes

and then with cleo

 

Share this post


Link to post
Share on other sites
HeresOtis

This is so strange. My game still crashes with the stripped main, and i just reinstall the game. So it's a fresh install.

Also, if I use your King Kong mod, it still works with a new game. But my mod, or the stripped main, doesnt work while starting a new game.

 

EDIT: I fixed my problem. My Sannybuilder data files were mixed up and whatnot. So I uninstalled, cleared the folder, and reinstalled Sannybuilder.

Edited by HeresOtis

Share this post


Link to post
Share on other sites
HeresOtis

Here's a strange problem I noticed.

Source

repeat     0208: generate_random_float_in_range -80.0 80.0 store_to [email protected]    0208: generate_random_float_in_range -80.0 80.0 store_to [email protected]    04C4: get_offset_from_char_in_world_coords $PLAYER_ACTOR offset [email protected] [email protected] 1.0 store_to $Temp_X $Temp_Y $Temp_Z    wait 0until 80C2:   NOT is_point_on_screen $Temp_X $Temp_Y $Temp_Z radius 5.00209: generate_random_int_in_range 2 10 store_to $NUM_SUSPECTS // number of suspects02C0: get_closest_char_node $Temp_X $Temp_Y $Temp_Z store_to $Temp_X $Temp_Y $Temp_Z  

Decompiled

:SHOOTTT_490208: -80.0 = random_float_in_ranges 80.0 [email protected] 0208: -80.0 = random_float_in_ranges 80.0 [email protected] 04C4: store_coords_to $PLAYER_ACTOR [email protected] [email protected] from_actor 1.0 with_offset $TEMP_X $TEMP_Y $TEMP_Z wait 0 80C2:   not sphere_onscreen $TEMP_X $TEMP_Y $TEMP_Z radius 5.0 jf @SHOOTTT_49 0209: 2 = random_int_in_ranges 10 $NUM_SUSPECTS 02C0: store_to $TEMP_X $TEMP_Y $TEMP_Z ped_path_coords_closest_to $TEMP_X $TEMP_Y $TEMP_Z 

How come the integers and values are moved around after decompiling? Will this cause a crash in-game when I compile the source??

Share this post


Link to post
Share on other sites
Deji

Here's a strange problem I noticed.

Source


Decompiled

How come the integers and values are moved around after decompiling? Will this cause a crash in-game when I compile the source??

 

The SB SCM .ini file doesn't match the order of the parameters you're writing. You're writing the parameters in their correct order, while Sanny is still compiling them in the mumbo jumbo order.

 

You're using v2 definitions, that's great! But it's as if you only have the opcodes.txt file. Download the .ini 'File' using the generator:

http://gtag.gtagaming.com/opcode-database/generator/

 

Pick between the v1/v2 definitions for all files and stick with the choice. Unless you choose v1, of course, in which case you chose... poorly :p

Share this post


Link to post
Share on other sites
HeresOtis

 

Here's a strange problem I noticed.

Source


Decompiled

 

How come the integers and values are moved around after decompiling? Will this cause a crash in-game when I compile the source??

 

The SB SCM .ini file doesn't match the order of the parameters you're writing. You're writing the parameters in their correct order, while Sanny is still compiling them in the mumbo jumbo order.

 

You're using v2 definitions, that's great! But it's as if you only have the opcodes.txt file. Download the .ini 'File' using the generator:

http://gtag.gtagaming.com/opcode-database/generator/

 

Pick between the v1/v2 definitions for all files and stick with the choice. Unless you choose v1, of course, in which case you chose... poorly :p

 

When I use the v2 SASCM.ini, my game crashes again like my first post in this topic. I tested, when I use sanny's default data files, I get no crashes. When I download v2 data files and replace, my game crashes at the end of the loading bar.

Share this post


Link to post
Share on other sites
Deji

When I use the v2 SASCM.ini, my game crashes again like my first post in this topic. I tested, when I use sanny's default data files, I get no crashes. When I download v2 data files and replace, my game crashes at the end of the loading bar.

You do download the relevant other files too, right? And make sure the parameters in the source are in the correct order?

 

It's always possible one or two rare opcodes bug the game. If so, send me the script so I can investigate the problems or point out where your script might be wrong :p

 

Also, since SB has its SB SCR mode now, I believe you can drop the files into 'data\sa_scr' and switch between them easily, in case you're not already a few steps ahead of me in SB updatedness :p

Share this post


Link to post
Share on other sites
HeresOtis

I downloaded v2 and put them in sa_scr folder. And converted them in sannybuilder using MB->SB and it works now. Do I use my original source code, or do I use the converted one from now on?

Share this post


Link to post
Share on other sites
Deji

Dunno, never tried it what you've done :p

 

Well, I guess you just use the converted one if you want v2/SCR and the original one if you want v1/SCM.

Share this post


Link to post
Share on other sites
HeresOtis

Now I have it working with v2 files. But after loading bar, it shows Ganton text but wont fade from black screen. Can you check just the initial and main part of the code?

http://pastebin.com/GTfMRhQ8

Share this post


Link to post
Share on other sites
ZAZ

param order of fade opcode of v2.ini has been changed

 

v2.ini016A=2,do_fade %1d% fade %2d%v1.ini016a=2,fade %2d% time %1d%
It works in this way

 

016A: do_fade 0 fade 1
first the fade time then the bolean

it's really not the best opcode description

Edited by ZAZ

Share this post


Link to post
Share on other sites
Deji

 

016A: do_fade 1 fade 0
The params are still the wrong way around. That MB->SB thing doesn't seem to work too well. Makes sense though, it's made to convert from Mission Builder format, and I'm not sure what they did with that originally. However, the Source Converter IS supposed to be able to convert between INI's.

 

Still, your original code snippet looked like it was originally written for the v2 files, but that script looks SCMy. I'm confused with which way you want to go.

 

 

EDIT:

 

it's really not the best opcode description

Well, they shouldn't have descriptions at all, really :p

 

The GTA3script/SCR way to write it would be:

 

DO_FADE {time} FADE_OUT/FADE_IN
This can be done in SB SCR also with the help of defining constants: https://pastebin.com/j3qVN8by

 

SCR for SB (the one currently available via the OpcodeDB - 'real' SCR still requires compiler differences, though, hence SCRambl) continues the weird 'useless words' rule conjured up in medieval times, though:

 

[command] random_description_that_could_conflict_with_anything [param]
Since SCR for SB tries to stick with one standard, it uses more simple, but less descriptive words, most of which will be used again and again. Not as descriptive all-in-one line, but with a standard to refer back to, you know each thing can only refer to one thing, like how a real language works.

 

Still, they're all fully optional by SB's MB-compatible rules. I prefer to ditch them, use constants where they should be and write things which conform more to SCR rules. It was fair enough sticking to a completely made up syntax years ago, but by now we really should have had a better language fully in place. People still just completely guess what parameters do based on really annoying and useless description identifiers.

 

 

Soon, though. SCR will be fully usable on its own, with a proper written documentation on how everything is correctly done. All these awkward things will be in the past, hopefully :p

Edited by Deji

Share this post


Link to post
Share on other sites
HeresOtis

Okay, that fade opcode error worked. Thanks guy. Idk what the MB - SB thing did, but it worked lol.

 

Is there certain procedure I should follow to test and define some unknown opcodes?

Also, since I'm not using the regular main.scm, can I create my own global variables? I need multiple globals to communicate between threads.

Edited by HeresOtis

Share this post


Link to post
Share on other sites
Deji

Okay, that fade opcode error worked. Thanks guy. Idk what the MB - SB thing did, but it worked lol.

 

Is there certain procedure I should follow to test and define some unknown opcodes?

There are no "unknown opcodes". SA Mobile included a list of every command name used.

 

Everyone spent years getting as many found as possible, and I've spent years afterwards correcting mistakes and finding more, mostly not by testing but looking through the game executable and building up an idea of what each command did BEFORE testing them. We'd managed to cut down the completely unknown commands to less than 50 out of the couple of thousand that exist.

 

 

Now what's more important, is getting all the information on valid parameter values for the commands we most commonly use, but still aren't fully known.

 

But heck, to me it still seems quite pointless now. I know all sorts of things that most don't. Not that I've been keeping these to myself, most of them are out there. But still, most people still using SCM/CLEO for scripts only use the most obvious things. The OpcodeDB probably helps quite a bit, since it's very popular and regularly visited, but any other information not on its own opcode-specific page there is going to have a tricky time getting out. I'll be trying to integrate the OpcodeDB with the rest of GTAG Modding as well as adding more of the tonnes of documentation which is still missing, but I'm tied up in all sorts of things at the moment.

 

 

Anyway, there's not that much to be found, I'm sure. What's left won't be very exciting, and the whole SCM scripting engine is already abused past what it provides anyway. You'd gain more by learning to understand the disassembly (gta_sa.idb) and reverse-engineering aspects, which is by far the most powerful way to even figure out most command-related things.

 

 

EDIT: You can search for "unk" to find stuff labelled 'unknown' or prefixed 'unk_':

http://gtag.gtagaming.com/opcode-database/search/unk/

 

Though, most of it is just VC/III stuff which still hasn't yet been updated.

Edited by Deji

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.