![]() |
HP Bars...
Hi,
I'm trying to make a Health Bar :P Well a) is there a way to hide serv-side shown images(index under 100 or something like this) from certain players? b) how much would it lag if ~50% of the players would change one of their attr vars every 0.05 secs? c) how much would it lag if ~80% of the players would read a attr var of ~25% of the players every 0.05 secs? |
Why do you need to change it each 0.05 seconds? Most hp-bar system just set the attr(s) when the hp is changing, and some gani script is then displaying it
(one attr for the gani script, one for the value to display) |
Well the HP Bar only shows if you hover on the player
Now this wouldnt be a Problem but i want to have 2 bars You know Like the curretn bar is <=================> = means first bart - means seconds bar _ mean empty now it player gets hurt so it would be like this <==============___> but i want it like this: <==============---> <==============--_> <==============-__> <==============___> now the prob is when rehovering the old info gets deleted :P So either that second bar has to be saved in the attr string, then it would be needed to modify that string every 0.05 secs to make it decreasing or i will make an object/array holding the information of the hp bars that were gathered while hovering and after the decreasing/whatever finished the info gets deleted(would require reading out the new player data, so read-access on the attr vars of all players that are in the array) OR writing it in the attr var itself(read/write access from the player to change his/her own attr var) and if there are any other ways to do this, please tell me :x |
It could be almost lagless if your using a graal gui. If you use clientr.foo it wont lag if you update 0.05 also.
|
Quote:
|
a) Have a gani script always active, but only show the information if the mouse is in the right position.
b) It hasn't created any lag in my experience, but I haven't had the chance to try with many players at once. c) Reading variables shouldn't create lag, as they're readily accessible and you don't have to "request" them or anything. Looping through all the players would give you as much lag as a custom chat system would, namely about none. If reading them does actually take a "request" or whatever, then the answer to b) would most likely be none. |
huh
what exactly do you mean by that |
Quote:
NPC Code: |
All times are GMT +2. The time now is 11:11 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.