Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 900 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
Page 3 of 3 1 2 3
Re: Entity Panel [Re: Ottawa] #253327
02/24/09 01:53
02/24/09 01:53
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Quote:

Hi!

A counter starts at 0
so 0 to 7 is 8

Ottawa

and that helps in what way????


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Entity Panel [Re: Espér] #253488
02/25/09 00:08
02/25/09 00:08
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

When I saw the pics and the number I had the impression that
the following was happening.

If you have 8 pictures on the screen and the panel says 7.

and I start counting at : first pic = 0, second pic = 1,...eight pic == 7.

Then the panel would be right and the pics also.

Ottawa smile

Re: Entity Panel [Re: Espér] #253489
02/25/09 00:30
02/25/09 00:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ottawa: I set it up so Zero health shows NO fragments, and therefore 7 health should be 1 3/4 hearts.

Esper: Its still working fine for me, even after modding the code to be milti-line.
Can you post the code you are using to display/debug the players health? My code is all using "player.skill98".

If this isnt the issue, can you post me a link to your heart model with the animations in it?
There may be some differences in the way we have animated them.
Try the milti-row code below first, see if it does the same.


Heres the multi-row heart code, any questions fire away.

Code:
//=================================================================================================================================
//
#define HEARTS_MAX  24
#define HEARTS_PER_ROW 8
ENTITY* hud_ent_heart[HEARTS_MAX];
//
function heart_startup()
{	var h;	for(h=0; h<HEARTS_MAX; h++)	//only needs running ONCE bet game-boot
	{	hud_ent_heart[h] = ent_createlayer("Herz.mdl", NULL, 1000);		
		var x_pos = 360-(cycle(h,0,HEARTS_PER_ROW)*35);
		var y_pos = 280-(integer(h/HEARTS_PER_ROW)*50);
		vec_set(hud_ent_heart[h].x, vector(700, x_pos, y_pos));
		hud_ent_heart[h].tilt = 90;		}	
}	
//
//
function heart_1()
{
	var heart_num  = integer(player.skill98 / 4);
	var this_heart = fraction(player.skill98 / 4)*100;
	var h; for(h=0; h<HEARTS_MAX; h++)
	{	if(heart_num<h)								//if lower health than this heart
		{	ent_animate(hud_ent_heart[h], "heartp",   0, ANM_SKIP);	}
		else
		{	if(heart_num>h)							//if higher health than this heart
			{	ent_animate(hud_ent_heart[h], "heartp", 100, ANM_SKIP);  }
			else											//if ON this heart
			{	ent_animate(hud_ent_heart[h], "heartp", this_heart, ANM_SKIP);	}
		}			
		//insert standard heartbeat animation here if you want to.
	}
/////  DE-Bugging ONLY  -  START
str_cpy(health, "");	str_cat_num(health, "health = %.0f", player.skill98);
str_cpy(v1,"");	str_cat_num(v1,"heart   = %.0f",heart_num);
str_cpy(v2,"");	str_cat_num(v2,"percent = %.0f",fraction(player.skill98/4)*100);
/////  DE-Bugging ONLY  -  END
}
//
//
//=================================================================================================================================



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Entity Panel [Re: EvilSOB] #253558
02/25/09 12:57
02/25/09 12:57
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
no effect at all..

send you heart and health-debug-panel via PN.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Entity Panel [Re: Espér] #253690
02/26/09 04:08
02/26/09 04:08
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Got it, it was the animations after all. Just replace the following chunk of code to correct
for your models animations being "heartp 0" is a full heart and "heartp 4" being a dead one.
(I nameed my test model the other way around)

Also, and most importantly, your'll need to convert your heart to vertex animations. It SEEMS that you
cant use bones animation on view entities. Ive learned this from experience, not reading, so
there may be a way around it if you look.
I dont think its worth it for the heart, just convert it.
Open hetrz.mdl in MED, "Edit" dropdown menu and hit "convert to points animation" and say yes to delete bones.
Save and its done.

Let me know how it goes....
Code:
function heart_1()
{
	var heart_num  = integer(player.skill98 / 4);
	var this_heart = 100-fraction(player.skill98 / 4)*100;
	var h; for(h=0; h<HEARTS_MAX; h++)
	{	if(heart_num<h)								//if lower health than this heart
		{	ent_animate(hud_ent_heart[h], "heartp",   100, ANM_SKIP);	}
		else
		{	if(heart_num>h)							//if higher health than this heart
			{	ent_animate(hud_ent_heart[h], "heartp", 0, ANM_SKIP);  }
			else											//if ON this heart
			{	ent_animate(hud_ent_heart[h], "heartp", this_heart, ANM_SKIP);	}
		}			
		//insert standard heartbeat animation here if you want to.
	}
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Entity Panel [Re: EvilSOB] #253721
02/26/09 10:49
02/26/09 10:49
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
WORKS..
VERY VERY VERY VERY VERY GREAT

THANK YOU EvilSOB
^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Entity Panel [Re: Espér] #253806
02/27/09 00:15
02/27/09 00:15
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No problems.
Anytime friend.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 3 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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