I downloaded from the vault some vfx’s I want to have my PC’s try on. For example I want to be able to have my PC’s buy like a widget or boots that you can upon use apply the snowshoe vfx on it so when they travel on snow they can have snowshoes. Other stuff too like adding a parrot to your shoulder, etc.
I’m sure once I have the basic script …I can just reference from my vfx 2da for each use…i.e. one for snowshoes, another for the parrot on the shoulder, etc.
Or is it more complicated? Like would one have to script it specifically where to put the parrot or the snowshoes on the PC?
Not sure how to do this…someone have a script to help me with this? Please…
In NWN2, this thing is quite easy. As usual, I don’t know how it’s done particularly in NWN and NWNEE.
I use a variation of the following scripts in my modules (even though it looks a bit different there).
Anyway, here’s a script to try:
//Remove visual effect from creature
#include "nw_i0_spells"
void main()
{
object oPC = GetPCItemLastUnequippedBy();
object oItem = GetPCItemLastUnequipped();
if (!GetIsPC(oPC)) return;
string sTag = GetTag(oItem);
if(oItem != OBJECT_INVALID && sTag == "itemtag")
{
//Remove all effects linked to spell id 100 (light spell)
RemoveEffectsFromSpell(oPC, 100);
}
}
EDIT: As usual, I realize that I need to modify this. Sorry. I’ll try.
EDIT2: Updated scripts. Mabye try these out. Don’t know it it’s gonna work or not.
EDIT3: Darn! Again I notice that I use a function only NWN2 has. Arrgh! Ok, I shouldn’t try to help people working with NWN. Sorry. Maybe you can still use these scripts and modify them, I don’t know. I tried at least.
EDIT4: Maybe you don’t even use .sef files in NWNEE? Checking with Lilac Soules script generator something like this came up:
So maybe adjust my script like…I don’t know… It will be trouble removing the effect when unequipping. Sigh! I give up. Someone else who actually works with NWNEE will have to help you. Sorry.
However, it’s correct, that the applying will be triggered by an item with the equip / unequip event, but the effect will go to the PC.
// script "it_bootsstriding"
// This will add / remove an effect on equip/unequip.
int GetAlreadyHasEffect (object oPC, object oItem, int Remove = FALSE)
{
int c, d, b = FALSE;
effect e = GetFirstEffect(oPC);
while(GetIsEffectValid(e))
{
d = (GetEffectType(e) == EFFECT_TYPE_MOVEMENT_SPEED_INCREASE);
c = (GetEffectCreator(e) == oItem);
if (d && c)
{
if (Remove) RemoveEffect(oPC, e);
b = TRUE;
}
e = GetNextEffect(oPC);
}
return b;
}
void main()
{
int nEvent = GetLocalInt(OBJECT_SELF, "X2_L_LAST_ITEM_EVENT");
effect e;
object oPC, oItem;
if (nEvent == 1) // equip item
{
oPC = GetPCItemLastEquippedBy();
oItem = GetPCItemLastEquipped();
if (GetAlreadyHasEffect (oPC, oItem)) return;
SetLocalObject (oItem, "Activator", oPC);
ExecuteScript ("yy_activateboots", oItem);
}
if (nEvent == 2) // unequip item
{
oPC = GetPCItemLastUnequippedBy();
oItem = GetPCItemLastUnequipped();
GetAlreadyHasEffect (oPC, oItem, TRUE);
}
}
The second script is needed to apply the effect. Why that fuss with a second script? you may ask. It’s to make damn sure, that the effect creator is the item itself, which makes removal of the effect much easier and relieable.
// script "yy_activateboots"
void main()
{
object oPC = GetLocalObject (OBJECT_SELF, "Activator");
effect e = SupernaturalEffect (EffectMovementSpeedIncrease(50));
ApplyEffectToObject (DURATION_TYPE_PERMANENT, e, oPC);
e = EffectVisualEffect(VFX_IMP_HASTE);
ApplyEffectToObject (DURATION_TYPE_INSTANT, e, oPC);
}
Not sure if this will work in the way I was hoping. I want to use an item/widget that will create snowshoes on my PC. In this case it is Misc 2 item I have to call it from as it has the pic and mdl.
The Amethyst Dragon (Link(link is external)) - Snowshoe clothing, item and placeables (1 foot part for both phenos, 1 item icon with on the ground model, and 3 placeables)
I love these, but I can’t see how the script above will put the snowshoes on my PC
Putting on showshoes is an effect (afaics). You can use effects such as letting appear a parot or binding a Hurdy Gurdy to your belly … simply an object appears on your character.
Just call this effect instead of the increased movement rate with my script.
Well, installing custom effects with NWN is a completely different question. The author of the effect should have given some pointers how the effect is to install. You need probably mess around with the vfx.2da and install a model file somewhere.
I still don’t know how to do that in this case. If it was a VFX I would just put the line to the VFX I guess in there. I originally thought it was a VFX, but it looks more like a mdl part that has to switch out the feet to the snowshoe feet. That I don’t know how. I think Amethyst Dragon put this on the vault knowing that most people in the community know how to do this. I don’t …
I had a quick glace on this CCC. There is no effect involved. I’ve seen that effect trick with musical instruments, so I was a bit misleaded.
Seamingly they are just bodyparts and to install like other clothing. They create a special appearance on the feet. There should be anything you need within the hak which comes with the CCC archive.
The snowshoes are presented within the module that is in that CCC in the crate. You will see the Misc 2 snowshoe pic. When placed on the ground it become the snowshoes. There is also the clothing in the crate. Once equipped you have the snowshoes. I can do both. But I would like to use a “Cast Spell: Unique Power Self” where it would switch out your PC’s current feet for the snowshoes…is that possible? If so…how?
Hmmm, maybe you could then, through a script, create the shoes as items and equip them, when using the Cast Spell: Unique Power Self - running the script doing this. It feels (to me) a bit convoluted though. Why not just have the snow shoes as items in the inventory? But I don’t fully grasp this whole situation. Seems overly complicated. I think I’ll just let Mmat handle this, since I will probably just mess it up if I’m to try and help in this, just like what happened at the start of this thread.
I could put a suit in the inventory only as the feet, but then the PC could not wear his/her normal armour.
As an aside…
I have managed to add the fog breath of that same CCC content into my module once a PC enters the area. But on exiting the area he/she still have the fog breath leaving. So I need to make it so that upon exiting the area (OnExit) script the fogbreath stops.
What I have for the script below does not work…I tried but it is not working…any suggestions?
Huh? If I remember correctly you could have boots of different kinds that you buy in NWN…You say that’s not the case? It’s been far too many years since I played NWN…Like Boots of Striding +1 for example…
I mean, if you make custom boots in the toolset using the show shooes from the haks, their appearance and whatnot, you could just have that as an item to pickup, or do it by the Cast Spell: Unique Power Self script.