Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

[PLUG|OS] Script Dependent Drawings


Wesser
 Share

Recommended Posts

 

Script Dependent Drawings v1.15 Bug Fix

GTA San Andreas modification

Open source (Copyleft)

1. MODIFICATION OVERVIEW

  • This GTA San Andreas modification has been planned mainly to answer the frequently asked question about solving the
on-screen white squares bug. This "glitch" occurs because some scripts may share the same slots for the texture storage. Now, any script will load his own texture dictionary which will be allocated over the memory in an indipendent way as opposed to those of the others. The code has been optimized and designed to be as fast as the original one or even faster, in some circumstances, for each script processing.2. INSTALLATION
  • Unzip the content of the
rel folder under the game directory by overwriting the files that match with those existing:

 

 

  • sddwg.asi;
  • stream.ini (not really needed, see below).
3. STREAM INI CONFIGURATION
  • You are able to manipulate the amount of sprites that will be allocated at the game loading stage, by adding and/or modifying the following line to the
stream.ini file:

 

sprites  128

 

This value affects both rectangle and texture sprites but separately.

4. COMPATIBILITY
  • Below are listed all
game executable and CLEO library versions whereon the operation of this modification is fully certified:

 

 

  • Game executables:
    • gta_sa.exe v1.0 US (HOODLUM, 14.383.616b);
    • gta_sa.exe v1.0 EU (HOODLUM, 14.386.176b).
  • CLEO libraries:
    • cleo.asi v3.0.950 (Seemann);
    • cleo4.asi v4.1.1.30f (Alien).

I would discourage the use of such library on any other game executable or CLEO version, otherwise unexpected crashes or glitches may occur.

5. DISCLAIMER
  • Use this library at your own risk and be aware I won't be responsible for any damage provoked on your pc.
6. KNOWN BUGS
  • In case there is any, they are unknown yet. Feel free to report them.
7. CHANGELOG HISTORY
  • 04/25/2013 (v1.15 Bug Fix):
    • Fixed a bug when rendering an amount of sprites higher than 127.
  • 04/23/2013 (v1.1 Bug Fix):
    • Fixed a bug with USE_TEXT_COMMANDS (03F0) flag, not thread dependent yet;
    • Fixed an issue when building the full path of a TXD file.
  • 04/20/2013 (v1.0):
    • The following commands have been altered:
      • (004E) TERMINATE_THIS_SCRIPT;
      • (038D) DRAW_SPRITE;
      • (038E) DRAW_RECT;
      • (038F) LOAD_SPRITE;
      • (0390) LOAD_TEXTURE_DICTIONARY;
      • (0391) REMOVE_TEXTURE_DICTIONARY;
      • (03E3) SET_SPRITES_DRAW_BEFORE_FADE;
      • (0459) TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME;
      • (074B) DRAW_SPRITE_WITH_FIXED_ROTATION;
      • (08A0) UNKNOWN_08A0;
      • (0937) DRAW_WINDOW;
      • (0A93) TERMINATE_THIS_CUSTOM_SCRIPT;
      • (0ABA) TERMINATE_ALL_CUSTOM_SCRIPTS_WITH_THIS_NAME.
    • Texture dictionaries are linked to those threads that load them;
    • Rectangle and texture sprites are arranged separately;
    • Rectangle sprites are stored globally by any script;
    • Texture sprites are allocated every time a texture dictionary is loaded in a thread and cannot be accessed by any other;
    • The linear filtering has been enabled on top drawings to fix a possible R* graphic fault, to prevent some of them from being pixelated. Perhaps, this is the reason of SET_SPRITES_TO_BE_DRAWN_ANTIALIASED definition in the early SCM modding times, as the wrongly-named command actually puts a specific sprite on top.
8. TO-DO LIST
  • Make USE_TEXT_COMMANDS flag thread dependent;
  • Make sure that LOAD_TEXTURE_DICTIONARY opens a texture from a given path;
  • Restore DRAW_WINDOW_TEXT (0938) command (definition needs confirmation);
  • Add the ability to load multiple texture dictionaries in a thread without necessarily removing by REMOVE_TEXTURE_DICTIONARY and reloading the previous again;
  • Hook text draw routines to manage their amount.
9. CREDITS
  • Contributers of gta_sa.idb, whose package is available publicly here;
  • ThirteenAG, for reporting most of the bugs.
Enjoy. Regards, Cajetan Lacazette (alias) aka Wesser. Edited by Wesser
  • Like 3

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Impressive, very useful to the SA modding scene. Great work. cookie.gif

Link to comment
Share on other sites

I haven't occur this bug (yet ;] ), or maybe don't remember... In google nothing too smile.gif Could somebody upload some screen? Anyways, thanks for it. GTA SA modding scene is awesome.

