#1 11-05-2011 12:12

KnightFighter
Registered: 11-05-2011
Posts: 8

Помогите мне с Txd Draw Function

Есть ли возможный путь, чтобы сделать TXD draw function for GTA III?

Offline

#2 12-05-2011 12:21

Seemann
Registered: 07-08-2006
Posts: 2,080

Re: Помогите мне с Txd Draw Function

GTA III already has text draw opcodes. But only 2 text_draws in one time is allowed.

Offline

#3 12-05-2011 12:39

KnightFighter
Registered: 11-05-2011
Posts: 8

Re: Помогите мне с Txd Draw Function

How can i write a script that draws txd texture? write me an example?

Last edited by KnightFighter (12-05-2011 12:43)

Offline

#4 12-05-2011 17:32

Sergey81
Registered: 19-12-2008
Posts: 654

Re: Помогите мне с Txd Draw Function

@KnightFighter -

{$CLEO}
0000:
{05DF: write_memory 0x697C18 size 4 value 1000.0 virtual_protect 0   // Radardisc distance from bottom
05DF: write_memory 0x697B6C size 4 value 68.0 virtual_protect 0   // Weapon icon distance from top  /// 1000.0 if iv icons used  // 68.0 if not
05DF: write_memory 0x697B70 size 4 value 70.0 virtual_protect 0   // Weapon icon distance from right
05DF: write_memory 0x697B68 size 4 value 32.0 virtual_protect 0   // Weapon icon scale

//05DF: write_memory 0x697B74 size 4 value 1000.0 virtual_protect 0   // Weapon ammo text vetical scale 
05DF: write_memory 0x697B78 size 4 value 98.0 virtual_protect 0   // Weapon ammo text distance from top 
//05DF: write_memory 0x697B7C size 4 value 1000.0 virtual_protect 0   // Weapon ammo text distance from right
//05DF: write_memory 0x697B5E size 2 value 9504 virtual_protect 0   //    Format of Weapon Ammo (%d-%d)

05DF: write_memory 0x697B20 size 4 value 0.349999994 virtual_protect 0   // HUD Text horizontal scale
05DF: write_memory 0x697B50 size 4 value 0.75 virtual_protect 0   // HUD text vertical scale
05DF: write_memory 0x697B54 size 4 value 40.0 virtual_protect 0   // Money distance from top
05DF: write_memory 0x697B58 size 4 value 40.0 virtual_protect 0   // Money distance from right

05DF: write_memory 0x697BF0 size 4 value 53.0 virtual_protect 0   // Time distance from top
05DF: write_memory 0x697BF4 size 4 value 40.0 virtual_protect 0   // Time distance from right

05DF: write_memory 0x697B88 size 4 value 1000.0 virtual_protect 0   // Health and Armor distance from top
05DF: write_memory 0x697B98 size 4 value 1000.0 virtual_protect 0   //  Wanted stars distance from top
//05DF: write_memory 0x size 4 value .0 virtual_protect 0   //  }

16@ = -15000

while true
wait 0
0226: 1@ = actor $player_actor health
05E0: 2@ = read_memory 0x6FAD68 size 1 virtual_protect 0 //cutsc
05E6: 3@ = actor $player_actor struct
3@ += 710
05E0: 3@ = read_memory 3@ size 1 virtual_protect 0  //armour
3@ /= 2
//0092: 3@ = float 3@ to_integer
01C0: 4@ = player $player_char wanted_level
gosub @wpnpointer
//05E0: 7@ = read_memory 5@ size 4 virtual_protect 0

if
16@ <= 0
then 
0390: load_txd_dictionary 'iv_hud' 
038F: load_texture 'ring' as 1
038F: load_texture 'star1' as 4 
038F: load_texture 'star2' as 5 
038F: load_texture 'star3' as 6 
038F: load_texture 'star4' as 7 
038F: load_texture 'star5' as 8 
038F: load_texture 'star6' as 9  
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
16@ = 1
end
//05E0: 14@ = read_memory 0x8117F8 size 4 virtual_protect 0
if //or
//14@ == 0
05EE:  key_pressed 51
then
0391: release_textures
0390: load_txd_dictionary 'iv_hud'
038F: load_texture 'ring' as 1
038F: load_texture 'star1' as 4 
038F: load_texture 'star2' as 5 
038F: load_texture 'star3' as 6 
038F: load_texture 'star4' as 7 
038F: load_texture 'star5' as 8 
038F: load_texture 'star6' as 9  
end



if
16@ >= 1
then
//////drawing
05E0: 10@ = read_memory 0x12FEC4 size 4 virtual_protect 0  //X 1920
05E0: 11@ = read_memory 0x12FEC8 size 4 virtual_protect 0  //Y 1080
//////
//////
// ////1920x1080+
//12////1680x1050
//11////1600x1200
//10////1280x1024
//9////1280x960
//8////1280x800
//7////1280x768
//6////1280x720
//5////1152x864
//4////1024x768
//3////1024x600
//2////800x600
//1////640x480
if and
10@ == 1920 //X
11@ == 1080 //Y
then
{$I iv_hud_res\1920x1080.txt}
end

  

end
//end

:wpnpointer
if
02D8:   actor $PLAYER_ACTOR current_weapon == 0
then
7@ = 0
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 1
then
7@ = 1
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 2
then
7@ = 2
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 3
then
7@ = 3
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 4
then
7@ = 4
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 5
then
7@ = 5
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 6
then
7@ = 6
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 7
then
7@ = 7
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 8
then
7@ = 8
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 9
then
7@ = 9
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 10
then
7@ = 10
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 11
then
7@ = 11
end

if
02D8:   actor $PLAYER_ACTOR current_weapon == 12
then
7@ = 12
end
return

{:wpnpointer
05E6: 5@ = actor $PLAYER_ACTOR struct
5@ += 1284  
05E0: 6@ = read_memory 5@ size 1 virtual_protect 0 
05E6: 5@ = actor $PLAYER_ACTOR struct
5@ += 1032
6@ *= 24  
000A: 5@ += 6@ // integer values
//
//0085: 4@ = 5@ // integer values and handles 
//0085: 9@ = 5@ // integer values and handles
//4@ += 8    //ammo in clip
//9@ += 12    //total ammo                            
//05E0: @ = read_memory @ size 4 virtual_protect 0
//
return
const
RING_POS_X = 19.00
RING_POS_Y = 770.00
RING_SIZE_X = 323.0
RING_SIZE_Y = 212.0
STAR_POS_X = 1500.00
STAR_POS_Y = 50.00
STAR_SIZE_X = 256.00
STAR_SIZE_Y = 32.00
WPN_POS_X = 1500.0
WPN_POS_Y = 125.0
WPN_SIZE_X = 256.0
WPN_SIZE_Y = 128.0

MONEY_X = 545.0
MONEY_Y = 35.0

TIME_X = 545.0
TIME_Y = 47.0
end
{
position 163.00 892.00 size 283.0 210.0   - 1920x1080
position 106.93 495.56 size 150.93 116.67  - 1024x600

(163.00 / 1.875 + 20) = 106.93 = RING_POS_X
(892.00 / 1.8) = 495.56 = RING_POS_Y
(283.0 / 1.875) = 150.93 = RING_SIZE_X
(210.0 / 1.8) = 116.67 = RING_SIZE_Y
}

if and
816B:   not fading 
2@ == 0
then
03F0: enable_text_draw 1
038D: draw_texture 1 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255


if and
1@ > 0
1@ <=5
then
038F: load_texture 'hlth05' as 2 
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end 

if and
1@ > 5
1@ <=10
then
038F: load_texture 'hlth10' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end   


if and
1@ > 10
1@ <=15
then
038F: load_texture 'hlth15' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end  

if and
1@ > 15
1@ <=20
then
038F: load_texture 'hlth20' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 20
1@ <=25
then
038F: load_texture 'hlth25' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 25
1@ <=30
then
038F: load_texture 'hlth30' as 2 
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 30
1@ <=35
then
038F: load_texture 'hlth35' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 35
1@ <=40
then
038F: load_texture 'hlth40' as 2 
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 40
1@ <=45
then
038F: load_texture 'hlth45' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 45
1@ <=50
then
038F: load_texture 'hlth50' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 50
1@ <=55
then
038F: load_texture 'hlth55' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 55
1@ <=60
then
038F: load_texture 'hlth60' as 2  
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 60
1@ <=65
then
038F: load_texture 'hlth65' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 65
1@ <=70
then
038F: load_texture 'hlth70' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 70
1@ <=75
then
038F: load_texture 'hlth75' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 75
1@ <=80
then
038F: load_texture 'hlth80' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 80
1@ <=85
then
038F: load_texture 'hlth85' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 85
1@ <=90
then
038F: load_texture 'hlth90' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
1@ > 90
1@ <=95
then
038F: load_texture 'hlth95' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end
          
if
1@ > 95
then
038F: load_texture 'hlth100' as 2
038D: draw_texture 2 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

///////drawing armor
if and
3@ > 0
3@ <=5
then
038F: load_texture 'armr05' as 3 
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end 

if and
3@ > 5
3@ <=10
then
038F: load_texture 'armr10' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end   


if and
3@ > 10
3@ <=15
then
038F: load_texture 'armr15' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end  

if and
3@ > 15
3@ <=20
then
038F: load_texture 'armr20' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 20
3@ <=25
then
038F: load_texture 'armr25' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 25
3@ <=30
then
038F: load_texture 'armr30' as 3 
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 30
3@ <=35
then
038F: load_texture 'armr35' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 35
3@ <=40
then
038F: load_texture 'armr40' as 3 
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 40
3@ <=45
then
038F: load_texture 'armr45' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 45
3@ <=50
then
038F: load_texture 'armr50' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 50
3@ <=55
then
038F: load_texture 'armr55' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 55
3@ <=60
then
038F: load_texture 'armr60' as 3  
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 60
3@ <=65
then
038F: load_texture 'armr65' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 65
3@ <=70
then
038F: load_texture 'armr70' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 70
3@ <=75
then
038F: load_texture 'armr75' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 75
3@ <=80
then
038F: load_texture 'armr80' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 80
3@ <=85
then
038F: load_texture 'armr85' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 85
3@ <=90
then
038F: load_texture 'armr90' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end

if and
3@ > 90.0
3@ <=95.0
then
038F: load_texture 'armr95' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end    
          
if
3@ > 95.0
then
038F: load_texture 'armr100' as 3
038D: draw_texture 3 position RING_POS_X RING_POS_Y size RING_SIZE_X RING_SIZE_Y RGBA 255 255 255 255
end
                



//////////////////drawing weapons/stars/money

if
4@ == 1
then
038D: draw_texture 4 position STAR_POS_X STAR_POS_Y scale STAR_SIZE_X STAR_SIZE_Y RGBA 255 255 255 255
end

if
4@ == 2
then
038D: draw_texture 5 position STAR_POS_X STAR_POS_Y scale STAR_SIZE_X STAR_SIZE_Y RGBA 255 255 255 255
end

if
4@ == 3
then
038D: draw_texture 6 position STAR_POS_X STAR_POS_Y scale STAR_SIZE_X STAR_SIZE_Y RGBA 255 255 255 255
end

if
4@ == 4
then
038D: draw_texture 7 position STAR_POS_X STAR_POS_Y scale STAR_SIZE_X STAR_SIZE_Y RGBA 255 255 255 255
end

if
4@ == 5
then
038D: draw_texture 8 position STAR_POS_X STAR_POS_Y scale STAR_SIZE_X STAR_SIZE_Y RGBA 255 255 255 255
end

if
4@ == 6
then
038D: draw_texture 9 position STAR_POS_X STAR_POS_Y scale STAR_SIZE_X STAR_SIZE_Y RGBA 255 255 255 255
end


    
 
////////////////////////////weapon icons///////////////

if
7@ == 0
then  
038F: load_texture 'unarmed' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255
//15@ = 0
end


if
7@ == 1
then  
038F: load_texture 'bat' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end

if
7@ == 11
then  
038F: load_texture 'grenade' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end

if
7@ == 12
then  
038F: load_texture 'deton' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255   
//15@ = 0
end


if
7@ == 10
then  
038F: load_texture 'molotov' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end

if
7@ == 2
then  
038F: load_texture 'colt45' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255 
//15@ = 0
end


if
7@ == 4
then  
038F: load_texture 'shotgs' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end


if
7@ == 3
then  
038F: load_texture 'mcr_uzi' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end

if
7@ == 6
then  
038F: load_texture 'm4' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end

if
7@ == 5
then  
038F: load_texture 'ak47' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255  
//15@ = 0
end



if
7@ == 8
then  
038F: load_texture 'rocket' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255      
//15@ = 0
end

if
7@ == 9
then  
038F: load_texture 'flame' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255   
//15@ = 0
end


if
7@ == 7
then  
038F: load_texture 'sniper' as 13     
038D: draw_texture 13 position WPN_POS_X WPN_POS_Y scale WPN_SIZE_X WPN_SIZE_Y RGBA 255 255 255 255   
//15@ = 0
end     



{if 
15@ == 1
then
wait 0
//05DF: write_memory 0x697B6C size 4 value 68.0 virtual_protect 0   // Weapon icon distance from top  /// 1000.0 if iv icons used  // 68.0 if not
else
wait 1
//05DF: write_memory 0x697B6C size 4 value 1000.0 virtual_protect 0   // Weapon icon distance from top  /// 1000.0 if iv icons used  // 68.0 if not
end }


///////////////////text
05E0: 12@ = read_memory 0x941554 size 4 virtual_protect 0 // money
05E0: 13@ = read_memory 0x95CF70 size 2 virtual_protect 0 // time
//05E0: 14@ = read_memory 0x95CF70 size 4 virtual_protect 0 // time
//if
//5@ == 0
//then
//03F0: enable_text_draw 1
045B: draw_text_2numbers MONEY_X MONEY_Y GXT 'MONE' numbers 12@ 12@  // ~1~:~1~
//end
045B: draw_text_2numbers TIME_X TIME_Y GXT 'TIMM' numbers 13@ 14@  // ~1~:~1~





































   

end    

     
 end

Last edited by Sergey81 (12-05-2011 17:33)

Offline

#5 13-05-2011 10:25

KnightFighter
Registered: 11-05-2011
Posts: 8

Re: Помогите мне с Txd Draw Function

@Sergey81. Thank you very much!!!!

Offline

#6 13-05-2011 11:18

KnightFighter
Registered: 11-05-2011
Posts: 8

Re: Помогите мне с Txd Draw Function

Wait, the game crashes and where can i get the txd? can some one help?
cry=(:wow::rolleyes:
Подождите, игра вылетает и где я могу получить TXD? может кто-нибудь помочь?

Offline

#7 13-05-2011 19:37

Sergey81
Registered: 19-12-2008
Posts: 654

Re: Помогите мне с Txd Draw Function

@KnightFighter - http://dl.dropbox.com/u/13992625/gta/IV … 2final.rar
IV_Hud_for_GTA_III_1_2final.rar - beta_stuff.7z

Offline

#8 29-06-2011 01:53

VintProg_Pro
Registered: 17-06-2010
Posts: 153

Re: Помогите мне с Txd Draw Function

Вы что тут все по английский писать стали?

1. Не нужно заниматься археологией.
2. Считается хорошим тоном отвечать на том же языке, на котором задан вопрос.

Offline

Board footer

Powered by FluxBB