Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Creating new SCM


HeresOtis
 Share

Recommended Posts

I have a mod which loads various cleo scripts, with up to 25 script, not all loaded at the same time, but several will be loaded and running at the same time. A lot of the scripts are being ran externally using opcode 0A92. There's one main script then it loads external scripts and sometimes it crashes randomly.

 

How many cleo scripts can be ran before the game crashes?

Should I convert my scripts into a .scm and use Citizen Launcher?

Can using .scm prevent crashes?

What's the advantage of using .scm over .cs?

Link to comment
Share on other sites

 

I have a mod which loads various cleo scripts, with up to 25 script, not all loaded at the same time, but several will be loaded and running at the same time. A lot of the scripts are being ran externally using opcode 0A92. There's one main script then it loads external scripts and sometimes it crashes randomly.

 

 

How many cleo scripts can be ran before the game crashes?

that's different depending to the amount of running threads and their data size

some people told that they have 80 or more than 100

a cleoscript can run in more instances when it starts the own thread again

the threads of main.scm are also relevant

 

 

Should I convert my scripts into a .scm and use Citizen Launcher?

i would take a total stripped main because then would run only 1 thread

 

Can using .scm prevent crashes?

if the reason is "to much threads" yes

 

 

What's the advantage of using .scm over .cs?

-can use global varaibles in a stable manner

-can use ipl-objects

-a missionscript can start a thread

-the stuck car check works

 

-the thread start procedure will be only done for one time at new gamestart

 

-cleos will be started also by loading savegames

then items like car_generators, objects can be set up in more insatance by saving-loading saves

 

if the cleos of your mod place car_generators, objects, markers or pickups at scriptbeginn

and never remove it

then the scripts should have this opcode: 0A95: enable_thread_saving

or cut and past the items into main.scm

Link to comment
Share on other sites

Also, most mods that provide multiple CLEO scripts can be compiled down into one if coded correctly.

Link to comment
Share on other sites

 

i would take a total stripped main because then would run only 1 thread

I downloaded the stripped main and source off your site. What parts do I edit to add my scripts?

Link to comment
Share on other sites

 

i would take a total stripped main because then would run only 1 thread

I downloaded the stripped main and source off your site. What parts do I edit to add my scripts?

but it isn't a "total stripped main", it starts min. 10 threads

anyway, it's allways the same:

add the modthreads above of the first missionscript

 

-add your script here//-------------Mission 0---------------// Originally: Initial 1// Sannybuilder marks by recompiling the first missionscript with the comment //-------------Mission 0:INITIALthread 'INITIAL'

 

 

then place the create_thread codes where the other create_thread codes are placed

 

 

this is a total stripped main

 

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

 

Link to comment
Share on other sites

 

this is a total stripped main

 

So, can I just copy and paste that and make a new main.scm, then add my scripts in the appropriate places?

Link to comment
Share on other sites

 

this is a total stripped main

 

So, can I just copy and paste that and make a new main.scm, then add my scripts in the appropriate places?

Yes but place the script allways at the right place

normal threads into MAIN PART, missionscripts into MISSIONSCRIPT PART, Externscripts into EXTERNSCRIPT PART

 

the main should have this structure:

 

TABLES of Objects, Missionscripts, ExternscriptsMAIN PART-Main thread-other threadsMISSIONSCRIPT PARTEXTERNSCRIPT PART

 

Link to comment
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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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