Jump to content

I need help using OBSE to control unequip functions in a mod


wulfy1

Recommended Posts

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 VSSTotal

Short VSSClothes

Short VSSJewelry

Short VSSHead

Short VSSUpperBody

Short VSSLowerBody

Short VSSHand

Short VSSFoot

Short VSSRingRight

Short VSS RingLeft

Short VSSAmulet

Short 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 SSHeadDo

Short SSUpperBodyDo

 

Short SSUpperBody

Ref 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

EndIf

End

 

 

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 by wulfy1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...