Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by opm. 02/20/26 05:30
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
Camera always moves upwards?
by VoroneTZ. 02/19/26 13:13
Hedge on FXCM, 4 or 5?
by Martin_HH. 02/16/26 16:09
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (alibaba, TipmyPip, mayarik, VoroneTZ), 8,077 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to display entity health status? #325332
05/26/10 04:31
05/26/10 04:31
Joined: Mar 2009
Posts: 25
kholis Offline OP
Newbie
kholis  Offline OP
Newbie

Joined: Mar 2009
Posts: 25
i want to display health status above each entity head. i used panel to display it, but digits variable cannot be changed. it value always 0.0000
Code:
function create_health_panel(){
	temp_panel = pan_create("digits(0,0,5.1,*,0,my.health);",2);
}


if entity health changed, it will execute this function
Code:
function update_health(){
    if(my.state_attacked == true){my.health -= 10;}
    if(my.state_healed == true){my.health += 10;}
    pan_setvar(temp_panel,1,1.0,my.health); //update health status
}



Re: how to display entity health status? [Re: kholis] #325343
05/26/10 06:40
05/26/10 06:40
Joined: Apr 2005
Posts: 274
austria
Ascalon Offline
Member
Ascalon  Offline
Member

Joined: Apr 2005
Posts: 274
austria
try do use a global variable instead of my.health. i think this should work


my webside : www.ascalon.jimdo.de
Re: how to display entity health status? [Re: Ascalon] #325430
05/26/10 15:25
05/26/10 15:25
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: Ascalon
try do use a global variable instead of my.health. i think this should work

yes, define a var and put for example in the main loop var_health=player.health;


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: how to display entity health status? [Re: painkiller] #325576
05/27/10 10:08
05/27/10 10:08
Joined: Mar 2009
Posts: 25
kholis Offline OP
Newbie
kholis  Offline OP
Newbie

Joined: Mar 2009
Posts: 25
it works. thanks everyone laugh


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1