Identify current container

Post » Fri Jun 17, 2011 1:22 am

Is there a function to determine what container I currently have open? I'm not clear on if GetContainer can only be used to get what container an item is inside, or if I can use it to get the identity of a container I'm currently accessing.

Basically, during a MenuMode script, I want to check if I'm accessing a specific container, and if so, remove the quest item flag from certain items so I can put them in said container (NPC inventory actually).

Since the ''containers'' I want to identify are NPCs, is there a function to identify the NPC I'm currently interacting with?

Queue
User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Fri Jun 17, 2011 2:01 am

My first idea would be to use getCrosshairRef. It may not return the current container after you opened it, but at least it's last non-null value should be whatever you're looking for.
User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Fri Jun 17, 2011 4:04 am

Ooh, I think that'll do the trick, thanks.

It doesn't actually need to be fool-proof. At worst, if it fails to get the correct reference, the item will remain quest flagged, so it won't be lost.

Queue
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm


Return to Fallout: New Vegas