IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Usage of textures inside effectsPC.txd

 An example
 
DK22Pac  
Posted: Tuesday, Apr 10 2012, 17:11
Quote Post


Assembly. / Acceмбли.
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



Here we go tounge.gif
CODE
{$CLEO}
0000:
while true
   wait 0
   0AA7: call_function 0x731850 num_params 1 pop 1 "fx" 5@
   if
       5@ <> -1
   then
       0AB1: @txdIndexToRwTexDictionary 1 5@ 6@
       if
           6@ <> 0
       then
           0AA7: call_function 0x7F39F0 num_params 2 pop 2 "Overdoseeffects" 6@ 7@
           if
               7@ > 0
           then
               // Now, we have RwTexture adress in 7@
               // I gonna change coronastar's adress to this
               0A8C: write_memory 0xC3E000 size 4 value 7@ virtual_protect 0
           end
       end
   end      
end                                                                        
               
:txdIndexToRwTexDictionary
0A8D: 1@ = read_memory 0xC8800C size 4 virtual_protect 0                                                                                
0A8E: 2@ = 1@ + 4
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
005A: 2@ += 0@
0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0
if
   2@ > 0
then
   0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
   0@ *= 12
   005A: 1@ += 0@
   0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
else
   1@ = 0
end
0AB2: ret 1 1@

user posted image
Users WebsitePM
  Top
 

 
Joni2030  
Posted: Wednesday, Apr 11 2012, 16:28
Quote Post


Prankster
Group Icon
Group: Members
Joined: Jul 6, 2011

sf.gif

XXXXX



this is wrong section put it modding tutorials
Users WebsitePM
  Top
 

 
Link2012  
Posted: Wednesday, Apr 11 2012, 16:37
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



QUOTE (Joni2030 @ Wednesday, Apr 11 2012, 13:28)
this is wrong section put it modding tutorials

It's a trick, not a tutorial, tutorial explains things.

btw, Very good DK smile.gif
PMMSN
  Top
 

 
DK22Pac  
Posted: Tuesday, Apr 17 2012, 16:17
Quote Post


Assembly. / Acceмбли.
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



Yay! I've bring better example, but in all, code just looking trash, I hope I'll have time to write my own textDrawer (actually, "shape-drawer" colgate.gif ) with many functions later.
CODE
{$CLEO}
gosub @_patch

// main loop
while true
   wait 0
   0@v = "fx"
   4@v = "OverdoseEffects"
   0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 100.0 size 80.0 80.0 RGBA 255 255 255 255
   0@v = "fonts"
   4@v = "font1"
   0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 200.0 size 80.0 80.0 RGBA 255 255 255 255
   0@v = "sniper"
   4@v = "SNIPERcrosshair"
   0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 300.0 size 80.0 80.0 RGBA 255 255 255 255
   0@v = "male01"
   4@v = "male01"
   0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 400.0 size 80.0 80.0 RGBA 255 255 255 255
end

// trash
:drawTexture
0AA7: call_function 0x731850 num_params 1 pop 1 0@v 25@
if
   25@ <> -1
then
   0AB1: @txdIndexToRwTexDictionary 1 25@ 26@
   if
       26@ <> 0
   then
       0AA7: call_function 0x7F39F0 num_params 2 pop 2 4@v 26@ 27@
       if
           27@ > 0
       then
           03F0: enable_text_draw 1
           0A8C: write_memory 0x46E62A size 2 value 0x04EB vp 1
           074B: draw_texture -1 position 8@ 9@ scale 10@ 11@ texture 27@ color_RGBA 12@ 13@ 14@ 15@
           0A8C: write_memory 0x46E62A size 2 value 0x0DD8 vp 1
       end
   end
end
0AB2: ret 0                
:txdIndexToRwTexDictionary
0A8D: 1@ = read_memory 0xC8800C size 4 virtual_protect 0                                                                                
0A8E: 2@ = 1@ + 4
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
005A: 2@ += 0@
0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0
if
   2@ > 0
then
   0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
   0@ *= 12
   005A: 1@ += 0@
   0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
else
   1@ = 0
end
0AB2: ret 1 1@
:_patch
0AC6: 0@ = label @__newTypeTexDrawer offset
0AC6: 1@ = label @__jmp offset
0AB1: call_scm_func @asmdef 4 asm_inj 0@ jump_from 0x46499D then_jump 0x4649A3 offset_jump_in_asm 1@
return
:asmdef
0A8C: write_memory 1@ size 1 value 0xE9 virtual_protect 1
0085: 4@ = 1@
4@ += 5
0062: 0@ -= 4@
1@ += 1
0A8C: write_memory 1@ size 4 value 0@ virtual_protect 1
0085: 4@ = 3@
4@ += 5
0062: 2@ -= 4@
3@ += 1
0A8C: write_memory 3@ size 4 value 2@ virtual_protect 1
0AB2: ret 0
:__newTypeTexDrawer
hex
   66 81 7E 06 FF FF 74 36 D9 46 0C 8B 56 08 8D 46 1C D9 5C 24 50 D9 46 10 50 8D 4C 24 48 51 8D 4E 18 D9
   5C 24 54 89 54 24 4C D9 46 14 D9 5C 24 50 B8 50 83 72 00 FF D0 B8 84 4B 46 00 FF E0 8B 06 48 83 F8 04
end
:__jmp
hex
   E9 00 00 00 00
end


This post has been edited by DK22Pac on Tuesday, Apr 17 2012, 16:28
Users WebsitePM
  Top
 

 
Deji  
Posted: Tuesday, Apr 17 2012, 21:08
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



Wouldn't it be much better to use pointers than that really weird method of passing each var containing parts of the string? tounge2.gif
Users WebsitePM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG