I have three npc's in a conversation during which two start to beat the other to the ground.
All is well except I wan't person#3 to stay down during the beating but they keep getting up. I dont want npc #3 to get up until a timer expires or until they are talked to by the pc.
How can I do this?
The script which knocks the npc to the floor is this one. Can I perhaps freeze the looping animation ...
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetObjectByTag("2000_cs_clary");
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0f, 60.0f));
}
Help would be most welcome.
PJ
Can't keep a good man down.
Débuté par
PJ156
, déc. 07 2011 11:53
#1
Posté 07 décembre 2011 - 11:53
#2
Posté 08 décembre 2011 - 12:05
I have an answer of sorts which occured to me after I posted but it's a compromise. I would still like to have the npc take the beating.
My solution is to have the npc's target the I point to which the conversation is attacked. the falling animation does its thing and because the npc on the floor is not harmed they do not stand. They don't take any damage either so i would prefer if there is a better way.
Cheers,
PJ
My solution is to have the npc's target the I point to which the conversation is attacked. the falling animation does its thing and because the npc on the floor is not harmed they do not stand. They don't take any damage either so i would prefer if there is a better way.
Cheers,
PJ
#3
Posté 08 décembre 2011 - 12:48
I think M. Rieder used a VFX that freezes animation. If you applied this after the target is down, presumably it won't get back up until the VFX is removed. Give it a shot!
#4
Posté 08 décembre 2011 - 02:06
Probably the most reliable way to do this is to use VFX_DUR_FREEZE_ANIMATION.
You could possibly get away with using a ga_ script to apply knockdown permanently, then use ga_remove_effects on the NPC getting beaten when all the violence is over. I think for this to work the NPC getting knocked down cannot be the owner of the conversation and cannot have any nodes assigned to him, or else he will get up to have a nice chat with his assailants. Use static cameras if in cutscene mode or just use an IPOINT if in NWN1 convo mode.
You may be able to get away without having to make a custom script.
You could possibly get away with using a ga_ script to apply knockdown permanently, then use ga_remove_effects on the NPC getting beaten when all the violence is over. I think for this to work the NPC getting knocked down cannot be the owner of the conversation and cannot have any nodes assigned to him, or else he will get up to have a nice chat with his assailants. Use static cameras if in cutscene mode or just use an IPOINT if in NWN1 convo mode.
You may be able to get away without having to make a custom script.
#5
Posté 08 décembre 2011 - 04:30
There was an issue with HCR2 with keeping a felled PC down while bleeding was causing a lot of lag.
How does this behave performance wise?
Would this be a solution to what HCR2 was doing?
HCR2 had opted for a switch that turned off keeping the player down while bleeding (which means to avoid lag the downed pc will stand back up in the bleeding state). If this doesn't cause lag and the player can remain on the ground while bleeding it would certainly give a much better feel.
How does this behave performance wise?
Would this be a solution to what HCR2 was doing?
HCR2 had opted for a switch that turned off keeping the player down while bleeding (which means to avoid lag the downed pc will stand back up in the bleeding state). If this doesn't cause lag and the player can remain on the ground while bleeding it would certainly give a much better feel.
#6
Posté 08 décembre 2011 - 04:58
PlayCustomAnimation is more stable than ActionPlayAnimation. The conversation nodes also handle animations, so it might help if the fallen NPC isn't directly involved in the conversation. Otherwise, you could just add the prone animation to all of his nodes.
#7
Posté 08 décembre 2011 - 08:09
Thanks for the thoughts guys, plenty to act on this evening.
I will report back if I get it to work properly.
PJ
I will report back if I get it to work properly.
PJ
#8
Posté 08 décembre 2011 - 12:19
This script did it 
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
effect eFreeze = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);
oTarget = GetObjectByTag("2000_cs_clary");
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0f, 25.0f));
DelayCommand(1.2,ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFreeze, oTarget));
DelayCommand(27.0,RemoveEffect(oTarget,eFreeze));
}
Took a couple of attenpts to get the timing right on the freeze then it was fine.
Still not perfect since the NPC gets up a little abrupt,y but I think I can fix that by setting the animation duration slightly longer than the freeze duration.
Thanks all,
PJ
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
effect eFreeze = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);
oTarget = GetObjectByTag("2000_cs_clary");
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0f, 25.0f));
DelayCommand(1.2,ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFreeze, oTarget));
DelayCommand(27.0,RemoveEffect(oTarget,eFreeze));
}
Took a couple of attenpts to get the timing right on the freeze then it was fine.
Still not perfect since the NPC gets up a little abrupt,y but I think I can fix that by setting the animation duration slightly longer than the freeze duration.
Thanks all,
PJ
#9
Posté 08 décembre 2011 - 10:04
There are additional (non-looping) animations for falling down and getting up that are meant to be played before and after the looping animations. You can use delays to play them all in the right order.
You can find a list of animations and their lengths here. I've long since turned the list into a PDF that I reference a lot.
You can find a list of animations and their lengths here. I've long since turned the list into a PDF that I reference a lot.





Retour en haut







