Jump to content

[LE] Scripting Help (Adding Only Specific Items To Chest)


Recommended Posts

Hey guys!! New to this modding business for games, i'm currently in progress of building a player home. Not sure where though yet so interior is first on my list. At the minute i'm nearly done for the alchemy room; this has an alchemy table (obviously), a shelf for each type of potion (health, magicka, stamina, poisons, resist potions and misc), and a knapsack against the wall for each and every ingredient you can get in the game incl dlc. All the knapsacks have been linked to each ingredient seperately however what i want is to make it so it will only accept said ingredient and the same for the potions/poisons.....

 

There is a script on the website already however i'm not sure how to figure it out so it works

 

ScriptName ExampleContainerScript Extends ObjectReference

Actor Property PlayerREF Auto
FormList Property AcceptedItemFLST Auto

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
If akSourceContainer == PlayerREF
If !AcceptedItemFLST.HasForm(akBaseItem)
RemoveItem(akBaseItem, aiItemCount, True, akSourceContainer)
Debug.Trace("Invalid Item")
EndIf
Endif
EndEvent

Link to comment
Share on other sites

You have to create a form list (In the Object Window under Miscellaneous you'll FormList) for each ingredient. Also each napsack needs to have a unique ID. Right click in the formlist area to create a new one, then drag the ingredient reference from the Object Window in to the form list. Attach your script to each sack. (You will have to create and compile that script and if you don't know how then that's another lesson). Open up the properties window by clicking on the compiled script attached to knapsacks. Fill in the properties listed there. The properties you need to fill in are the IDs for each ingredient. Here is an example of how to do it, but I think a different (but similar) script is used:

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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