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

How TXD image work in-game?


skatefilter5
 Share

Recommended Posts

I was testing the txd image and the game freezes or crashes when I type "txd"

I did load dictionary with 0390 first without another wait after 0ACD.

 

{$CLEO .cs}


0000: NOP

:START
wait 0
if
0ADC: test_cheat "txd"

jf @START
wait 0
0390: load_txd_dictionary 'TEST/VC1.txd'
0ACD: show_text_highpriority "TEST" time 2000

038F: load_texture "vc1" as [email protected] // Load dictionary with 0390 first
038D: draw_texture [email protected] position [email protected] [email protected] size [email protected] [email protected] RGBA 128 128 128 255

wait 4000
0391: release_textures


end_thread

Link to comment
Share on other sites

'TEST/VC1.txd'

 

the TXD must be inside of models\txd and only a name without an extension must be passed to the command 0390.

 

 

end_thread
It shouldn't be used in CLEO scripts.

 

You've got a long road of learning ahead of you before you can confidently say you know basics of coding at least.

Edited by fastman92
  • Like 3
Link to comment
Share on other sites

ZAZ and fastman92 have a point.

Go through your code multiple times and try to find what's causing the error yourself. This will significantly improve your script writing, as it's very likely you won't make a mistake twice after having figured out what caused it.

 

The script below is not tested, but I think it might work. Please take your time to read through it and compare it with your own. What's different and why. Also read the comments.

{$CLEO .cs}0000: NOP// Play around with these values  [email protected] = 0.0    // X-coordinate on [email protected] = 0.0    // Y-coordinate on [email protected] = 4.0    // X-Axis size multiplier of [email protected] = 4.0    // Y-Axis size multiplier of texture:STARTwait 10 if and   Player.Defined($PLAYER_CHAR)0ADC:   test_cheat "TXD" jf @START 0ACD: show_text_highpriority "TEST" time 2000 wait 20000A99: chdir 0 // set the directory for 0AAB: to the game root folder if 0AAB:   file_exists 'models/txd/VC1.txd'    // always a good idea to check whether the file actually existsjf @SHOW_ERROR 0390: load_txd_dictionary 'VC1' 038F: load_texture "VC1" as 1 // Load dictionary with 0390 first 038D: draw_texture 1 position [email protected] [email protected] size [email protected] [email protected] RGBA 128 128 128 255                               // according to opcodes.txt                               // you can load and draw the texture with adigit as handle, not a var as handle                              // if you want to find out how it's used, decompile main.scm and                              // look how the developers used itwait 4000 0391: release_textures jump @START :SHOW_ERROR0ACA: show_text_box "ERROR: TXD FILE NOT FOUND!"  // if txd does not exist show error and end thread:END0A93: end_custom_thread // in CLEO always use this, never 0043: end_thread

High-level version

 

 

{$CLEO}0000:// Play around with these values  [email protected] = 0.0    // X-coordinate on [email protected] = 0.0    // Y-coordinate on [email protected] = 4.0    // X-Axis size multiplier of [email protected] = 4.0    // Y-Axis size multiplier of texturewhile true    wait 10    if and     0256:   player $PLAYER_CHAR defined    0ADC:   test_cheat "txd"    then        0ACD: show_text_highpriority "TEST" time 2000        wait 2000        0A99: chdir 0 // set the directory for 0AAB: to the game root folder        if        0AAB:   file_exists 'models/txd/VC1.txd' // always a good idea to check whether the file actually exists        then            //            0390: load_txd_dictionary 'VC1'            038F: load_texture "vc1" as 1 // Load dictionary with 0390 first            038D: draw_texture 1 position [email protected] [email protected] size [email protected] [email protected] RGBA 128 128 128 255                            // according to opcodes.txt                // you can load and draw the texture with adigit as handle, not a var as handle                // if you want to find out how it's used, decompile main.scm and                // look how the developers used it                            wait 4000            0391: release_textures        else            0ACA: show_text_box "ERROR: TXD FILE NOT FOUND!"            break        end    endend0A93: end_custom_thread //  in CLEO scripts use this instead of 004E: end_thread

 

 

 

Another hint for the future: Stick close to your scripting tutorial and try everything new in small testing scripts and play around with it. This will improve your coding and broaden your knowledge. SCM Coding for Dummies and ZAZ's CLEO scripting tutorial are excellent choices.

 

I hope i could help out (and the code actually works :catspider: )

cheers

Edited by TheSiggi
Link to comment
Share on other sites

You don't need decorate your code with WAIT. Use it only to avoid infinite loop.

 

0390: load_txd_dictionary 'TEST/VC1.txd'

The parameter of this opcode can't exceed 8 chars. And... you should be sure this file exists. If you don't obey these limitations, the program behavoir is unexpected.

 

038F: load_texture "vc1" as [email protected] // Load dictionary with 0390 first

This opcode doesn't return a value. You should push a ordinal number of a slot in array of sprites.

Link to comment
Share on other sites

The wait for two and four seconds are just there to provide enought time to spot the differences in rendering, when he plays around with the values. There is no reason to use a loop checking for a local script timer over a wait for these purposes.

Link to comment
Share on other sites

Okay I'll try that code, I didn't know I can't only put it in models/txd only but good to know

Link to comment
Share on other sites

If you're working on III/VC, here is a short example code for VC that slides the KChat icon across the screen:

 

0390: load_txd_dictionary 'HUD' // loads from .\models for III/VC, .\models\txd for SA038F: load_texture 'RKCHAT' as 1 // use " (double quotes) for [email protected] = 100.003F0: enable_text_draw 1 while true    wait 0    if        00E1:   player 0 pressed_button 13  // camera key    then        03F0: enable_text_draw 0        break    end    038D: draw_texture 1 position [email protected] 100.0 size 64.0 64.0 RGBA 255 255 255 255    [email protected] += 1.0end
"HUD" refers to .\models\hud.txd. III/VC and SA has some differences but the concept should be the same. Like 033E that draws text on the screen, you should use 03F0 when drawing textures on the screen. This will likely conflict with other mods or parts of the game that does the same thing so be aware of that. Edited by spaceeinstein
Link to comment
Share on other sites

  • 2 weeks later...

Also the content of the local vars aren't given, so the game should display a texture with size of 0.0 x 0.0

can you use your brain first before posting such sh*t?

 

He does this every day. He posts stuff without even thinking.

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.