Functions
Functions allow you to call a specific piece of code via Papyrus, like showing messages, adding items, etc.
Notes
- The types have to always meet exactly their Papyrus equivalent, no exceptions and no auto-casting,
meaning that you can't pass an int to a float or an Actor to an ObjectReference parameter, for example. - The form IDs have to be loadorder independent, meaning that for normal forms, the first two digits are removed ("0x
XX123456" -> "0x123456")
and for light (esl) forms, the first five digits are removed ("0xFEXXX123" -> "0x123"). - The values of the 'pluginName', 'scriptName', 'functionName' and 'propertyName' keys are case-insensitive.
Events
There are two types of events a function can listen to under the "eventName" key.
If the event gets invoked, the function runs, if not, the function can only run through Papyrus.
- "OnGameStart" - Runs on session start.
- "OnGameLoad" - Runs on session start and on game load.
Example 1 - Global Function
This shows a message box on game start.
Example 2 - Member Function
This will add 100 caps to the player on game load.
0 comments