ThirteenAG Posted November 20, 2012 Share Posted November 20, 2012 (edited) I made a proper texture draw function, when i was working on gasoline and zonetext mods, but i didn't found a way to use it, and decided to make a little tutorial. There's what you need to know to make a texture mod:1) TXD. I just downloaded dalva's custom scope DSS.TXD. Then, using txd workshop, i converted it to vice city format, and left only one scope texture.2)CLEO. Well, draw function itself: CODE :draw_texture {example: 05F5: call_scm_func @draw_texture params 9 _and it is - position 220.0 170.0 size 191.25 170.0 RGBA 255 255 255 255 texture_id 1 } 05E0: [email protected] = read_memory 0xA0FD04 size 4 virtual_protect 1 //X 1920 05E0: [email protected] = read_memory 0xA0FD08 size 4 virtual_protect 1 //Y 1080 0093: [email protected] = integer [email protected] to_float 0093: [email protected] = integer [email protected] to_float //coordX = sa_coordX*(currentResX/640.0) 0015: [email protected] /= 640.0 // currentResX/640.0 0069: [email protected] *= [email protected] // floating-point values 0015: [email protected] /= 448.0 // currentResY/448.0 0069: [email protected] *= [email protected] // floating-point values 0069: [email protected] *= [email protected] // floating-point values 0069: [email protected] *= [email protected] // floating-point values 03F0: 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] 05F6: ret 0 Position and size values are independent to game resolution, just like in SA. They can be 0.0 - 640.0 for X, and 0.0 - 448.0 for Y.And the full code: CODE {$CLEO} 0000: 0390: load_txd_dictionary 'DSS' 038F: load_texture 'SCOPE' as 1 while true wait 0 gosub @AimingCheck if [email protected] == true then if 02D7: player $PLAYER_CHAR currentweapon == 28 //#SNIPER then 05DF: write_memory 0x5786A0 size 4 value 0x90 virtual_protect 1 05DF: write_memory 0x5786A0 size 2 value 0x28C2 virtual_protect 1 05DF: write_memory 0x5786A2 size 1 value 0x00 virtual_protect 1 05F5: call_scm_func @draw_texture params 9 _and it is - position 320.0 224.0 size 640.0 448.0 RGBA 255 255 255 255 texture_id 1 end else 05E0: [email protected] = read_memory 0x5786A0 size 1 virtual_protect 1 if [email protected] <> 0x8B then 05DF: write_memory 0x5786A0 size 4 value 0x0424448B virtual_protect 1 //restore CTexture__Draw end end end :draw_texture {example: 05F5: call_scm_func @draw_texture params 9 _and it is - position 220.0 170.0 size 191.25 170.0 RGBA 255 255 255 255 texture_id 1 } 05E0: [email protected] = read_memory 0xA0FD04 size 4 virtual_protect 1 //X 1920 05E0: [email protected] = read_memory 0xA0FD08 size 4 virtual_protect 1 //Y 1080 0093: [email protected] = integer [email protected] to_float 0093: [email protected] = integer [email protected] to_float //coordX = sa_coordX*(currentResX/640.0) 0015: [email protected] /= 640.0 // currentResX/640.0 0069: [email protected] *= [email protected] // floating-point values 0015: [email protected] /= 448.0 // currentResY/448.0 0069: [email protected] *= [email protected] // floating-point values 0069: [email protected] *= [email protected] // floating-point values 0069: [email protected] *= [email protected] // floating-point values 03F0: 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] 05F6: ret 0 :AimingCheck 05E6: [email protected] = actor $PLAYER_ACTOR struct [email protected] += 0x244 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 1 if [email protected] <> 0x0C then [email protected] = false else [email protected] = true end return Download example[full mod below] - [VC]Custom_Sniper_Scope.zip Edited July 31, 2015 by TJGM Widescreen Fixes Pack || Project2DFX || SaveLoader || WindowedMode || CLEO Scripts Link to comment Share on other sites More sharing options...
THE_MOSTWANTED Posted July 31, 2015 Share Posted July 31, 2015 When I aim my screen turn white could u please help me Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now