Hi all,
Just been going around in circles a bit here trying to get this working properly.
I have a conversation, that I want both PC’s and NPC’s to freeze in place (on the conversation node after they initiate an animation), so that it looks like they are frozen in motion. Rather than standing with their arms by their side, frozen…
So for me, parameter “352” in my visualeffect.2da, is “VFX_DUR_FREEZE_ANIMATIONS”
I’ve set the duration to 90 seconds, only because I’m unsure if setting it to “P” permanent, would make things more difficult. Even though its all been difficult anyway lol
In short, it all works as intended, but what I am having difficulty with, is disabling this “frozen effect” during a conversation & at the end of a conversation…
At the moment, the conversation ends with a battle and all the PC’s and NPC’s are running around with their arms frozen by their side (default no-animation pose).
I tried using the script ga_clear_actions right before the conversation ends, but I don’t think its quite what is needed here, as it doesn’t do anything. Still the issue of no-animation poses.
I think I have a script for this. Not 100 % sure it works because I’ve had trouble before cancelling effects on creatures. I believe the script was made by Lance at some point. Let me look it up. Be back in a few minutes.
Ok, I found the script but I don’t think it will work in this instance. I found an old thread of mine though. You could maybe copy the scripts from there:
@tfunke - Perhaps this will be a problem to use if you don’t want to remove all effects from the party.
So perhaps use Aqvilinus’ script and then edit it a bit to something like this when applying the effect on the PC and the companions:
void main()
{
object oPC = GetFirstPC();
effect eVis = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);
eVis = SetEffectSpellId(eVis, 9999); //9999 <-- just for example here, you can use
//any valid id that doesn't conflict with
//existing ones in spells.2da or in other scripts
object oFM = GetFirstFactionMember(oPC, FALSE);
while (GetIsObjectValid(oFM))
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oPC);
oFM = GetNextFactionMember(oPC, FALSE);
}
}
And maybe use this (I might have done something wrong in this script, I don’t know, @kevL_s will have to correct me) for removing the effect:
EDIT: I’m doing a while loop inside another while loop here which makes me a bit scared. I’m only half sure about the code in the latter script here. Somehow I think that one should maybe “reassign” the eSearch to GetFirstEffect when switching to the next faction member but I’m not sure if I’ve done that correctly.
Since your situation appears to be more specific, use a custom action script like this. Just put it on the last node (or whichever node is the most prudent for you) of the dialog and add the tag:
// ga_remove_visual_effect
/*
Removes visual effects on sTag.
sTag = Tag of object. If blank then OWNER. Use $PC for PC_SPEAKER.
*/
#include "ginc_param_const"
void main(string sTag)
{
object oTarget = GetTarget(sTag);
effect eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT)
{
RemoveEffect(oTarget, eEffect);
}
eEffect = GetNextEffect(oTarget);
}
}
But if there’s more than one visual effect on the character then you would need to use kevL_s’ version of the script, I believe. Otherwise your script is perfect, @travus.