Hello,
I'm looking for a little script wich able to apply an effect on a pj who have the an item on his inventory.
Can anyone help me ? Thanks :-)
Effect on item
Débuté par
DM_Vorpal
, juil. 06 2011 12:37
#1
Posté 06 juillet 2011 - 12:37
#2
Posté 06 juillet 2011 - 01:23
Scripts only run when associated with some kind of event. You could use tag-based scripting to run a script when the PC acquires the item, or you could fire the script when the item is activated or equipped. You might try other events as well, maybe the on-enter event of a trigger, or a particular node in a conversation.
The simple thing to do would be just to open the item blueprint and add the effect there, unless you're trying to do a more complicated effect.
The first thing you need to do is figure out exactly how you want the script to work, and then we can help you put one together.
The simple thing to do would be just to open the item blueprint and add the effect there, unless you're trying to do a more complicated effect.
The first thing you need to do is figure out exactly how you want the script to work, and then we can help you put one together.
#3
Posté 06 juillet 2011 - 03:44
Ok.
What i m looking for :
An item who apply the effect fx_shadowfiend_2 on a pj has long has he have the item in his inventory.
I try to add the effect fx_shadowfiend_2 (and !fx_shadowfiend_2) in the visualeffect case (first case) of the item blueprint but it doesn't work. Even if the blueprint is ITEMPROP_ACTIVE_EQUIPPED_OR_REPOSITORY.
So i dont know use the visuel effect case :S
Thanks for answer.
What i m looking for :
An item who apply the effect fx_shadowfiend_2 on a pj has long has he have the item in his inventory.
I try to add the effect fx_shadowfiend_2 (and !fx_shadowfiend_2) in the visualeffect case (first case) of the item blueprint but it doesn't work. Even if the blueprint is ITEMPROP_ACTIVE_EQUIPPED_OR_REPOSITORY.
So i dont know use the visuel effect case :S
Thanks for answer.
Modifié par DM_Vorpal, 06 juillet 2011 - 03:44 .
#4
Posté 06 juillet 2011 - 04:00
Putting the visual effect on the item means the item takes on the visual effect, not the character. You would have to use the scripts of the object to apply the effect to the character.
Incidentally: I did some experimenting some time ago on vfx on items, and the shadow vfx didnt seem to work.
Incidentally: I did some experimenting some time ago on vfx on items, and the shadow vfx didnt seem to work.
#5
Posté 06 juillet 2011 - 05:15
That sounds like a good situation for the OnAcquire/OnUnAcquire events. The OnAcquire script would apply the vfx to the Player-Character object either as an EffectVisualEffect or even better as an EffectNWN2SpecialEffectFile (SEF) and remove it OnUnAcquire. The SEF would probably better because it can more easily be retrieved to be removed later.
If this is for a PW, it's possible that the vfx might not show when the PC joins if they already have the item in inventory (not sure about this--you'd have to test). If that turns out to be the case, you might want to add a check in an on-joined event (the module's OnEnter, for example) that checks whether the item is in inventory and applies the vfx if so.
If this is for a PW, it's possible that the vfx might not show when the PC joins if they already have the item in inventory (not sure about this--you'd have to test). If that turns out to be the case, you might want to add a check in an on-joined event (the module's OnEnter, for example) that checks whether the item is in inventory and applies the vfx if so.





Retour en haut






