Hi all, I am having some trouble creating a VFX on an NPC, during a conversation. I’m assuming there is a simple way to do it, that I am missing.
I had intended to use ga_create_obj (V=visual effect), but the script is suggesting it is only to place at a waypoint specified… which is weird, because I didn’t think you could spawn VFX’s on waypoints. I’ve been spawning them onto ipoints via conversations, up until this point.
There doesn’t appear to be any other global_action scripts that add a VFX, that I can see.
The issue here is that the vfx I want to add to the NPC, is the helmedhorror (blue eyes vfx). I couldn’t see it in the visualeffects.2da.
Next thing I have tried, is to create a helm (that matches the NPC in question) and add a visual effect to the helmet. However, it doesn’t show up in game, when I equip the helmet to the NPC. If this had worked, I would simply have equipped the helm during the conversation, to enable the VFX.
Is there a simple method I’m missing? -thank you.
EDIT: …and on a separate note, but slightly similar topic… I assume ga_destroy doesn’t work on VFX’s? Is there a way to destroy them once they are “painted” somewhere? Because I added one once to an ipoint during a conversation and destroyed the ipoint with a 0.1 second delay and the VFX with a 0 delay, but it didn’t work. The VFX remained behind.
Try ga_effect. I have used that on characters in a conversation.
ga_destroy should work with VFX. I have destroyed effects that way, although I have almost always used a custom script to destroy many effects at the same time, but I believe it should work.
EDIT: If ga_destroy doesn’t work for some odd reason, maybe try something simple like this script:
I think this type of effect is a Appearance Visual Effect that you can add on characters in their properties. If I remember correctly, these type of effects are not the same as effects you place in an area. Someone else here can probably say for certain if this is the case.
I don’t think you can add this type of effect on a character in middle of the game, actually. However, I can of course be wrong.
And you added the effect in the properties of the helm item at the top at the Appearance (special effect)?
@andgalf
Try ga_effect. I have used that on characters in a conversation.
Awesome, I’ll give it try thanks…
EDIT: ahh yeah, I just checked and ga_effect uses the visualeffects.2da
Thanks for the script, I’ll give that a try as well. Now you mention it, I’ll try removing the ga_destroy on the VFX and just leave it on the ipoint and see if that works on that other spot. If not, I’ll try your script, thank you.
And you added the effect in the properties of the helm item at the top at the Appearance (special effect)?
Yeah and I tried it first (NPC not wearing armor) with disable armor set to 1, then tried it set to 0. Both with disable helm = 0. No luck.
I found a script I had used before that spawns in an appearance visual effect. I think this should work for you:
#include "ginc_object"
void RunTheEffect()
{
//Apply visual effect to creature. Script example by Dann Pigdon 2012 from Handy_VFX. Edited by andgalf 2021.
//object oTarget = GetObjectByTag("tagofcreature");
object oPC = GetFirstPC();
string sVFX = "fx_helmedhorror_eyes.sef";
//Assign VFX to spell id 100 (light spell)
effect eVisual = SetEffectSpellId(EffectNWN2SpecialEffectFile(sVFX), 100);
//SetWeaponVisibility(oTarget, 0, 0);//Make weapons and shields invisible
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual , oPC,1.5);
}
void main()
{
//object oCreature = SpawnCreatureAtWP("creature", "creature_wp");
DelayCommand(0.1,RunTheEffect());
}
To make sure it works, I’ll try it on my end. One moment…
EDIT: Had to do a bit of editing on the script. Now it works adding glowing eyes to the PC. If you want another target than the PC, just do it like this instead:
#include "ginc_object"
void RunTheEffect()
{
//Apply visual effect to creature. Script example by Dann Pigdon 2012 from Handy_VFX. Edited by andgalf 2021.
object oTarget = GetObjectByTag("tagofcreature");
//object oPC = GetFirstPC();
string sVFX = "fx_helmedhorror_eyes.sef";
//Assign VFX to spell id 100 (light spell)
effect eVisual = SetEffectSpellId(EffectNWN2SpecialEffectFile(sVFX), 100);
//SetWeaponVisibility(oTarget, 0, 0);//Make weapons and shields invisible
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual , oTarget ,1.5);
}
void main()
{
//object oCreature = SpawnCreatureAtWP("creature", "creature_wp");
DelayCommand(0.1,RunTheEffect());
}
Wow Andgalf, appreciate your time and speed! Thank you so much.
Also, you inspired me to go back through the visualeffects.2da and there area SO many good little VFX’s in there I didn’t notice before.
The visualeffects.2da doesn’t include the appearance effects, I believe.
Here is an even better version of my script, if you intend to use it in a conversation that is:
#include "ginc_object"
void main(string sTarget)
{
//Apply visual effect to creature. Script example by Dann Pigdon 2012 from Handy_VFX. Edited by andgalf 2021. If you want the PC to be the target just put "$PC" as sTarget.
object oTarget;
if(sTarget == "$PC")
{
oTarget = GetFirstPC();
}
else
{
oTarget = GetObjectByTag(sTarget);
}
string sVFX = "fx_helmedhorror_eyes.sef";
//Assign VFX to spell id 100 (light spell)
effect eDrink = SetEffectSpellId(EffectNWN2SpecialEffectFile(sVFX), 100);
//SetWeaponVisibility(oTarget, 0, 0);//Make weapons and shields invisible
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrink, oTarget,1.5);
}
As you can probably see in my previous versions of the script I had made it so that you spawn in a new creature and then give it an appearance effect. If you don’t need that and use the script in a conversation, then it’s better to use this version.
By the way, do you want to remove this effect at some point or is it supposed to be permanent?
If you want to remove it, I have this script that is run from a conversation (I noticed I used these two when poking around my old stuff):
Both those last two scripts are perfect @andgalf , I can use them both for sure and I know exactly where. Thank you and appreciate the updated version, its more in line with what I require.
I noticed a screenshake VFX in the visualeffect.2da, which is good, because I have some earth tremors going on in the campaign. Always learning
Sorry, I jumped the gun a bit. Was going to test them tomorrow, but did now before bed.
The script to fire the VFX on the NPC when I add their name to the script specifically works, but I couldn’t get the VFX to work with the scripts using parameters in the conversation.
Also the VFX do not remove, with the remove VFX script. This could be an issue with the VFX themselves and not your script though.
I’m not sure what you mean by this. Can you explain further?
I mean my scripts here are quite simple. Use the script with the tag of the NPC on a node in the conversation and that’s it. Don’t know what other parameters you are talking about now.
EDIT: To make sure I tested this on my end with an NPC and the PC. Everything works without problems for me so…I’m not sure what doesn’t work for you.
I think I use the word parameter, when I mean variable. I mean when you attach the script to a conversation node (red or blue), nothing is happening when I type in the tag of the creature to add the vfx to and to remove the vfx from.
The script that has the NPC’s tag written into it works for me though, but the remove vfx on that script doesn’t work.
Edit: Trying again now that I have rebooted my system. Will update soon
EDIT2: Everything is now working perfectly! What a mystery why it wasn’t before, but hey, who cares! haha @andgalf thanks again my friend, appreciate your help