luizragna 41 Posted June 4, 2018 (edited) Hello guys, i'm making a custom hp bar system for mob units. The command show the HP of the mob for all players in the map. I am using the cutin command, the problem is that I do not think so many files are necessary. In the case 1 image for each percentage of hp I would like your opnion and help to improve this system and make it lighter. Test yourselves :). HP Bar System: payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.HP_Bar == 0) { .HP_Bar = 1; .mobGID = monster ("payon",148,226,"[T] HP Test",POPORING,1,strnpcinfo(0)+"::OnDie"); setunitdata .mobGID,UDT_MAXHP,4000; setunitdata .mobGID,UDT_HP,4000; .@count = getunits(BL_PC, .@units, false, "payon"); for (.@i = 0; .@i < .@count; .@i++) addtimer(0,strnpcinfo(0)+"::OnHPBar", .@units[.@i]); } end; OnDie: .HP_Bar = 0; end; OnHPBar: .U_MAXHP = getunitdata (.mobGID,UDT_MAXHP); while (.HP_Bar != 0) { .U_HP = getunitdata (.mobGID,UDT_HP); .P_HP = (.U_HP*100)/.U_MAXHP; cutin(""+.P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Donwload of the data folder files: HP Bar System (2018-06-26).rar Edited June 26, 2018 by luizragna Upgrade 4 10 AnnieRuru, CDER, zikoziz and 11 others reacted to this Quote Share this post Link to post Share on other sites
Habilis 119 Posted June 4, 2018 Very nice, but I think it would be annoying to do that for every single mob? Could be a nice feature for Boss mobs though. 1 luizragna reacted to this Quote Share this post Link to post Share on other sites
luizragna 41 Posted June 4, 2018 @Habilis I am creating some devil squares and put this system in the bosses. Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted June 5, 2018 Move to Script Release nice idea !! if combine this with World Boss system I can see a lot of potential in this 4 Habilis, luizragna, vykimo and 1 other reacted to this Quote Share this post Link to post Share on other sites
Habilis 119 Posted June 5, 2018 Combining, Thx for idea! 1 luizragna reacted to this Quote Share this post Link to post Share on other sites
bWolfie 138 Posted June 5, 2018 nice idea good work 1 luizragna reacted to this Quote Share this post Link to post Share on other sites
Begin 11 Posted June 15, 2018 Looking forward to this! Quote Share this post Link to post Share on other sites
Blinzer 6 Posted June 25, 2018 i must be retarded but it doesn't work when i load it up Quote Share this post Link to post Share on other sites
luizragna 41 Posted June 25, 2018 9 minutes ago, Blinzer said: i must be retarded but it doesn't work when i load it up Do you put the images in your data? (and not in GRF) Quote Share this post Link to post Share on other sites
Habilis 119 Posted June 26, 2018 There is a small problem some clients cant display it if inside a folder inside /illust But works good if directly inside /illust My client won't ex: /illust/hpbar/0.bmp [won't work] ex: /illust/0_hpbar.bmp [Works] 1 luizragna reacted to this Quote Share this post Link to post Share on other sites
luizragna 41 Posted June 26, 2018 (edited) 16 hours ago, Habilis said: There is a small problem some clients cant display it if inside a folder inside /illust But works good if directly inside /illust My client won't ex: /illust/hpbar/0.bmp [won't work] ex: /illust/0_hpbar.bmp [Works] Yes, the illust folder don't like subfolders I improved the topic to avoid problems Edited June 26, 2018 by luizragna 2 bWolfie and Habilis reacted to this Quote Share this post Link to post Share on other sites
Blinzer 6 Posted July 3, 2018 On 6/25/2018 at 6:15 PM, luizragna said: Do you put the images in your data? (and not in GRF) what is the npc supposed to do ingame exactly? because i think it's the npc that's not working. Quote Share this post Link to post Share on other sites
luizragna 41 Posted July 3, 2018 5 hours ago, Blinzer said: what is the npc supposed to do ingame exactly? because i think it's the npc that's not working. He makes a mob with a HP Bar. Do you added the data files? Quote Share this post Link to post Share on other sites
Blinzer 6 Posted July 3, 2018 5 hours ago, luizragna said: He makes a mob with a HP Bar. Do you added the data files? dude, the npc doesn't spawn anything for me. Quote Share this post Link to post Share on other sites
luizragna 41 Posted July 3, 2018 1 hour ago, Blinzer said: dude, the npc doesn't spawn anything for me. Strange, does some error appear somewhere? Quote Share this post Link to post Share on other sites
Blinzer 6 Posted July 4, 2018 (edited) Yeah, sec Edited July 4, 2018 by Blinzer Quote Share this post Link to post Share on other sites
Blinzer 6 Posted July 4, 2018 (edited) 7 hours ago, luizragna said: Strange, does some error appear somewhere? Quote Loading NPC file: npc/cities/limitless.txt[K [1m[31m[Error][0m: [?5h [?5lscript error in file 'npc/cities/limitless.txt' line 204 column 4 parse_line: expect command, missing function name or calling undeclared function 201: { 202: .HP_Bar = 1; 203: .mobGID = monster ("payon",148,226,"[T] HP Test",POPORING,1,strnpcinfo(0)+"::OnDie"); * 204: [1m[31ms[0metunitdata .mobGID,UDT_MAXHP,4000; [1m[36m~~~~~~~~~~~~~~~~~~~~~~~~[0m[1m[32m^[0m 205: setunitdata .mobGID,UDT_HP,4000; 206: .@count = getunits(BL_PC, .@units, false, "payon"); 207: for (.@i = 0; .@i < .@count; .@i++) Edited July 4, 2018 by Blinzer Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted July 4, 2018 1 hour ago, Blinzer said: Update your Hercules? Quote Share this post Link to post Share on other sites
Blinzer 6 Posted July 4, 2018 13 hours ago, Dastgir said: Update your Hercules? yikes Quote Share this post Link to post Share on other sites
Maple 6 Posted February 11, 2019 how to make this bar appear on all mvp monsters? Quote Share this post Link to post Share on other sites
vykimo 68 Posted March 8, 2019 (edited) Cool idea. Unfortunately I think it has no better solution than 100 cutin image... An idea to optimize it is to pass all your images in a bmp compressor. And another idea is to delete 1 image every 2 images (or more) : you will divide required images per 2 but you'll loose precision. However, I think a 1% precision isn't required. Edited March 8, 2019 by vykimo 1 Maple reacted to this Quote Share this post Link to post Share on other sites