Jump to content

Making A Realistic Body Armour Bar On The HUD.. Is It Possible? [SA Classic]


ArmanCan

Recommended Posts

Well.. we all know that Body Armour size doesn't change no matter how many times do you complete vigilante.. I'm finding it little bit wrong and i'm looking for to change it's default and maxed out size so it will be more realistic 😀 I've already checked the main.scm and ACE HUD but i couldn't find any infos in .scm and ACE HUD was way too complicated for me.. How can i change it with a CLEO Script?

 

Thanks in advance.. have a nice day, afternoon, night whatever 😀

Link to comment
Share on other sites

JohnDoe4444
055F: set_player $PLAYER_CHAR max_armour += 150


Note that the armor integer is limited to 250, and if you try going more than that, that value will be divided and what's left of the division will be the max armor, e.g. if you set the max armor value to 300 (by using the aforementioned opcode and setting the value to 200 since it's an addition operation), it will be automatically converted to merely 50, or if you set it to 1100, it will divide it to 250, and 100 will be left, which is the game's default. I have no idea how you can go above that value though.


Same thing was actually applied in Vice City, once you reach 100% if I'm correct, where the max armor will be set to 200. AFAIK nothing like that was implemented in SA, however it's not because it's not technically possible, as I've demonstrated. Matter of fact, the Max Armour stat is still available in the stats menu under the player section, and that was how I found the max possible value was 250.

P.S. The HUD size of the armor bar will undergo no change, it will remain the same size no matter what.

Edited by JohnDoe4444
Link to comment
Share on other sites

2 hours ago, JohnDoe4444 said:

P.S. The HUD size of the armor bar will undergo no change, it will remain the same size no matter what.

Actually that was the point.. according to the body armor values the size should change.. 😀

 

spacer.png

 

I did a research and found different opcodes.. i think i can prepare myself a cleo script but i'm not sure if it is going to work.. check this out..😉

 

{$CLEO .cs}
0000:
create_thread @Models
create_thread @Health
create_thread @Cash
create_thread @Wanted
create_thread @Timethread 'Models':Models

wait 500
end_thread
thread 'Health':Health
wait 200
if and
    8118:   not actor $PLAYER_ACTOR dead
    Actor.Defined($PLAYER_ACTOR)
jf @Health
    03F0: enable_text_draw 1
    035F: actor $PLAYER_ACTOR armour += 100 // Just for armor test ( If you have no armor , the bar is empty )
wait 800
repeat

//__________________start of repeat_______________________

wait 0

////////////Health////////////

0@ = Actor.Health($PLAYER_ACTOR)
008F: 1@ = integer 0@ to_float
0097: make 1@ absolute_float
038E: draw_box_position 80.0 40.0 size 103.0 6.0 RGBA 0 0 0 255
038E: draw_box_position 80.0 40.0 size 1@ 3.0 RGBA 109 208 246 240
038E: draw_box_position 80.0 39.0 size 103.0 3.0 RGBA 0 0 0 100         

////////////////////////////////////////////////Armour////////////

04DD: 2@ = actor $PLAYER_ACTOR armour
008F: 3@ = integer 2@ to_float
0097: make 3@ absolute_float
0017: 3@ /= 2.0
038E: draw_box_position 55.0 33.0 size 53.0 6.0 RGBA 0 0 0 255
038E: draw_box_position 55.0 33.0 size 3@ 3.0 RGBA 255 255 255 240
038E: draw_box_position 55.0 32.0 size 53.0 3.0 RGBA 0 0 0 100

////////////////////////////////////
Edited by ArmanCan
Link to comment
Share on other sites

JohnDoe4444
2 hours ago, ArmanCan said:

Actually that was the point.. according to the body armor values the size should change.. 😀

sh*t...

 

Also according to the image you sent I made a minute mistake, the max value for armor is 255 (256 total number of allowed values, from 0-255, 256 being of course a multiple of 2 and 4)

 

04DD: 2@ = actor $PLAYER_ACTOR armour
008F: 3@ = integer 2@ to_float
0097: make 3@ absolute_float
0017: 3@ /= 2.0
038E: draw_box_position 55.0 33.0 size 53.0 6.0 RGBA 0 0 0 255
038E: draw_box_position 55.0 33.0 size 3@ 3.0 RGBA 255 255 255 240
038E: draw_box_position 55.0 32.0 size 53.0 3.0 RGBA 0 0 0 100

Now, correct me if I'm wrong, but doesn't the box size change correspond to its center? It would make things tough. All in all, pretty neat little snippet of code there pal, good job.

 

Edited by JohnDoe4444
Link to comment
Share on other sites

41 minutes ago, JohnDoe4444 said:

All in all, pretty neat little snippet of code there pal, good job.

These were just an example opcodes that i found in this forum.. let me use this and make myself a test script.. i will post the result here if i get something 😉

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
  • 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.