wulfy1 Posted December 18, 2010 Share Posted December 18, 2010 (edited) I'm trying to control removeItem functions based on equipped slots in a companion mod I'm making. I have tried to use OBSE to accomplish this and it works intermittently and I was hoping that someone with experience could help me sharpen up the functionality. My example script is listed below. The quest script which provides the dialogue topics and in the result script has the lines to remove the items. The quest script has nothing more than the script variables : Short VSSTotalShort VSSClothesShort VSSJewelryShort VSSHeadShort VSSUpperBodyShort VSSLowerBodyShort VSSHandShort VSSFootShort VSSRingRightShort VSS RingLeftShort VSSAmuletShort VSSShield While if the dialogue topics are "Change Clothes" with a result script of "Set SavingSammiClothes.VSSUpperBody to 0" followed by "Remove your top" The result script is "Set SavingSammiClothes.VSSUpperBody to 1" I know I could use a dummy upper body slot item item to fill that slot on the companion but I want that slot open for the introduction of a predetermined item like a more specific shirt. I decided to narrow it down to one particular equipment slot until I get it all ironed out. It will remove the upper body once but will not do it a second time. The below script segment is inserted into a partner script: Short SSHeadDoShort SSUpperBodyDo Short SSUpperBodyRef VSSUpperBodyRef ;2 Begin OnActivate Set SavingSammiClothes.VSSUpperBody to SSUpperBody End Begin GameMode if SavingSammiClothes.VSSUpperBody == 1 && SSUpperBodyDo == 0 set VSSUpperBodyRef to GetEquippedObject 2 UnEquipItem VSSUpperBodyREF RemoveItem VSSUpperBodyREF 1 AddItem cmTorch02 1 EquipItem cmTorch02 RemoveItem cmTorch02 1 set VSSUpperBodyRef to GetEquippedObject 2 Set SSUpperBodyDo to 1 elseif SSUpperBodyDo == 1 && SavingSammiClothes.VSSUpperBody == 0 set SSUpperBodyDo to 0 EndIfEnd This is my first mod and I may be approaching this from the wrong direction entirely. If someone has any ideas/suggestions/corrections please post up! Any help would be great, thanks! Wulf Edited December 19, 2010 by wulfy1 Link to comment Share on other sites More sharing options...
wulfy1 Posted December 19, 2010 Author Share Posted December 19, 2010 Any input on this? Link to comment Share on other sites More sharing options...
Recommended Posts