PDA

View Full Version : [K1] Strange visual effects problem


Silveredge9
07-04-2008, 02:55 PM
I've been having some problems when applying a visual effect to an NPC, the energy field thing that surrounds one during the Drain/Death field Force power (VFX_PRO_DRAIN). But the strange thing is, no matter how long I script the visual effect to last for, it only ever lasts for about a second before disappearing.

I've included an example below of what I would use to script this visual effect. I'm wondering if anybody could possibly see any error in the script? Or suggest any alterations that might allow the visual effect to last longer.


effect efVisual = EffectVisualEffect(1009);
DelayCommand(0.2, ApplyEffectToObject(1, efVisual, oNPC, 6.0));

Thanks for any help in advance. :)

glovemaster
07-05-2008, 12:00 PM
effect efVisual = EffectVisualEffect(1009);
DelayCommand(0.2, ApplyEffectToObject(1, efVisual, oNPC, 6.0));
Your script is right, I reckon it must be something down to the VFX model? Though since I am not the expert with kotor models, I'll offer a short-term solution.

void GM_VFXDrainDur(object oTarget, float fDuration){
float i;
effect eVisual = EffectVisualEffect(1009);
for ( i = 0.0; i <= fDuration; i = i + 0.5 ){
DelayCommand(i, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVisual, oTarget, 1.0));
}
}

void main(){
DelayCommand(0.2, GM_VFXDrainDur(oNPC, 6.0));
}

Hope that helps ;)

Silveredge9
07-08-2008, 09:21 AM
I've had a chance to try the script and it works. Thanks for the help. :)