Custom bound item ring not working for NPCs

Post » Fri May 27, 2011 10:12 pm

I followed this tutorial: http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Custom_Bound_Items#Bound_Item_Scripting

I've got the ring made and it works great for the PC, but I want it to be able to be used by an NPC partner and it doesn't work. Is there something in the scripting that needs to be changed?
User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Sat May 28, 2011 10:46 am

I followed this tutorial: http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Custom_Bound_Items#Bound_Item_Scripting

I've got the ring made and it works great for the PC, but I want it to be able to be used by an NPC partner and it doesn't work. Is there something in the scripting that needs to be changed?


Is the NPC wearing an armor or clothing that hides rings ??
User avatar
Eilidh Brian
 
Posts: 3504
Joined: Mon Jun 19, 2006 10:45 am

Post » Sat May 28, 2011 6:15 am

Is the NPC wearing an armor or clothing that hides rings ??


No, they're completely naked.
User avatar
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Sat May 28, 2011 2:53 am

Anyone got suggestions on what to do here?
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm

Post » Sat May 28, 2011 10:32 am

Anyone got suggestions on what to do here?

Try posting your script so we can see it. Someone might notice an error.
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Fri May 27, 2011 9:27 pm

Try posting your script so we can see it. Someone might notice an error.


It's exactly like the one in the tutorial.

This one goes on all the equipment the ring summons:
ScriptName bindTestSummonedScript

; Tutorial Summoned Item Script.
; This is for any item summoned by the "Ready Ring"
; Handles two things: Removing item when the player unequips it,
; and unequipping the ready ring when that happens

;UserRef is the actor that has the summoned gear
ref UserRef

Begin OnUnequip
;If the user is wearing the summoning object(the ring), remove it.
if(UserRef.GetEquipped bindTestRing == 1)
UserRef.UnequipItem bindTestRing 0
endif

; And remove this 'summoned' object
Disable
RemoveMe
End

Begin OnAdd
; Get the whoever is holding this item at this time only.
set UserRef to GetContainer
; If they're not wearing the summoning object, remove this!
if(UserRef.GetEquipped bindTestRing == 0)
UserRef.UnequipItem bindTestRing 0
Disable
RemoveMe
endif
End


This one goes on the ring itself:
ScriptName bindTestSummonerScript

; Tutorial Item Summoner Script
; This is for the magical object (Ready Ring) which will
; summon a sword, shield, and helmet onto the player
; If the ring is removed, these items are unequipped(and then remove themselves)

;UserRef is the actor that has the summoned gear
ref UserRef

; When the ring is unequipped for any reason(sell/drop/normal),
; we force removal of all 'summoned' items
; These items in turn remove themselves, thus completing the
; bound weapon/armor effect
Begin OnUnequip

; Just go through, if a bound item is equipped, remove it

; Sword
if(UserRef.GetEquipped bindTestSword == 1)
UserRef.UnequipItem bindTestSword 0
endif

; Shield
if(UserRef.GetEquipped bindTestShield == 1)
UserRef.UnequipItem bindTestShield 0
endif

; Helmet
if(UserRef.GetEquipped bindTestHelmet == 1)
UserRef.UnequipItem bindTestHelmet 0
endif

End

Begin OnAdd
; Get whomever is holding this object
set UserRef to GetContainer
End

; When someone equips the ring, we activate the 'bound weapon/armor' enchantments
Begin OnEquip

; If the player does not have the item, add it and force equip it.
; This prevents us from getting 2 copies of an item if we've
; somehow overwhelmed oblivion into not removing one

; First do the sword
if(UserRef.GetItemCount bindTestSword <= 0)
UserRef.AddItem bindTestSword, 1
endif
UserRef.EquipItem bindTestSword 0

; Then Shield
if(UserRef.GetItemCount bindTestShield <= 0)
UserRef.AddItem bindTestShield, 1
endif
UserRef.EquipItem bindTestShield 0

; And Helmet
if(UserRef.GetItemCount bindTestHelmet <= 0)
UserRef.AddItem bindTestHelmet, 1
endif
UserRef.EquipItem bindTestHelmet 0

End
User avatar
OnlyDumazzapplyhere
 
Posts: 3445
Joined: Wed Jan 24, 2007 12:43 am


Return to IV - Oblivion