Context sensative death animations

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
SV2.0
Posts: 88
Joined: Wed Jul 06, 2005 6:17 am
Location: California USA

Context sensative death animations

Post by SV2.0 »

Alright, I'm no scripter so I come seeking guidence. What I want to do is have alternate death animations depending on what killed the pawn. For example, if the pawn is killed by a regular attack, it'll just fall back and die. But if it is killed by poison it might fall to it's knees, puke and then fall on it's face. Also, for the puking, I'm wondering if a particle emitter can be attached to the pawn for that purpose. It might be useful for blood spray as well. If anyone can come up with a script, I would of course name them in the credits or model something for them.(I have access to Maya)
Last edited by SV2.0 on Mon Feb 04, 2008 8:01 am, edited 1 time in total.
Juryiel
Posts: 103
Joined: Fri Jan 04, 2008 1:18 pm

Re: Context sensative death animations

Post by Juryiel »

Well this isn't too hard. You can make an actor file with all those animations. Then you can keep track of what type of damage the player took in a given frame by setting some variable. For example if your variable is damageType, whenever poison damage is dealt, also add damageType=1 to the code that deals poison damage, whenever melee damage is taken also add damageType=0 to the code that deals melee damage, etc etc, with a different number for each type of damage. Then in your Die function you can use a switch statement for each value of damageType, and call a different animation.

However, I don't think anyone can write you this script as they would need to know all the types of damage you want, and where in your code they are called. It might be possible for someone to modify your pre-existing script after you've worked all that out though. This is for a scripted player by the way, I'm not sure if you can do it for the default player as I haven't used it much.
User avatar
SV2.0
Posts: 88
Joined: Wed Jul 06, 2005 6:17 am
Location: California USA

Re: Context sensative death animations

Post by SV2.0 »

It's the enimies that are going to do the dying though. Not the player. That shouldn't be as difficult as a scripted player, right?
Post Reply