hello
iam trying to add a pain anim to abstacles
iam using this script:
this is the obstacle .txt
this was the best script i could find for a pain animation
but way the script plays with
@cmd damage 95 "ANI_FOLLOW1"
means whenever the healthbar reaches 95% it play anim follow1
anim follow 1 returns to idle.... and since the health its not 100% in idle it goes to follow1 again...
ive tried to change this part of the script
(self,"maxhealth")*hp/100))
but it dindnt changed anything
is there a way to change the script so that it changes to follow1 when it
takes 5 or 10 damadge ? not when its bellow 95% health...
iam trying to add a pain anim to abstacles
iam using this script:
Code:
void damage(int hp,char ani)
{
void self=getlocalvar("self");
if (getentityproperty(self,"health")<=(getentityproperty(self,"maxhealth")*hp/100))
{
changeentityproperty(self,"animation",openborconstant(ani));
}
}
void beidle()
{// Go to IDLE animation!
void self = getlocalvar("self");
setidle(self, openborconstant("ANI_IDLE"));
}
this is the obstacle .txt
Code:
name woodtrain3
type obstacle
health 100
shadow 0
animationscript data/scripts/obstacle.c
falldie 1
nodieblink 3
noatflash 1
flash flash5
gfxshadow 1
anim death
loop 0
delay 16
offset 40 130
jumpframe 0 2 -1
sound data/sounds/wood.wav
frame data/chars/misc/bonus/woodtrain/tfall1.gif
frame data/chars/misc/bonus/woodtrain/tfall2.gif
offset 70 130
frame data/chars/misc/bonus/woodtrain/tfall3.gif
frame data/chars/misc/bonus/woodtrain/tfall4.gif
delay 200
frame data/chars/misc/bonus/woodtrain/tfall4.gif
anim fall
loop 0
delay 30
offset 40 130
frame data/chars/misc/bonus/woodtrain/tfall1.gif
frame data/chars/misc/bonus/woodtrain/tfall2.gif
anim follow1
loop 0
delay 9
offset 40 130
bbox 0 0 70 135
frame data/chars/misc/bonus/woodtrain/tpain1.gif
frame data/chars/misc/bonus/woodtrain/tpain2.gif
frame data/chars/misc/bonus/woodtrain/tstand.gif
frame data/chars/misc/bonus/woodtrain/tpain1.gif
frame data/chars/misc/bonus/woodtrain/tpain2.gif
frame data/chars/misc/bonus/woodtrain/tstand.gif
frame data/chars/misc/bonus/woodtrain/tpain1.gif
@cmd beidle
frame data/chars/misc/bonus/woodtrain/tpain1.gif
anim idle
loop 1
delay 10
@cmd damage 95 "ANI_FOLLOW1"
offset 40 130
bbox 0 0 70 135
frame data/chars/misc/bonus/woodtrain/tstand.gif
#|edited by openBor Stats v 0.53
this was the best script i could find for a pain animation
but way the script plays with
@cmd damage 95 "ANI_FOLLOW1"
means whenever the healthbar reaches 95% it play anim follow1
anim follow 1 returns to idle.... and since the health its not 100% in idle it goes to follow1 again...
ive tried to change this part of the script
(self,"maxhealth")*hp/100))
but it dindnt changed anything
is there a way to change the script so that it changes to follow1 when it
takes 5 or 10 damadge ? not when its bellow 95% health...