Health

Non-platform specific questions.

Postby DilloDude » Sat Feb 24, 2007 3:10 am

make sure you are using one animation with a frame for each health state.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby UltimatHedgehog » Sat Feb 24, 2007 3:12 am

im using 1 actor with those 4 pictures, posted earlier, on him
Image
I always thought Hell would be a giant load screen that goes on for eternity, then one day, eons later, it would end, only to reveal a slightly different loading screen.
User avatar
UltimatHedgehog
 
Posts: 325
Joined: Fri Jan 19, 2007 1:48 pm
Location: http://downloads.khinsider.com/?u=112542 plz click
Score: 10 Give a positive score

Postby DilloDude » Sat Feb 24, 2007 3:47 am

Are they set up as one animation or as four separate animations? If they are separate, you can use animindex instead.
Code: Select all
animindex ++;
ChangeAnimation("Event Actor", getAnimName(animindex), FORWARD);
if (animindex >= 4)
{
    DestroyActor("Event Actor")// or whatever script you want
}
Last edited by DilloDude on Tue Feb 27, 2007 1:27 am, edited 1 time in total.
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby UltimatHedgehog » Sat Feb 24, 2007 3:58 am

wats that destroy actor part for if its for the player i change it to his death animation which is set to destroy when it finishes

is that for the player though ,destroy actor part,
Image
I always thought Hell would be a giant load screen that goes on for eternity, then one day, eons later, it would end, only to reveal a slightly different loading screen.
User avatar
UltimatHedgehog
 
Posts: 325
Joined: Fri Jan 19, 2007 1:48 pm
Location: http://downloads.khinsider.com/?u=112542 plz click
Score: 10 Give a positive score

Postby DilloDude » Sat Feb 24, 2007 4:35 am

Yes, the DestroyActor is to destroy the player. So, you'd want it to be
Code: Select all
DestroyActor("Player");

or, for an animation:
Code: Select all
ChangeAnimation("Player", "Die", FORWARD);
If you are changing the player's animation make sure to disable any other events (except for animation finish). Otherwise, you may be able to do something like a keydown which changes the animation, and stops you from dying (I did that in a very early game experiment, when I was first learning GE).
Last edited by DilloDude on Tue Feb 27, 2007 1:27 am, edited 1 time in total.
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Sat Feb 24, 2007 4:35 am

Yes, the DestroyActor is to destroy the player. So, you'd want it to be
Code: Select all
DestroyActor("Player");

or, for an animation:
Code: Select all
ChangeAnimation("Player", "Die", FORWARD);
If you are changing the player's animation make sure to disable any other events (except for animation finish). Otherwise, you may be able to do something like a keydown which changes the animation, and stops you from dying (I did that in a very early game experiment, when I was first learning GE).
Last edited by DilloDude on Tue Feb 27, 2007 1:26 am, edited 1 time in total.
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby UltimatHedgehog » Sat Feb 24, 2007 1:11 pm

i put it in but it changes the player's animation each collision so im looking a different direction
Image
I always thought Hell would be a giant load screen that goes on for eternity, then one day, eons later, it would end, only to reveal a slightly different loading screen.
User avatar
UltimatHedgehog
 
Posts: 325
Joined: Fri Jan 19, 2007 1:48 pm
Location: http://downloads.khinsider.com/?u=112542 plz click
Score: 10 Give a positive score

Postby DilloDude » Sun Feb 25, 2007 1:08 am

it might be easier to use a health variable. the player changes the health variable when a collision occurs, and the health displays it. For 4 different animations, put
Code: Select all
if (animindex != health)
{
    ChangeAnimation("Event Actor", getAnimName(health), FORWARD);
}

in the health bar's draw actor. Check for death in the player actor.
Last edited by DilloDude on Tue Feb 27, 2007 1:26 am, edited 1 time in total.
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby UltimatHedgehog » Sun Feb 25, 2007 1:13 am

i dont need this i deleted it i was trying to health types at once and this sucks and the other works
Image
I always thought Hell would be a giant load screen that goes on for eternity, then one day, eons later, it would end, only to reveal a slightly different loading screen.
User avatar
UltimatHedgehog
 
Posts: 325
Joined: Fri Jan 19, 2007 1:48 pm
Location: http://downloads.khinsider.com/?u=112542 plz click
Score: 10 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron