Neverwinter Nights: Enhanced Edition

Neverwinter Nights: Enhanced Edition

Adventures await!
Gather your mods before venturing forth. Discover planes filled with player-created adventures in Steam Workshop, then build your own Neverwinter Nights modules using the Aurora Toolset to share!
Learn More
Valefar 26 Oct, 2020 @ 3:07pm
Attaching a visual effect to an item
Hello, I've got a question.

On the Vault there's a visual effect I would like to employ in my module. This particular VFX comes from this package - https://neverwintervault.org/project/nwn1/hakpak/ccc-january-february-2011-head-decorations. I mean specifically an effect of a sword going through the head.

Right now in the module provided here it's set through a chat command (by the way - I have no idea how they do it, I looked at the scripts for like half an hour and I figured out nothing, heh). I would want this effect to be permanently tied with an item, headslot ideally for obvious reasons, and for that item to be locked on this slot (i.e. you can not take it off). I figure I would need scripts to make it work. Does anyone have an idea how to do it?
< >
Showing 1-5 of 5 comments
Proleric 5 26 Oct, 2020 @ 4:33pm 
The VFX itself can be made permanent by applying it as a supernatural effect (which is unaffected by rest). Check out the Lexicon entries for ApplyEffectToObject, EffectVisualEffect and SupernaturalEffect.

You'll need to add the new visual effects to visualeffects.2da in your top hak, so that the script can reference the correct VFX number. From memory, I believe there is a different VFX for each race and gender, so your script will need to choose the right one.

The headslot item (helmet, or whatever) is more problematic. It can be undroppable, but nothing can stop it being unequipped. If the victim is a PC, you have the slightly tacky option of forcing the PC to re-equip the helmet in the module's unequip event script, but even then the helmet will disappear for an instant.

EDIT: Afterthought on the helmet - if you were able to make a head model that looked like the helmet, you could change the victim's head by script. Players can't change that.
Last edited by Proleric; 27 Oct, 2020 @ 12:35am
Proleric 5 27 Oct, 2020 @ 12:32am 
This is the code I use to add a very similar visual effect to a creature. Race is not considered because the module is human-only.
int nVFX = 8046; if (GetGender(oPC) == GENDER_MALE) nVFX = 8045; ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(nVFX)), oPC);
Last edited by Proleric; 27 Oct, 2020 @ 12:33am
Valefar 27 Oct, 2020 @ 8:20am 
Originally posted by Proleric:
EDIT: Afterthought on the helmet - if you were able to make a head model that looked like the helmet, you could change the victim's head by script. Players can't change that.
In the meantime I honestly thought of simpler solution - would it be possible to just make a new head mesh which would be impossible for the player to access and with which I could grant the NPC with the effect I desire? Either way it was supposed to be an NPC walking with a sword in his head, not the player character.
Proleric 5 27 Oct, 2020 @ 8:48am 
If it's an NPC (not an associate) the PC can't change its helmet or VFX so any method should do.

With a text editor, working with decompiled models, it should be straightforward to add the VFX model to a head permanently - but scripting is probably easier.
Valefar 27 Oct, 2020 @ 9:14am 
It will be a henchman to be exact.

So, best course of action in these circumstances would be, I believe: to make a helmet which would have a mesh of this sword going through the character’s head and to make it impossible to unequip – some companion items in HotU work this way if memory serves me correctly, that is your henchman equips them immediately after you try to unequip the item (as you mentioned).

That’s much less, well, elegant than just making a new head model, but it’s probably more achievable for me (unless you know some good NWN modelling tutorial as well).

I have no experience with scripting so this should be fun...
< >
Showing 1-5 of 5 comments
Per page: 1530 50