How do I acheive an electrical arc effect between two points. I want a permanent effect to denote a trap that will switch off when the puzzle is solved.
Thanks in advance,
PJ
Electrical arc effect
Débuté par
PJ156
, juin 27 2011 08:51
#1
Posté 27 juin 2011 - 08:51
#2
Posté 27 juin 2011 - 09:17
Place down two IPoints for the beginning and end of the beam. Then use this script (or a version of it depending on how you want it to fire off):
void main()
{
object oPC = GetFirstPC(FALSE);
object oBeamStart = GetNearestObjectByTag("BeamStartTag", oPC, 1);
object oBeamEnd = GetNearestObjectByTag("BeamEndTag", oPC, 1);
effect eBeam1 = EffectNWN2SpecialEffectFile("sp_lightning_ray", oBeamEnd);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam1, oBeamStart, 3.0f);
}
void main()
{
object oPC = GetFirstPC(FALSE);
object oBeamStart = GetNearestObjectByTag("BeamStartTag", oPC, 1);
object oBeamEnd = GetNearestObjectByTag("BeamEndTag", oPC, 1);
effect eBeam1 = EffectNWN2SpecialEffectFile("sp_lightning_ray", oBeamEnd);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam1, oBeamStart, 3.0f);
}
#3
Posté 27 juin 2011 - 10:30
Thanks KM I put this on enter and it works just fine.
I don't see a RemoveEffectToObject but I do see a RemoveSEFFToObject.
I want to stop this temporarily when a certain action is called from a convo. I will have a play.
PJ
I don't see a RemoveEffectToObject but I do see a RemoveSEFFToObject.
I want to stop this temporarily when a certain action is called from a convo. I will have a play.
PJ
#4
Posté 27 juin 2011 - 10:57
I used this script from my convo and the VFX stops for 6 seconds 
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetObjectByTag("2005_dd_start_arc");
RemoveSEFFromObject(oTarget,"sp_lightning_ray");
object oPC1 = GetFirstPC(FALSE);
object oBeamStart = GetNearestObjectByTag("2005_dd_start_arc", oPC1, 1);
object oBeamEnd = GetNearestObjectByTag("2005_dd_end_arc", oPC1, 1);
effect eBeam1 = EffectNWN2SpecialEffectFile("sp_lightning_ray", oBeamEnd);
DelayCommand(6.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam1, oBeamStart, 3.0f));
}
Sorry this thread belongs in scripting but I did not realise this was a scripted solution.
Now to switch off the associated trap,
PJ
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetObjectByTag("2005_dd_start_arc");
RemoveSEFFromObject(oTarget,"sp_lightning_ray");
object oPC1 = GetFirstPC(FALSE);
object oBeamStart = GetNearestObjectByTag("2005_dd_start_arc", oPC1, 1);
object oBeamEnd = GetNearestObjectByTag("2005_dd_end_arc", oPC1, 1);
effect eBeam1 = EffectNWN2SpecialEffectFile("sp_lightning_ray", oBeamEnd);
DelayCommand(6.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam1, oBeamStart, 3.0f));
}
Sorry this thread belongs in scripting but I did not realise this was a scripted solution.
Now to switch off the associated trap,
PJ





Retour en haut







