Subtype Flydie

O Ilusionista

Captain 100K
I have an entity witht he subtype flydie:

name candle
health 1
type obstacle
subtype flydie
gfxshadow 1
candamage enemy
antigravity 100
offscreenkill 2000

diesound data/sounds/klunk.wav

palette data/chars/misc/objects/candlee1.gif

But it has an issue: it always flies to the same direction when it dies, no matter from which direction you hit it.

Is there a native way to bypass this (which would make sense to have) or do I need to rely on script for that?
 
Solution
Removed my first answer, I took another look and I'm not 100% sure after all. The fly code is very simple, and doesn't take direction into account, but that might not matter.

C:
if(self->modeldata.subtype == SUBTYPE_FLYDIE)     // Now obstacles can fly like on Simpsons/TMNT
{
    self->velocity.x *= 4;
    self->think = obstacle_fly;
    ent_set_anim(self, ANI_FALL, 0);
}

Generally, items flip before velocity applies, and so it would be for obstacles too, except items don't flip unless they are in pain or knocked down, so I''ll actually need to dive deeper into this.

DC
I'll see about an update in the next build. If someone whines about backward compatibility because stuff doesn't fly the wrong way any more, well, they can stuff it.
Yeah, it makes sense to always fly to the opposite direction. And if someone want the old behaviour, the can simply force the facing in the header. No big deal :)
 
Removed my first answer, I took another look and I'm not 100% sure after all. The fly code is very simple, and doesn't take direction into account, but that might not matter.

C:
if(self->modeldata.subtype == SUBTYPE_FLYDIE)     // Now obstacles can fly like on Simpsons/TMNT
{
    self->velocity.x *= 4;
    self->think = obstacle_fly;
    ent_set_anim(self, ANI_FALL, 0);
}

Generally, items flip before velocity applies, and so it would be for obstacles too, except items don't flip unless they are in pain or knocked down, so I''ll actually need to dive deeper into this.

DC
 
Solution
Back
Top Bottom