Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
CharlesVercetti

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

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

Share this post


Link to post
Share on other sites
CharlesVercetti

Guys please I need it a lot.

Share this post


Link to post
Share on other sites
Danikov

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.

Share this post


Link to post
Share on other sites
CharlesVercetti

Thanks but please,give an example.

Share this post


Link to post
Share on other sites
Danikov

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.

Share this post


Link to post
Share on other sites
CharlesVercetti

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Silent

But these opcodes are for VC too.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
goodidea82

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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites
CharlesVercetti

So you don't know that,man?

Share this post


Link to post
Share on other sites
Silent

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
CharlesVercetti

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

Share this post


Link to post
Share on other sites
Silent

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

Share this post


Link to post
Share on other sites
Deji

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

Share this post


Link to post
Share on other sites
DK22Pac

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

Share this post


Link to post
Share on other sites
fastman92

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
ZAZ

do you have a file in models folder with name texture.txd ?

and does this file contain the image "texture" ?

Share this post


Link to post
Share on other sites
CharlesVercetti

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

Share this post


Link to post
Share on other sites
ZAZ

well, your script works for me

Share this post


Link to post
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?)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
ZAZ

did you use newest sannybuilder version for decompiling?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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