I haven't really read through the scripts properly, but I believe your problem here is with the way you're removing effects. The variables you specify are actually creating new effects (with no target) and then trying to remove them from the PC. In order to actually remove an effect from the PC you have to grab that specific instance of the effect.
In other words something like this:
void clearfx(object target)
{ effect fx = GetFirstEffect(target);
while(GetIsEffectValid(fx))
{
RemoveEffect(target, fx);
fx = GetNextEffect(target);
}
}
The above function will remove all effects from the PC. The easiest way IMO to only remove specific effects is to create an object in your mod with a tag like "CutsceneFX", and assign the ApplyEffect command to it. Then, check for the tag of the effect creator in the effect removal loop, and remove only effects created by "CutsceneFX". Like so...
AssignCommand(GetObjectByTag("CutsceneFX"), ApplyEffect...
...
void clearCutscenefx(object target)
{ effect fx = GetFirstEffect(target);
while(GetIsEffectValid(fx))
{
if(GetTag(GetEffectCreator(fx)) == "CutsceneFX")
{ RemoveEffect(target, fx);
fx = GetNextEffect(target);
}
}
}
Modifié par _six, 21 juillet 2011 - 12:58 .