Jump to content

Correct Disable/RemoveMe usage please


Jumonji

Recommended Posts

I'm trying to script my companion to pickup valuable items in certain situations and I'm having trouble with actually moving items from the ground to a special inventory container. Here are my latest non-working attempts using OBSE.

 

Attempt 1:

 

set rItem to GetFirstRef 70; get reference for the first carriable item
saveIP 20
     if ( rItem ); continue until all refs are processed
        set rItemID to rItem.GetBaseObject
        if IsArmor rItemID
                    if GetGoldValue rItemID >= 200
                        rItem.RemoveMe a1jCompanionLootShare
                    endif
        endif
        set rItem to apple; Hacking the OBSE "apple bug" as reported by scruggsywuggsy.
        set rItem to getNextRef
        restoreIP 20
    endif
end

 

Attempt 2:

 

...
                    if GetGoldValue rItemID >= 200
                        a1jCompanionLootShare.AddItem rItemID 1
                        rItem.RemoveMe
                    endif
...

 

The first example seems to do nothing. The second example will add the item to the inventory, but the one on the ground is still there, too.

 

Help, anyone?

 

-Jumonji

Link to comment
Share on other sites

The closest I could get to any NPC looting another when the target, or the items weren't known beforehand didn't actually work very well. I honestly didn't spend much time on it, and havn't gone back to it, but maybe it will prove useful to give an idea. It was put together quite awhile ago, so there are probably some simple mistakes. It also doesn't use OBSE, so the inclusion of OBSE might allow it to work. I've archived the scripts in question on my project forums since I needed a place to put it that wasn't my desktop inside a notepad file. The actual esp that used this script no longer exists since it never worked out to anything.

http://z2.invisionfree.com/DarkGenesis/ind...p?showtopic=813

Link to comment
Share on other sites

Thanks, Vagrant.

 

I've got the NPC looting part working. Moving items between inventories is relatively easy (removeItem from one, AddItem on the second.) The hard part was removing from the cell - no inventory - and adding to a container.

 

But I found the answer - use an NPC Shadow for the container. Then you can use Activate to add the item, unlike a normal container.

 

The idea is explained here: Remove Activators

 

-Jumonji

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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