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

[GTA Vice City]How to draw textures onscreen from .TXD file?


CharlesVercetti
 Share

Recommended Posts

CharlesVercetti

Hello guys!

 

I have one question.

 

I am having problems with drawing textures.

 

I have written code but it crashed,dunno why.

 

Read recent posts for code[wip].

Edited by TommyCJFaann
Link to comment
Share on other sites

First of all,it had just been a day,no need to bump this,you'll get help,eventually.

 

I think you should load the 'texture dictionary' first with Opcode 0390,then use Opcode 038F to load the texture you want to use from the texture dictionary you specified in Opcode 0390 and then you you draw the texture with Opcode 038D.

Link to comment
Share on other sites

Thanks but please,give an example.

I mainly used Google to answer your question,so why don't you do the same and take a look by yourself.

Link to comment
Share on other sites

CharlesVercetti

It shows codes for SA only.I need for VC.

Link to comment
Share on other sites

CharlesVercetti

Hello guys!Please!

 

Is there no CLEO coders around,I don't know how I could arrange the opcodes Danikov provided.Please,I need a solution as soon as possible.

Link to comment
Share on other sites

But these opcodes are for VC too.

Link to comment
Share on other sites

CharlesVercetti

But these opcodes are for VC too.

Man,i meant i don't know how to put them in a right order.I wanted it to make it appear with a key press.

 

Should I use the txdAdd,txdLoad....*something*... commands?(actually memory addresses.)

Edited by TommyCJFaann
Link to comment
Share on other sites

The good thing about cleo scripts is that they can be easily decompiled by drag and drop into the sannybuilder. Just search for a mod that does something similar (perhaps a speedometer mod) and decompile it to see how to use the commands. You can also decompile main.scm etc.

Link to comment
Share on other sites

CharlesVercetti

The good thing about cleo scripts is that they can be easily decompiled by drag and drop into the sannybuilder. Just search for a mod that does something similar (perhaps a speedometer mod) and decompile it to see how to use the commands. You can also decompile main.scm etc.

VC doesn't have CLEO Speedo mods.BTW guys,nobody seems to reply the perfect solution.Thank you!

Link to comment
Share on other sites

Why not look up how any of DOZENS of SA mods do it?

Link to comment
Share on other sites

  • 1 month later...
CharlesVercetti

Sorry for bumping,but I tried ThirteenAG's SA texture draw method,and got a grey box on screen.

 

I actually added the TXD dictionary and the texture in the code,still it didn't work.

 

P.S:If you need the code,PM me.

Link to comment
Share on other sites

CharlesVercetti

Still,I have got no help.This doesn't need a Google Search,it needs some coder's help.

Link to comment
Share on other sites

You ask people to PM you to help you and you're wondering why you get no replies? Really?

Link to comment
Share on other sites

Post your code and we'll tell you exactly what's wrong with it.

Link to comment
Share on other sites

You can look for drawing examples in GTA SA's main.scm. III and VC use same opcodes for this.
And also here

Edited by _DK
Link to comment
Share on other sites

One problem that may occur:

 

http://gtag.gtagaming.com/opcode-database/opcode/074B/

 

A command that's used in every speedometer that has a rotated texture of needle drawn on screen, exists only in GTA SA

It's a command with ID of 0x074B

Link to comment
Share on other sites

CharlesVercetti

Luckily I corrected the code myself,but it crashed again!

Here is the code.

{$CLEO .cs}//-------------MAIN---------------0000: NOPwait 2000391: release_textures0390: load_txd_dictionary 'texture' // never used in VC or GTA 3038F: load_texture 'texture' as 1 // Load dictionary with 0390 first      :SHOW_TEXTUREwait 0 if 05EE:   key_pressed 80 //VK_... jf @HIDE_TEXTURE 05F5: call_scm_func @draw_texture params 9 _and it is - position 560.0 320.0 size 80.0 180.0 RGBA 128 128 128 192 texture_id 1 05DF: write_memory 6913008 size 4 value 290.0 virtual_protect 0 05DF: write_memory 6913012 size 4 value 56.0 virtual_protect 0 :HIDE_TEXTUREif 85EE:   not key_pressed 80 //VK_... jf @END05F5: call_scm_func @draw_texture params 9 _and it is - position 920.0 724.0 size 240.0 248.0 RGBA 255 255 255 255 texture_id 105DF: write_memory 6913008 size 4 value 1000.0 virtual_protect 0 05DF: write_memory 6913012 size 4 value 40.0 virtual_protect 0 :ENDjump @SHOW_TEXTURE :draw_texture05E0: [email protected] = read_memory 0xA0FD04 size 4 virtual_protect 1  //X 192005E0: [email protected] = read_memory 0xA0FD08 size 4 virtual_protect 1  //Y 10800093: [email protected] = integer [email protected] to_float0093: [email protected] = integer [email protected] to_float //coordX = sa_coordX*(currentResX/640.0) 0015: [email protected] /= 640.0 //  currentResX/640.00069: [email protected] *= [email protected] // floating-point values 0015: [email protected] /= 448.0 //  currentResY/448.00069: [email protected] *= [email protected] // floating-point values0069: [email protected] *= [email protected] // floating-point values0069: [email protected] *= [email protected] // floating-point values03F0: enable_text_draw 1 038D: draw_texture [email protected] position [email protected] [email protected] size [email protected] [email protected] RGBA [email protected] [email protected] [email protected] [email protected]: ret 0

I was testing with the texture positions for almost five times,and suddenly it crashed.

This time,I used 05F5 opcode.

Link to comment
Share on other sites

CharlesVercetti

Yes,man. I am not that bad. :D

Link to comment
Share on other sites

CharlesVercetti

well, your script works for me

Is it?Well,that's not a problem actually.

 

After several times of restarting game and recompiling again and again,it crashed.

(could you send me the compiled file?)

Link to comment
Share on other sites

CharlesVercetti

Your compiled script worked!

 

Hmmm...It seems I can't open the script,says errors

 

Unknown opcode 6574 at offset 11.
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.