Quantcast

Jump to content

» «
Photo

main.scm crashing

21 replies to this topic
HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#1

Posted 03 July 2014 - 08:37 PM

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.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#2

Posted 03 July 2014 - 08:49 PM Edited by ZAZ, 03 July 2014 - 08:51 PM.

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?


KeeJay
  • KeeJay

    Weekend modder.

  • Members
  • Joined: 06 Mar 2013
  • Poland

#3

Posted 03 July 2014 - 08:54 PM

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


HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#4

Posted 03 July 2014 - 09:14 PM

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


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#5

Posted 03 July 2014 - 09:54 PM

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?


HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#6

Posted 03 July 2014 - 10:41 PM

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?


HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#7

Posted 04 July 2014 - 01:04 AM

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.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#8

Posted 04 July 2014 - 05:23 AM Edited by ZAZ, 04 July 2014 - 05:33 AM.

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  1
DEFINE OBJECT (dummyobject) // This is an unused object. You can put anything here.

DEFINE MISSIONS  0

DEFINE EXTERNAL_SCRIPTS  -1

DEFINE UNKNOWN_EMPTY_SEGMENT  0

DEFINE UNKNOWN_THREADS_MEMORY  0

//-------------MAIN---------------


:MAIN_1
03A4: name_thread 'MAIN'
016A: fade  0 (in)  0 ms
042C: set_total_missions_to  0
030D: set_total_mission_points_to  0
01F0: set_max_wanted_level_to  6
0111: set_wasted_busted_check_to  0 (disabled)
00C0: set_current_time  23  0

04E4: unknown_refresh_game_renderer_at  2494.5 -1668.5
03CB: set_camera  2494.5 -1668.5 13.4
0053: $PLAYER_CHAR = create_player #NULL at  2494.5 -1668.5 13.4
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0173: set_actor $PLAYER_ACTOR z_angle_to  7.0
0373: set_camera_directly_behind_player
070D: $PLAYER_CHAR
0629: change_stat  181 (islands unlocked) to  4  // integer see statdisp.dat
01B6: set_weather  1
04BB: select_interior  0  // select render area
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
01B7: release_weather
016C: restart_if_wasted at  2494.5 -1668.5 13.4 angle  180.0 unknown  0
016D: restart_if_busted at  2494.5 -1668.5 13.4 angle  180.0 unknown  0
016A: fade  1 (out)  1000 ms
0001: wait  100 ms
03E6: remove_text_box
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here

:MAIN_3
0001: wait 2500 ms
//end_thread
0002: jump @MAIN_3

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#9

Posted 04 July 2014 - 06:47 AM

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?


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#10

Posted 04 July 2014 - 01:41 PM

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

 


HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#11

Posted 04 July 2014 - 06:44 PM Edited by HeresOtis, 04 July 2014 - 07:00 PM.

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.


HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#12

Posted 04 July 2014 - 07:18 PM

Here's a strange problem I noticed.

Source

repeat 
    0208: generate_random_float_in_range -80.0 80.0 store_to 0@
    0208: generate_random_float_in_range -80.0 80.0 store_to 1@
    04C4: get_offset_from_char_in_world_coords $PLAYER_ACTOR offset 0@ 1@ 1.0 store_to $Temp_X $Temp_Y $Temp_Z
    wait 0
until 80C2:   NOT is_point_on_screen $Temp_X $Temp_Y $Temp_Z radius 5.0
0209: generate_random_int_in_range 2 10 store_to $NUM_SUSPECTS // number of suspects
02C0: get_closest_char_node $Temp_X $Temp_Y $Temp_Z store_to $Temp_X $Temp_Y $Temp_Z  

Decompiled

:SHOOTTT_49
0208: -80.0 = random_float_in_ranges 80.0 0@ 
0208: -80.0 = random_float_in_ranges 80.0 1@ 
04C4: store_coords_to $PLAYER_ACTOR 0@ 1@ 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??


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#13

Posted 04 July 2014 - 08:21 PM

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.gtagamin...base/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

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#14

Posted 05 July 2014 - 04:48 PM

 

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.gtagamin...base/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.


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#15

Posted 05 July 2014 - 05:05 PM

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

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#16

Posted 05 July 2014 - 05:14 PM

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?


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#17

Posted 05 July 2014 - 05:41 PM

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.

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#18

Posted 05 July 2014 - 05:57 PM

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


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#19

Posted 05 July 2014 - 06:46 PM Edited by ZAZ, 05 July 2014 - 06:52 PM.

param order of fade opcode of v2.ini has been changed
v2.ini
016A=2,do_fade %1d% fade %2d%

v1.ini
016a=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

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#20

Posted 05 July 2014 - 06:58 PM Edited by Deji, 05 July 2014 - 07:17 PM.

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

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#21

Posted 05 July 2014 - 09:12 PM Edited by HeresOtis, 05 July 2014 - 09:39 PM.

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.


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#22

Posted 05 July 2014 - 10:05 PM Edited by Deji, 05 July 2014 - 10:06 PM.

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.gtagamin...ase/search/unk/

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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users