Aller au contenu

Photo

Making weapon vanish in the hand


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

#1
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 603 messages

For a throwable weapon I am creating I would like the weapon to vanish from the hand when it is thrown. I've tried  a few approaches and the only one I have working is to use SetWeaponVisibility.  Unfortunately this will make any weapon in the hurler's off hand also vanish, which is less than ideal.  Unequipping the item is not something I want to do because that will complicate things due to its properties and the engine automatically switching weapons from hand to hand.  And you cannot SetScale on items, so making it really small doesn't work either.  Nor does setting its appearance work.

 

I know that the Silver Sword in the OC seems to behave this way but in looking at the attack script for it it seemed to be using custom visual effects and strangely applying one when the sword is visible and removing it when the sword is hidden, which seems backwards to me.  I will look more into that, but if someone else has already solved this problem I'd be interested in knowing how.

 

Thanks.

 

Regards



#2
kevL

kevL
  • Members
  • 4 078 messages

I know that the Silver Sword in the OC seems to behave this way but in looking at the attack script for it it seemed to be using custom visual effects and strangely applying one when the sword is visible and removing it when the sword is hidden, which seems backwards to me. I will look more into that, but if someone else has already solved this problem I'd be interested in knowing how.


can't address the issue specifically, Kaldor.

re. Silver Sword: I reworked it from top to bottom several years ago, and can say, Do not trust the scripts. (It works but there are bugs and issues.) Based on what is already there, I ended up equipping the Sword as a special effect, removing the effect when unequipped, and using some of its *unused* special effects when activated/deactivated. In my version, the item itself is merely a hilt; the special effects are the blade in its various forms,

... roughly speaking, it's been awhile.

Eventually i found that drawing a weapon as a special effect is very nifty and effective. if you've got the gFx files ( i guess ).

#3
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 603 messages
Thanks. Yes, if the blade is really the special effect then that makes sense and I won't waste my time trying to decipher their bad code.

Regards

#4
kevL

kevL
  • Members
  • 4 078 messages
yep/ salut.

#5
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 603 messages

I decided to stick with SetWeaponVisibility since it works with the one caveat that items in the off-hand also vanish temporarily.  I figure if that bothers someone too much then they can limit themselves to using the weapon two-handed, although I won't make the weapon enforce that.  Too bad SetWeaponVisibility doesn't have a hand parameter.

 

Regards



#6
kevL

kevL
  • Members
  • 4 078 messages
i searched through 'nwscript.nss' for "model" and saw some interesting things ...

thinking the weapon-model-parts could be changed on the fly ...

But i'm guessing they are either leftovers from NwN1, or were never fully implemented in NwN2.


since the functions that are referred to ( Get/SetItemModel ) don't appear to exist, and GetItemAppearance has no setter.

stock scripts seem to rely on CopyItemAndModify() instead of changing values of an item-in-place. I'm under the impression that what you want to do is possible in NwN1 (where it is possible to change tinting eg. on the fly)

#7
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 603 messages

Thanks for digging around.