Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   large status bar ammounts (https://forums.graalonline.com/forums/showthread.php?t=15219)

Warcaptain 10-23-2001 02:16 AM

large status bar ammounts
 
i know the forumula for status bars, but they dont work if the current ammt goes over the pixel width, it doesnt work anymore.

anyone know how to fix it?

ownerofbabylon 10-23-2001 02:30 AM

I have a sample that someone gave me. Send me an IM on AIM and I can show you...

Xaviar 10-23-2001 02:30 AM

Re: large status bar ammounts
 
Quote:

Originally posted by Warcaptain
i know the forumula for status bars, but they dont work if the current ammt goes over the pixel width, it doesnt work anymore.

anyone know how to fix it?

Why would you need your pixel amount to go over? Maybe I could help you if I better understood what you needed...

ownerofbabylon 10-23-2001 02:33 AM

I think he means like if its made for 3 hearts (and HP Bar) and they get 4 hearts or something. You just script it to check the number of hearts they have and have the bar be divided into smaller sections.

Xaviar 10-23-2001 02:36 AM

Quote:

Originally posted by ownerofbabylon
I think he means like if its made for 3 hearts (and HP Bar) and they get 4 hearts or something. You just script it to check the number of hearts they have and have the bar be divided into smaller sections.
Use division to get percentages ;)

ownerofbabylon 10-23-2001 02:37 AM

hes so smart... :D

btedji 10-23-2001 03:16 AM

make sure when bars get to 0 that you make it so it wont try to show a width of 0 in a img part because then it will show a full bar :D

Xaviar 10-23-2001 05:54 AM

Quote:

Originally posted by btedji
make sure when bars get to 0 that you make it so it wont try to show a width of 0 in a img part because then it will show a full bar :D
;) Forgot about that part

Warcaptain 10-23-2001 06:15 AM

no no no.....

like the bomy life system, is based on hp, but if the current ammount of hp goes over the pixel width, it will not show correctly, just the whole image, not the part.

TDO2000 10-23-2001 06:25 AM

hmmm i think I understand if ure Pic is 100 Pixel and the HP 101 it's a problem hmmm I think u have 2 possibilities:
1. U can only have the same amount of hp as the pixel with
or
2. if the amount of hp is bigger then the pixel with u just show it as full lifes

example:
100 pixel
120 hp (this.hp for example)

if(this.hp <=100){
normal use;
}
else {
showimg ....
changeimgpart index,x,y,int(100),14;
}


so it's not shown if u have more hp but u can't also see the full image...

Warcaptain 10-23-2001 07:03 AM

Quote:

Originally posted by TDO2000
hmmm i think I understand if ure Pic is 100 Pixel and the HP 101 it's a problem hmmm I think u have 2 possibilities:
1. U can only have the same amount of hp as the pixel with
or
2. if the amount of hp is bigger then the pixel with u just show it as full lifes

example:
100 pixel
120 hp (this.hp for example)

if(this.hp <=100){
normal use;
}
else {
showimg ....
changeimgpart index,x,y,int(100),14;
}


so it's not shown if u have more hp but u can't also see the full image...



*confused*

:confused: :confused: :confused:

TDO2000 10-23-2001 07:05 AM

ummm
1. max HP count = pixel width
2. if Hp is bigger just show the full bar and don't use your formular

(Noone understands me *crying*)

Warcaptain 10-23-2001 07:12 AM

listen.

if the max hp is 200 and the pixel width is 100, it will get to 100 and still show the part, but then at 101, it will show the full bar, which is bad

Xaviar 10-23-2001 07:58 AM

Quote:

Originally posted by Warcaptain
listen.

if the max hp is 200 and the pixel width is 100, it will get to 100 and still show the part, but then at 101, it will show the full bar, which is bad

int( ( currenthp / maxhp ) * 100 )

LiquidIce00 10-24-2001 06:34 AM

someone doesnt pay attention to their math classes:rolleyes:

should be what xaviar said but u can also do
(maxhp/currenthp)*maxwidth
if ur maxwidth is diff. then 100

Xaviar 10-24-2001 07:33 AM

Quote:

Originally posted by LiquidIce00
someone doesnt pay attention to their math classes:rolleyes:

should be what xaviar said but u can also do
(maxhp/currenthp)*maxwidth
if ur maxwidth is diff. then 100

Nu uh!! It is too current over max, isn't it?? Cause you want a decimal less than 1

LiquidIce00 10-24-2001 07:46 AM

Quote:

Originally posted by Xaviar


Nu uh!! It is too current over max, isn't it?? Cause you want a decimal less than 1

LOL yeah i misstyped .. and i forgot the int() . i was doing guilds wasnt paying attention x.x


All times are GMT +2. The time now is 01:35 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.