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

    3. Suggestions

My mod creates Stuttering


ɪʟ_Duca
 Share

Recommended Posts

Hey there, i've done this rudimental mod (still WIP) just with a simple flowchart and copying around code lines. It's purpose is to add not one but two extra gangs around the city in both day and nigth but expecially at night time, so it's to be used with a custom pedgrp.dat and default.ide i edited to correspond with. This script however doesn't load the exact peds when needed without the Model.Load(#XYZ) lines but at the same time these code lines creates audio and video stutters (like 2/3 skips per second) and slows the game down a bit only in the custom gang models zones, in the untouched zones the FPS is ok. Have you more advanced solutions to this script made with sticks and ropes?

 

// This file was decompiled using VCSCM.ini published on 2021-01-30
{$CLEO .cs}

0000: NOP 

:NONAME_2
wait 0
if
   Player.Defined($PLAYER_CHAR)   
jf @NONAME_2
jump @NONAME_21 

:NONAME_21
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'STREET1'
jf @NONAME_39
jump @NONAME_712

:NONAME_39
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'STREET2'
jf @NONAME_42
jump @NONAME_712

:NONAME_42
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'STREET3'
jf @NONAME_58
jump @NONAME_401

:NONAME_58
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'STREET4'
jf @NONAME_63
jump @NONAME_934

:NONAME_63
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'STREET5'
jf @NONAME_77
jump @NONAME_712

:NONAME_77
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'BUSINES'
jf @NONAME_84
jump @NONAME_823

:NONAME_84
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'BIKAREA'
jf @NONAME_96
jump @NONAME_934

:NONAME_96
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'DOCKS'
jf @NONAME_107
jump @NONAME_934

:NONAME_107
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'CONSTRU'
jf @NONAME_113
jump @NONAME_823

:NONAME_113
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'TOUR1'
jf @NONAME_128
jump @NONAME_401

:NONAME_128
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'TOUR2'
jf @NONAME_132
jump @NONAME_712

:NONAME_132
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'STREET6'
jf @NONAME_149
jump @NONAME_934

:NONAME_149
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'RICH1'
jf @NONAME_151
jump @NONAME_401

:NONAME_151
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'RICH2'
jf @NONAME_168
jump @NONAME_401

:NONAME_168
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'RICH3'
jf @NONAME_172
jump @NONAME_401

:NONAME_172
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'SHOP1'
jf @NONAME_189
jump @NONAME_823

:NONAME_189
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'SHOP2'
jf @NONAME_193
jump @NONAME_712

:NONAME_193
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'SHOP3'
jf @NONAME_205
jump @NONAME_712

:NONAME_205
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'SHOP4'
jf @NONAME_214
jump @NONAME_401

:NONAME_214
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'SHOP5'
jf @NONAME_225
jump @NONAME_401

:NONAME_225
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'GOLF1'
jf @NONAME_236
jump @NONAME_401

:NONAME_236
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'GOLF2'
jf @NONAME_244
jump @NONAME_401

:NONAME_244
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'BEACH1'
jf @NONAME_257
jump @NONAME_401

:NONAME_257
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'BEACH2'
jf @NONAME_266
jump @NONAME_934

:NONAME_266
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'BEACH3'
jf @NONAME_278
jump @NONAME_603

:NONAME_278
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'AIRPORT'
jf @NONAME_285
jump @NONAME_934

:NONAME_285
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'TERMINL'
jf @NONAME_289
jump @NONAME_401

:NONAME_289
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'CLUB1'
jf @NONAME_296
jump @NONAME_401

:NONAME_296
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'CLUB2'
jf @NONAME_299
jump @NONAME_934

:NONAME_299
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'GHETTO1'
jf @NONAME_304
jump @NONAME_934

:NONAME_304
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'GHETTO2'
jf @NONAME_317
jump @NONAME_934

:NONAME_317
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'OCEAND1'
jf @NONAME_323
jump @NONAME_401

:NONAME_323
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'OCEAND2'
jf @NONAME_338
jump @NONAME_934

:NONAME_338
wait 0
if
0583:   player $PLAYER_CHAR in_zone 'ARMYBAS'
jump @NONAME_551

:NONAME_401
wait 0
Model.Destroy(#HFOTR)
Model.Destroy(#WMOCA)
Model.Destroy(#VICE8)
009b: destroy_actor_instantly #HFOTR
009b: destroy_actor_instantly #WMOCA
009b: destroy_actor_instantly #VICE8
0235: set_gang 6 models_to #PGA #PGB
0235: set_gang 2 models_to #SGA #SGB
0235: set_gang 3 models_to #CLA #CLB
0236: set_gang 2 car_to #GANGBUR
0236: set_gang 3 car_to #COACH
0237: set_gang 6 primary_weapon_to 23 secondary_weapon_to 17
0237: set_gang 2 primary_weapon_to 17 secondary_weapon_to 6
0237: set_gang 3 primary_weapon_to 17 secondary_weapon_to 23
03F2: pedgroup 10 remove_threat 2048 //Diaz's gang stop attacking P.I.Gs
03F1: pedtype 10 add_threat 8192 //Diaz's gang hate Vercetti's gang
jump @NONAME_2

:NONAME_551
wait 0
0235: set_gang 2 models_to #ARMY #ARMY
0237: set_gang 2 primary_weapon_to 26 secondary_weapon_to 26
jump @NONAME_2

:NONAME_603
//Wouldn't you rather see the final version?
  jump @NONAME_2

 

Edited by ɪʟ_Duca
Post too long
Link to comment
Share on other sites

- The opcodes for gang vehicle, ped models and their weapons (0235, 0236 and 0237) don't require model loading since they automaticly load them.
- The purpose of the opcode 009B is to destroy the actors handle - not its model. Since no actor is created in your code - you don't have to use it at all. 

- Also you have multiple conditional checks with the same purpose. That's not really a problem but you should consider using "if or". An example:

:mainLoop
    wait 0
    if or
        0583:   player $PLAYER_CHAR in_zone 'BUSINES'
        0583:   player $PLAYER_CHAR in_zone 'CONSTRU'
        0583:   player $PLAYER_CHAR in_zone 'SHOP1'
    jf @NONAME_84
    jump @NONAME_823
:NONAME_84
jump @mainLoop

- For learning purposes (not needed for your code):
The opcode 038B should not be used in a loop to avoid frame drop. So it's better to load the models before the loop. 
And try The Opcode Database since there's a description for each opcode.

 

Good luck.

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.