O Ilusionista
Captain 100K
Guys, I've hit a snag with my project and I need help, since I've tried everything that I know to fix it, but nothing had work.
If I can't fix it, my game can't continue.
Let me explain what happens.
The TL;DR version:
I need to make the burn entity to detect the landframe when they lands atop of a wall, like the player does.
The long explanation
I have a type Enemy entity (I had to set it as enemy or some "subject_to" doesn't work) called "burnP", which is the entity I use for displaying human players and enemies in fire after been hit by a BURN attack:
I call it on the BURN animation (and on other animation) using a script WhiteDragon gave to me long time ago, which works and uses bindentity
Using bindentity, I make the effect to bind to the player, which gets invisible while effect is active (plus, the bindentity makes it to follow the parent animation, so I can use only one entity for different colors of fire). Since I spawn it at the Y=0 (IOW, at the same Y position of the parent), I use a "landframe" to control when the effect should be destroyed.
The problem is: it fails. Sometimes, if you near a wall and get hit by a burn attack, the effect will simply get destroyed because its near a wall, while the character is invisible and haven't landed over the wall (which works as a platform).
And now I am having an even bad situation: the Player lands over a wall, but the effect don't (it get stuck on air, then it try to fall on the ground - ignoring the wall)
How can I solve it?
Here is what I tried, all no good:
- Setting a landframe with a killentity
- setting a subentity or customknife (so I can kill the summoned entity when it lands)
- Spawn the entity and check the parent animpos (since all the entities calls the fire effect at the FIRST frame and everyone lands on the second frame), but the code is simply ignored:
What I can do? I am lost here.
What I won't do - add the fire colors to every character palette.
If I can't fix it, my game can't continue.
Let me explain what happens.
The TL;DR version:
I need to make the burn entity to detect the landframe when they lands atop of a wall, like the player does.
The long explanation
I have a type Enemy entity (I had to set it as enemy or some "subject_to" doesn't work) called "burnP", which is the entity I use for displaying human players and enemies in fire after been hit by a BURN attack:
name burnP
type enemy
gfxshadow 1
palette data/chars/misc/burn/01.gif
alternatepal data/chars/misc/burn/blue.gif
animationscript data/scripts/grabscript.c
subject_to_wall 1
subject_to_platform 1
suject_to_basemap 1
subject_to_holes 1
no_adjust_base 0
I call it on the BURN animation (and on other animation) using a script WhiteDragon gave to me long time ago, which works and uses bindentity
Code:
@script
if(frame==0)
{
void self = getlocalvar("self");
void e;
clearspawnentry();
setspawnentry("name", "burnP");
e = spawn();
bindentity(e, self,0,1,0,1,1);
}
@end_script
The problem is: it fails. Sometimes, if you near a wall and get hit by a burn attack, the effect will simply get destroyed because its near a wall, while the character is invisible and haven't landed over the wall (which works as a platform).
And now I am having an even bad situation: the Player lands over a wall, but the effect don't (it get stuck on air, then it try to fall on the ground - ignoring the wall)
How can I solve it?
Here is what I tried, all no good:
- Setting a landframe with a killentity
- setting a subentity or customknife (so I can kill the summoned entity when it lands)
- Spawn the entity and check the parent animpos (since all the entities calls the fire effect at the FIRST frame and everyone lands on the second frame), but the code is simply ignored:
Code:
script @script
void main()
{
void self = getlocalvar("self");
void parent = getentityproperty(self, "parent");
void pFrame = getentityproperty(parent, "animpos");
if(parent!=NULL()){
if (pFrame >0){
killentity(self);
}
}
}
@end_script
What I can do? I am lost here.
What I won't do - add the fire colors to every character palette.