Aller au contenu

Photo

Vissual ffects and stuff..


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 657 messages
I know I did this in the past but I can't remember how. I need to spawn a creature, that when it appears it will use a visual effect, like from within some smoke. I think I've done it from an item activation script, but this time I need it to happen from a conversation, and the default action scripts don't contain any VFX... or at least I didn't find any.
Any ideas?
Andy.

#2
kamal_

kamal_
  • Members
  • 5 260 messages
Lilac Soul's Script generator will write you a script to do this.

#3
Tchos

Tchos
  • Members
  • 5 083 messages

I made a conversation script to create a VFX at the location of an object using the name of its SEF.  You could put a waypoint in the place where you want the creature to spawn, and use one ga_ script to spawn it at the waypoint, and my ga_ script to put the VFX there.

//////////////////////////////////////////////////////////////////////////////
//   
//    ga_vfx
//    by Tchos
//   
//    Applies a VFX .sef at a location (for waypoints).
//   
//////////////////////////////////////////////////////////////////////////////

void main(string sFX, string sObjectTag, int iDurType=0, float fDuration=0.0f)
{
object oFXloc = GetObjectByTag(sObjectTag);
if ((oFXloc == OBJECT_INVALID) || (sObjectTag == "")) { oFXloc = OBJECT_SELF; }
location lFXloc = GetLocation(oFXloc);
effect eFX = EffectNWN2SpecialEffectFile(sFX);

ApplyEffectAtLocation(iDurType, eFX, lFXloc, fDuration);

}

/*
DURATION_TYPE_INSTANT    = 0;
DURATION_TYPE_TEMPORARY  = 1;
DURATION_TYPE_PERMANENT  = 2;
*/

My note "for waypoints" might be ambiguous.  In my experience, you can't apply a VFX directly to a waypoint, or it won't show up, so I have the script apply the effect at the location of the objects whose tag is specified.  The object doesn't have to be a waypoint for the script to work.  By default, it applies the effect to the location of the conversation owner.

I use the VFX browser part of the PowerBar plugin to look through the effects and get the names of their SEFs.


Modifié par Tchos, 07 novembre 2015 - 09:47 .

  • kamal_ aime ceci

#4
andysks

andysks
  • Members
  • 1 657 messages
Do you know if all the effects on the Lilacs work or some might not? I mean, were all the effects from NWN got transferred to NWN2?

#5
Dann-J

Dann-J
  • Members
  • 3 161 messages
Unfortunately, quite a few of the VFX script constants inherited from NWN1 no longer do anything. There are also plenty of new VFX in NWN2 for which there are no script constants defined. Hence why most scripters prefer to use EffectNWN2SpecialEffectFile (see Tchos' script above). It bypasses the need to use script constants and goes straight for the actual SEF file.

I've created a similar conversation script to Tchos, although I've included the option to apply the effect to either a location or an object.

#6
Tchos

Tchos
  • Members
  • 5 083 messages
Indeed, as Dann says, there is virtually no reason to use the pre-NWN2 constants (which Lilac Soul's script generator uses) rather than the SEF method added in NWN2. One advantage, aside from the number of additional visual effects that are already added (and which work, unlike many of the constants), is that the script automatically works for any other visual effect that you may import from VFX packs or that you make yourself.

I also wrote a function to apply a VFX directly to an object rather than its location, but I never added that functionality to the conversation version of the script.

A script like this could also be combined with a spawning script to make a more convenient "spawn creature with effect" script.

Modifié par Tchos, 23 août 2013 - 01:23 .


#7
andysks

andysks
  • Members
  • 1 657 messages
Works like a charm Tchos, thanks.