0 registered members (),
900
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Entity Panel
[Re: Espér]
#253488
02/25/09 00:08
02/25/09 00:08
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
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
|
|
|
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
Expert
|
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. //=================================================================================================================================
//
#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: Espér]
#253690
02/26/09 04:08
02/26/09 04:08
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
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.... 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: Espér]
#253806
02/27/09 00:15
02/27/09 00:15
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
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
|
|
|
|