Complete Example Scripts: Difference between revisions
Jump to navigation
Jump to search
m
→Script a container that only accepts certain types of items: GetPlayer swapped for PlayerREF for consistency and 'cause it's leagues faster/cheaper
imported>JustinOther m (→A helper script with functions to get the current moonphase, sync between the two moons and day of the week: Parenthesis added to GameHoursPassed line for improved legibility) |
imported>JustinOther m (→Script a container that only accepts certain types of items: GetPlayer swapped for PlayerREF for consistency and 'cause it's leagues faster/cheaper) |
||
| Line 579: | Line 579: | ||
'''How to use this script''': Fill the FormList, AcceptedItemFLST, with only the item(s) you want the container to accept. | '''How to use this script''': Fill the FormList, AcceptedItemFLST, with only the item(s) you want the container to accept. | ||
<Source lang="Papyrus"> | <Source lang="Papyrus"> | ||
ScriptName ExampleContainerScript | ScriptName ExampleContainerScript Extends ObjectReference | ||
Actor Property PlayerREF Auto | |||
FormList Property AcceptedItemFLST Auto | FormList Property AcceptedItemFLST Auto | ||
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) | Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) | ||
If akSourceContainer == | If akSourceContainer == PlayerREF | ||
If !AcceptedItemFLST.HasForm(akBaseItem) | If !AcceptedItemFLST.HasForm(akBaseItem) | ||
RemoveItem(akBaseItem, aiItemCount, True, akSourceContainer) | RemoveItem(akBaseItem, aiItemCount, True, akSourceContainer) | ||