Jump to content

Making Custom Placable (In-Game) Containers For Sale


jwoltz

Recommended Posts

I'm not a modder. I'm a graphic designer. Mostly my modding experience has been limited to textures. Still, I've had this idea for a long time to make placable Barrels for vendors to sell so that I and other players can place them in-game like those items sold by AMajor7's Imperial Furniture Store. I've tried and tried and I just can't get them to work. I have my meshes and textures and even icons. I can make them fine (as items) and even get them into the seller's inventories. Problem is, once purchased, and placed in-game, they don't work as containers. When I hit the spacebar to activate, all they do is return to my inventory. I don't know how to script like AMajor7 did for their chests and drawers. I've tried on-line tutorials, but nothing seems to address my particular need. Is there anyone out there who can and/or is willing to share their knowledge as to how to do this? HELP! Thank you!

Link to comment
Share on other sites

First: keep your item as "inventory item" and don't alter its meshes.

 

Now create a new container base object (call it JwoltzContainer, and use any meshes, it doesn't matter, as this container won't be visible to player), and place one reference in the cell TestingHall (or any other dummy/secret cell you want). Assign an EditorID to this reference (JwoltzContainerRef), so you can use it in scripts.

 

Next step: create a new script with this code:

scn JwoltzContainerScript

Begin OnActivate
   If IsActionRef Player   ;if player interact with this object
      If IsControlPressed 28   ;if Grab key is pressed (default: Z)
         Activate Player   ;take the item
      Else
         JwoltzContainerRef.Activate Player   ;open the container
      EndIf
   EndIf
End

Begin OnEquip Player
   JwoltzContainerRef.Activate Player
End
Assign the script to your item. Done.

 

Now, when you interact with your item (or click it in your inventory), the script will open the container placed in the dummy/secret cell (remote activation). Your item won't be a real container, but it will act as a link to the real container.

You can still take your item if you hold the Grab key (default: Z) while activating it, so you can bring it with you and place it somewhere else (or even use it as a portable, unlimited bag for your loot)

 

You need OBSE for this. If you don't want OBSE, you can replace "If IsControlPressed 28" with "Player.IsSneaking" (without quotes).

Edited by forli
Link to comment
Share on other sites

  • Recently Browsing   0 members

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