Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | chip programmers | 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