Frictional Games Forum
Killing a monster ! Dying animation - Printable Version

+- Frictional Games Forum (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Killing a monster ! Dying animation (/thread-14485.html)



Killing a monster ! Dying animation - stonecutter - 04-04-2012

As you know i am working on a combat system !
http://www.frictionalgames.com/forum/thread-14444.html?highlight=create+entity

But now i have no idea how to manage to let the enemy die.
Currently the monster fades away , but i want to have a kind of dying animation ( falling to ground ).

Way 1 i thought of :
- remove the enemy when it dies
- put at the same place a enemy model with ragdoll ... it will automatically fall to the ground due to physics

way 2 :
- let the monster play an animation and replace it with a ragdollcopy.

but there is one big problem !

how can i add an entity at the same place as anothere entity is ? And dont forget the monster is moving around and wont die at the same place everytime !

Is it possible to stick an area to a monster so the area will follow the monster ?


Now its up to you . Take your brain and give me some input how you think you will solve this issue !





RE: Killing a monster ! Dying animation - Datguy5 - 04-04-2012

You could download a grunt ragdoll from the development resources section.Then just script so the enemy fades and the ragdoll is activated Smile


RE: Killing a monster ! Dying animation - JetlinerX - 04-04-2012

(04-04-2012, 03:25 PM)Datguy5 Wrote: You could download a grunt ragdoll from the development resources section.Then just script so the enemy fades and the ragdoll is activated Smile

^ Wont work. The enemy wont be killed in the same spot every time, he would need some way to track the grunt, until it dies, and then have the ragdoll spawn exactly where it died. As to how? I have no idea.



RE: Killing a monster ! Dying animation - stonecutter - 04-04-2012

(04-04-2012, 03:40 PM)JetlinerX Wrote: ^ Wont work. The enemy wont be killed in the same spot every time, he would need some way to track the grunt, until it dies, and then have the ragdoll spawn exactly where it died. As to how? I have no idea.
Yeah right ... thats the problem we have to solve Sad
I have an idea ... Just create so much thin areas .... place them around the area the monster walks and check at with which area the monster collides when it dies ....
but this will mean placing about 50 - 100 areas for each monster ...
Is it possible to return a number like you can do in programminglanguages ?

like

for (i=1,i<=100,i++){
if monster collide area_+i;
return i;
}





RE: Killing a monster ! Dying animation - stonecutter - 04-05-2012

Added to the code :

PHP Code:
for (int i 1i<=2; ++i){
        if(
GetLocalVarInt("MonsterHitCounter_"+i)==4){
             for(
int a 1a<=5; ++a){
             if(
GetEntitiesCollide("gun_target_"+i,"ScriptArea_"+a)==true){
             
FadeEnemyToSmoke("gun_target_"+ifalse);
             
CreateEntityAtArea("Test","corpse_scientist02_ragdoll.ent","ScriptArea_"+a,false);
             }
             
            } 


Now if the enemy dies ... there will be created a ragdoll at the area the enemy dies !
But you have to set a lots of ares ( around the path the enemy walks ) as you can see in the picture !

EDIT :
One new big problem to solve is ... if the enemy collides two areas at the same time it will create two ragdoll bodies...