Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-09-2007, 11:23 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
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?
Reply With Quote
  #2  
Old 01-09-2007, 11:29 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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)
Reply With Quote
  #3  
Old 01-09-2007, 11:48 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
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

Last edited by projectigi; 01-10-2007 at 12:04 AM..
Reply With Quote
  #4  
Old 01-10-2007, 12:52 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
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.
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 01-10-2007, 03:09 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Angel_Light View Post
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.
He wants other people to be able to see the bar when they hover their mouse. I am pretty sure you can't read other people's client(r). flags clientside. Plus, updating 0.05 serverside isn't a nice idea ...
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #6  
Old 01-10-2007, 03:41 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
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.
__________________
Reply With Quote
  #7  
Old 01-10-2007, 06:57 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
huh
what exactly do you mean by that
Reply With Quote
  #8  
Old 01-11-2007, 12:02 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Quote:
Originally Posted by projectigi View Post
huh
what exactly do you mean by that
He means, put a script in a gani to show the HP bar, but only show the images when the mouse is over the player.. EG

NPC Code:


...

function update_bar() { ...some code to draw the HP Bars... }
function hide_bar() { ...some code to hide the HP Bars... }
function onTimeout() {
if(... some code to check if the mouse is on the player...) {
update_bar();
} else {
hide_bar();
}
setTimer(0.05);
}

...

__________________

subliminal message: 1+1=3
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:44 AM.


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