maxman
Well-known member
Hey, everyone. I just discovered this method recently by creating a new and simple death script for any character to die by a specific height/altitude. It is used for characters to die whether they're on ground or air.
Before we dive into how entities die by height specifically, take a look at how falldie or death works in the character header.
This one is not required, but it's optional if you want to make characters not blink while dying. nodieblink is another part of the character header to be used.
Just a partial example in the character header for importance.
Now that we get this going, here's a script for checking the character's height before dying. I call this script "diebyheight".
diebyheight.c:
This script checks the entity's altitude whether he's on the ground or on the air, especially jumping. If he gets hit on air, he will die with anim fall only. But when he gets hit on the ground, he instantly performs anim death.
Declare that script as ondeathscript in the character header. But take note that I'm not using falldie in the character header this time, so falldie's effect is in the script.
Example:
Results:
Death on air:


Death on ground:

P.S.: The reason why I don't put falldie/death in the header is because the script forces to change its death state in a death event.
Before we dive into how entities die by height specifically, take a look at how falldie or death works in the character header.
falldie {value} or death {value}
- Determines how DEATH animation will be played when the character dies.
- 0 = fall, blink on ground then disappear without playing DEATH at all (default).
- 1 = No FALL animation, DEATH animation will be played right after final blow
- 2 = Fall first then play DEATH animation.
- MAKE SURE that the character have DEATH animation when using this!
This one is not required, but it's optional if you want to make characters not blink while dying. nodieblink is another part of the character header to be used.
nodieblink {int}
- Sets how entity's death animation is played.
- 0 = entity starts blinking as soon as entity die in respective FALL animation.
- 1 = entity won't blink until after the last frame of entity's FALL or DEATH animation when killed.
- 2 = entity won't blink at all during death, and entity will disappear after the last frame of their death animation.
- 3 = entity will play it's death animation without blinking, and will not disappear until scrolled offscreen. The enemy won't count towards 'group's after dying, even though they don't disappear. This setting ONLY works for enemies.
Just a partial example in the character header for importance.
Code:
name Terry
type player
health 100
nodieblink 1
falldie 2
Now that we get this going, here's a script for checking the character's height before dying. I call this script "diebyheight".
diebyheight.c:
C:
void main(){
dieByHeight();
}
void dieByHeight()
{
void self = getlocalvar("self"); // Calling acting entity
int y = getentityproperty(self, "y"); // Calling acting entity's Y axis coordinate
if(y > 0) // If entity is on air or out of ground...
{
changeentityproperty(self, "falldie", 0); // Entity falls on air and lands to the ground without performing anim death
}
else // If nothing else... (therefore, it's only on the ground.)
{
changeentityproperty(self, "falldie", 1); // Entity dies with its death animation
}
}
This script checks the entity's altitude whether he's on the ground or on the air, especially jumping. If he gets hit on air, he will die with anim fall only. But when he gets hit on the ground, he instantly performs anim death.
Declare that script as ondeathscript in the character header. But take note that I'm not using falldie in the character header this time, so falldie's effect is in the script.
Example:
Code:
name Terry
type player
health 1 #100
nodieblink 1
speed 10
gfxshadow 1
icon data/chars/heroes/KOF_2K3_Terry_Sprite.7z/terry.png 1
diesound data/sounds/heroes/terry/06_terry_00009.wav
palette data/chars/heroes/KOF_2K3_Terry_Sprite.7z/0_0.png
alternatepal data/chars/heroes/KOF_2K3_Terry_Sprite.7z/pal01.png
alternatepal data/chars/heroes/KOF_2K3_Terry_Sprite.7z/pal02.png
alternatepal data/chars/heroes/KOF_2K3_Terry_Sprite.7z/pal03.png
# ATTACKS
atchain 1 4 2 3
com a2 freespecial5
#SPECIAL MOVES
com d f a freespecial #Power Wave L
com d f a2 freespecial2 #Burning Knuckle L
com d u a freespecial3 #Crack Shoot L
com f d f a freespecial4 #Power Dunk L
holdblock 1
running 20 3.6 3 1 1 #running {speed} {height} {length} {move} {land}
animationscript data/scripts/animation/default.c
ondrawscript data/scripts/DEBUG_GRAB.c
ondeathscript data/scripts/ondeath/diebyheight.c
Results:
Death on air:


Death on ground:

P.S.: The reason why I don't put falldie/death in the header is because the script forces to change its death state in a death event.
Last edited: