Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   HUD events... (https://forums.graalonline.com/forums/showthread.php?t=134259472)

xAndrewx 06-11-2010 08:42 PM

HUD events...
 
Well, is there an update event for such things as


HTML Code:

onMPUpdated()
onAPUpdated()
onHPUpdated()

If not- why isn't there??!

Deas_Voice 06-11-2010 08:52 PM

why would you need such events?

DustyPorViva 06-11-2010 08:53 PM

Quote:

Originally Posted by Deas_Voice (Post 1581420)
why would you need such events?

I guess to make a HUD that doesn't rely on timeouts to stay updated.

Deas_Voice 06-11-2010 09:07 PM

Quote:

Originally Posted by DustyPorViva (Post 1581421)
I guess to make a HUD that doesn't rely on timeouts to stay updated.

isn't he talking about the default "HUD"?

DustyPorViva 06-11-2010 09:32 PM

Quote:

Originally Posted by Deas_Voice (Post 1581423)
isn't he talking about the default "HUD"?

Default mechanics. You can make custom HUD's with the default system.

Mark Sir Link 06-11-2010 10:11 PM

Quote:

Originally Posted by Deas_Voice (Post 1581423)
isn't he talking about the default "HUD"?

if he wasn't he'd be able to add such mechanics himself.

He has a very good question, I'm pretty sure no events exist on the client for these occuring and they probably should

fowlplay4 06-11-2010 11:20 PM

Personally I'd rather have something like this..

this.catchevent(player.hearts, "onValueChanged", "onHPUpdated");

So then you could apply it to whatever you'd like (player.hearts, clientr.stats.hp, etc).

cbk1994 06-11-2010 11:30 PM

Quote:

Originally Posted by fowlplay4 (Post 1581437)
Personally I'd rather have something like this..

this.catchevent(player.hearts, "onValueChanged", "onHPUpdated");

So then you could apply it to whatever you'd like (player.hearts, clientr.stats.hp, etc).

I'm not really a fan of the syntax but a way to catch when a variable changes would be a great addition.

WhiteDragon 06-12-2010 12:01 AM

Quote:

Originally Posted by cbk1994 (Post 1581440)
I'm not really a fan of the syntax but a way to catch when a variable changes would be a great addition.

It'd also have some nasty overhead costs (unless they are already there from some other feature).

xAndrewx 06-12-2010 09:41 AM

Yeah, anything that would prevent a timeout :(

I've done the HP updating using:
HTML Code:

function onPlayerHurt()
Need some more for MP/AP etc though, thanks. Should've posted in future updates

Jiroxys7 06-12-2010 06:30 PM

Quote:

Originally Posted by fowlplay4 (Post 1581437)
Personally I'd rather have something like this..

this.catchevent(player.hearts, "onValueChanged", "onHPUpdated");

So then you could apply it to whatever you'd like (player.hearts, clientr.stats.hp, etc).

This would be great. :D

DustyPorViva 06-12-2010 06:37 PM

Quote:

Originally Posted by xAndrewx (Post 1581511)
Yeah, anything that would prevent a timeout :(

I've done the HP updating using:
HTML Code:

function onPlayerHurt()
Need some more for MP/AP etc though, thanks. Should've posted in future updates

That doesn't take into account healing, though, does it?

Crow 06-13-2010 01:05 AM

Quote:

Originally Posted by DustyPorViva (Post 1581555)
That doesn't take into account healing, though, does it?

I believe heals count as a negative hurt.

DustyPorViva 06-13-2010 01:31 AM

Quote:

Originally Posted by Crow (Post 1581649)
I believe heals count as a negative hurt.

That would be... odd. I can't say I've ever tested it, but I never remember having to put checks in to make sure when the player was hurt that it was taking away health.

Crow 06-13-2010 10:33 PM

Quote:

Originally Posted by DustyPorViva (Post 1581655)
That would be... odd. I can't say I've ever tested it, but I never remember having to put checks in to make sure when the player was hurt that it was taking away health.

Well, you can heal the player by using hurt() with a negative number, so it'd make sense. Kinda.


All times are GMT +2. The time now is 11:34 AM.

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