Notes for Skyrim Scripting episode
KillerItem(Object Reference)- Magic
SpellSelf(Lesser Power, Fire & Forget, Self) Optional:SpellTarget(Spell, Fire & Forget, Target Actor)AbilitySneak(Ability) [on ReferenceAlias]
- No .esp
JustAScriptHelloOnActivate*Food*
- Other Examples:
- Dialogue fragments, Quest stage fragments, etc
extends ActiveMagicEffect, Quest, ReferenceAlias,
ObjectReference, SKIConfigBase, Dialogue...Then look at how they are attached in Creation Kit.
- Comments (including
{docstring}comments) - Casing (insensitivity & idioms)
- int, float, bool, string
- Arrays
Utilityto create and resize
- String manipulation
StringUtil- How does SKSE add scripts and functions?
- Implicit casting
- Explicit
ascasting - Type naming collisions of local variables
There is no
switchand nofor
ifconditionalswhileloops- no
break
- no
GotoStateand organizing with functionsGotoState("")GetStateOnBeginStateandOnEndState
- Positional and Keyword Arguments
- Default argument values
- Type naming collisions of argument names
global- Global scripts (with only global functions)
native
- What is SKSE?
- Reverse Engineering, Hooks
- Comes with functions!
- Comes with events!
- Can make your own functions and events in your own SKSE plugins!
- View in .ess Elder Scrolls Save files
- Type naming collisions of variable/field names
autoautoReadonly- Not saved
- "Full properties"
- Readonly
- Writeonly
- Read and Write
conditional(only onautoand onconditionalscripts)- Filling properties
- Fill via CK
- Pick in render window (ObjectReference) or from cell (ObjectReference)
- Name it the same as the EditorID and auto-fill or create using CK
- Fill via No .esp
Game.GetForm()versus properties (leads into the next section...)
- Fill via CK
- Forms and Form IDs and Mod Indexes (FEzz000 zz000000 FF000000)
- Learn the type functions and properties from CreationKit.com and VS Code and reading source
Form<ObjectReference<ActorForm<BookAlias<ReferenceAliasActiveMagicEffect- Fallout 4 has
ScriptObject - Editor IDs and po3 Tweaks
- Attached to objects in the VM (
Bind()) - Constructor (
OnInit) - Casting a
Questto a certain script- Casting
ReferenceAliasetc to a certain script - Cannot upcast a script that wasn't attached as a given type
- If multiple scripts of the same type are attached, first or random instance returned
- For these circumstances, can store arrays (and arrays) or attached instances
- Casting
OnInitOnPlayerLoadGame- See Events page on CreationKit.com
- Can call just like functions
- Events added by
SKSE(and when using reloadscript)- Finding DXScanCodes
- Finding UI targets
- RegisterForSingleUpdate
- Utility.Wait[MenuMode]
- Sending
- Receiving
- Sending and Receiving with custom arguments
- Debug.MessageBox
- Debug.Notification
- Debug.Trace
- .ini settings
- Use a Quest and use
GetQuestby editor ID to return the singleton
- Via Creation Kit and MO2
- Via Visual Studio Code and
<Import>includes - Champollion when necessary to get the .psc to compile against / review
- Anonymization
- .pas representation