Link to comment
Share on other sites

aStiffSausage

Never really thought of something as helpful as this. Makes coding so much simpler when there's no need to check in every script if you have to reload the textures or not, and no more conflicting textures! (Black Market mod conflicting with Rain Drops mod for example, was quite hilarious to see leafs, lines of cocaine etc. scrolling through screen when raining. smile.gif )

 

EDIT:

@damiann69

 

For easy example, use a speedometer and Wesser's Windscreen HUD at the same time. When you leave the car, the speedometer releases the textures, but as scm-engine had some bugs, also the Windscreen HUD lost its textures, causing only white squares to be drawn on screen. This mod makes each txd-function to be separated, so such things won't happen anymore.

Edited by oksa8
Link to comment
Share on other sites

Very nice, but i'm experiencing a crash after entering a car(1.0us/cleo3/a lot of plugins and mods):

 

GTA:SA Crashed, Debug Info Follows:GTA Info:Error: UnknownAssembly Info:Exception At Address: 0x007F3825Exception Code: 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)Registers:EAX: 0x4CF5D7D8	EBX: 0x00000001ECX: 0x03349388	EDX: 0x00727270ESI: 0x4CF5D7D8	EDI: 0x00000000EBP: 0x0023F854	ESP: 0x0023F838Last Opcode: 038F in thread 'speed' (0x355CC74)

 

 

speed source: http://pastebin.com/E4czkDn4

Link to comment
Share on other sites

Hope that this time mod's compatible with compact EXE? tounge.gif

Link to comment
Share on other sites

Good work, it's another plugin that's very useful.

Link to comment
Share on other sites

finally, someone did it. what i fear, will not happen again. thanks Wesser, you're the man cool.gif

Link to comment
Share on other sites

Thank you for all of your feedback, guys. I uploaded a fixed version in the hope that all bugs are gone. icon14.gif

 

 

Hope that this time mod's compatible with compact EXE? tounge.gif

It should. I'm too lazy to test by myself. tounge.gif

Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Thank you for all of your feedback, guys. I updated a fixed version in the hope that all bugs are gone. icon14.gif

 

 

Hope that this time mod's compatible with compact EXE? tounge.gif

It should. I'm to lazy to test by myself. tounge.gif

It will be, as long as you're not usng any hoodlum addresses or so (like you did in Full Nitro Control) icon14.gif

Link to comment
Share on other sites

 

... i still have a crash without 'sprites 128' line in stream.ini. I assumed 'not really needed' means what it means...

Well, I meant that you don't have to necessarily overwrite the stream.ini file, because you can add that line even manually. tounge2.gif

 

 

It will be, as long as you're not usng any hoodlum addresses or so (like you did in Full Nitro Control)  icon14.gif

I think you mean HOODLUM specific addresses. Then, I don't know.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Thank you for reporting another bug. icon14.gif

 

Modification updated.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Is there any way to get it working with SAMP, since SAMP loads own stream.ini

 

 

 

Edited by acid96
Link to comment
Share on other sites

  • 3 months later...

The problem described below isn't caused by Script Dependent Drawings.

 

 

{$CLEO}0390: load_txd_dictionary 'SPEEDO'038F: load_texture "Bck" as 1 // Load dictionary with 0390 firstwhile truewait 003F0: enable_text_draw 1074B: draw_texture 1 position 320.0 224.0 scale 100.0 100.0 angle 180.0 color_RGBA 255 255 255 255end
Did anyone notice a texture drawn with 074B opcode, with angle and drawn flipped horizontally as shown on picture?

 

554b85277501830.jpg

 

When scale becomes -100.0 100.0

it's good

Edited by fastman92
Link to comment
Share on other sites

I found a bug, the weapon icon desapears when I'm using the jetpack.

I don't get this bug on a clean game with such modification installed. I'm sorry, I cannot do anything.

 

Is there any way to get it working with SAMP, since SAMP loads own stream.ini

Somebody suggested to load settings from another file aswell. I'll see what I can do.

 

The problem described below isn't caused by Script Dependent Drawings...

I noticed this issue during my tests too and I ended up by keeping everything as it is. The main source is full of 074B commands drawing flipped textures. R* was probably aware about it, seems like it is intentional. Dunno why.

Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

  • 3 months later...

Any news on unconflicting this with modloader?

Link to comment
Share on other sites

  • 2 years later...

Crashes when starting with CLEO 4.3.21.

That's beacuse this mod was already implemented into CLEO4 some time ago:

-- 4.3.7 --* Text and texture/sprite draws are now script-dependant (doesn't affect main.scm scripts)

jYzLR2j.png

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.