Having a reference problem.

Post » Fri Oct 07, 2011 6:58 am

Ok so i'm trying to use IsInList to figure out if an item is in a specific list and unequip it if it is.

ScriptName xxContactsRef xxEyeglassesRef xxEaringsBegin OnEquip Player	; Grab us some head gear info	set xxEyeglasses to Player.GetEquippedObject 11	set xxEarings to Player.GetEquippedObject 13	If xxEyeglasses.IsInList RepairGlasses		Player.UnEquipItem xxEarings 0 1	EndIfEnd


now i'm fairly certain that it's just the IsInList part that i'm getting wrong, i've spent a couple of hours looking through GECK pages and Cipscis site and can't seem to figure out what i'm doing wrong. any thoughts?

thanks
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Fri Oct 07, 2011 7:16 pm

I've always had problems with IsInList, myself, so I use ListGetFormIndex to see if an item is in a list

ScriptName xxContactsRef xxEyeglassesRef xxEaringsshort iIndexBegin OnEquip Player        ; Grab us some head gear info        set xxEyeglasses to Player.GetEquippedObject 11        set xxEarings to Player.GetEquippedObject 13		set iIndex to ListGetFormIndex RepairGlasses xxEyeglasses		if (iIndex > -1)                Player.UnEquipItem xxEarings 0 1        EndIfEnd

User avatar
Joanne Crump
 
Posts: 3457
Joined: Sat Jul 22, 2006 9:44 am

Post » Fri Oct 07, 2011 3:12 pm

That's perfect, thanks alot. Now i can go sleep and crack on with it tomorrow :D
User avatar
Mel E
 
Posts: 3354
Joined: Mon Apr 09, 2007 11:23 pm


Return to Fallout: New Vegas