Jump to content

Help with GETCONTAINER...


AbbaddoN33

Recommended Posts

Hello! I'm having an issue using GETCONTAINER in npcs with prefix "ff". Here's my script condensed and simplified. This is embedded in an item distributed in some npcs through leveled lists:

 

 

Scn a33script

 

ref a33actorref

short a33doonce

short a33doonce2

 

;====================================

 

begin gamemode

 

if a33doonce == 0

set a33actorref to getcontainer

set a33doonce to 1

endif

 

if (a33actorref.getdead == 1)&&(a33doonce2 == 0)

set a33doonce2 to 1

dropme

endif

 

end

 

 

This should detect when the npc that has it in his inventory dies, and then the item should drop of him.

When I use it in npcs with prefix that it's not "ff" works perfect, but it's not that way in npcs with prefix "ff". I use SV command in the console, and script var "a33actorref" give 0000000. Do i'm missing something?

Link to comment
Share on other sites

GetContainer can fail when called the first frame or two after your item has been added to an inventory.

 

 

scn a33script

ref a33actorref
int a33doonce

begin gamemode

    if a33doonce
    else
        if a33actorref
            if a33actorref.getdead
                set a33doonce to 1
                dropme
            endif
        else
            set a33actorref to getcontainer
        endif
    endif

end ; gamemode
Link to comment
Share on other sites

There is no doubt that you are a master of the script. The advice you gave me worked perfectly. Many thanks Luthienanarion! :) Kudos to you! Edited by AbbaddoN33
Link to comment
Share on other sites

  • Recently Browsing   0 members

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