Bind Papyrus Scripts On Game Load
This is a Developer Tool: for testing Papyrus scripts!
- Install Bind (it's an SKSE .dll compatible with SE/AE/GOG/VR)
- Create a Papyrus script
if you want it to extend a
QuestorObjectReference, specify anextends - Create a file
Data\Scripts\Bindings\<your mod name>.txt - Put the name of each of your scripts in the file, one line per script
MyScriptOne MyScriptTwo - Run the game!
Each of your scripts will automatically be bound to a game object and the
event OnInit()of each script will run
If you create scriptName Whatever extends Quest, it will bind to an generated quest.
If you create scriptName Whatever extends ObjectRefenrence, it will bind to a generated object.
If you create scriptName Whatever extends Actor, it will bind to the Player.
If you want to extend a specific object, see the v1 details below for this release.
SomeScript 0x123
SomeScript AnEditorIDℹ ️ If you run into any problems, check the
SkyrimScripting.Bind.login yourMy Games\Skyrim Special Edition\SKSE\folder.
The goal for v1 is to be as minimal as possible:
- Bindings are defined in
Scripts\Bindings\ - Each file should contain 1 line per desired "binding" (attach script to something)
- Support for binding to objects by Form ID
NameOfScript 0x14 - Support for binding to objects by Editor ID
NameOfScript dlc1serana - Support for binding to the Player (as an
ActorForm, not aReferenceAlias)NameOfScript $Player - Support for binding to an anonymous/generated
QuestNameOfScript $Quest - Support for binding to an anonymous/generated
Questwith a provided editor IDNameOfScript $Quest(MyCoolQuest) - Support for binding to an anonymous/generated
ObjectReferenceNameOfScript $ObjectObjects are ALWAYS placed in the
WEMerchantChestscell. This is not configurable. - Support for binding to a generated
ObjectReferenceof a specified base Form IDNameOfScript $Object(0x7) - Support for binding to a generated
ObjectReferenceof a specified base Editor IDNameOfScript $Object(FoodSweetroll) - Support for determining what to bind to automatically based on script
extendsNameOfScriptscriptName NameOfScript extends Quest ; Anonymous Quest scriptName NameOfScript extends Actor ; Player scriptName NameOfScript extends ObjectReference ; Anonymous Object scriptName NameOfScript extends CustomType ; CustomType parent(s) checked
- Binding to objects from mods (if you don't know the full Form ID) is not supported in
v1 - Nothing is configurable
Future Planned Version Features
This has not yet been implemented but is planned for the next release.
- Read every
.pex(file mtime support) - Auto register any including this comment:
scriptName Whatever { BIND: Player BIND: $NewQuest$ }
- Or Simply
scriptName Whatever {BIND}
