Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
m
imported>JustinOther
m (→‎Creating a Simple Toggle: Declared Bool in Event)
imported>JustinOther
Line 756: Line 756:


= Maintenance/update code which runs once per save load and shows a message when a mod is updated or first loaded =
= Maintenance/update code which runs once per save load and shows a message when a mod is updated or first loaded =
*With Skyrim v1.6+: All event based, so no polling is necessary. For this method to work, two scripts are needed as OnPlayerGameLoad will not fire from a Quest script.
*Requires Skyrim v1.6+: All event based, so no polling is necessary. For this method to work, two scripts are needed as OnPlayerGameLoad will not fire from a Quest script.
<Source lang="Papyrus">ScriptName YourQuestScript extends Quest
<Source lang="Papyrus">ScriptName YourQuestScript extends Quest


Line 782: Line 782:
EndEvent</source>
EndEvent</source>


*Not using 1.6+: Has to poll, but will work reliably and can be fit in with existing, reiterating code.
*Does not require Skyrim v1.6+: Has to poll, but will work reliably and can be fit in with existing, reiterating code.
<Source lang="Papyrus">ScriptName YourQuestScript extends Quest
<Source lang="Papyrus">ScriptName YourQuestScript extends Quest


Line 813: Line 813:
EndIf
EndIf
EndFunction</Source>
EndFunction</Source>
= Summon Spell =
= Summon Spell =
*The below will summon YourSummonREF from wherever they are to the player. In this example, it's dealt with by a spell, but the function could be placed and/or called elsweyr. If as a spell, be sure to set the cooldown time to about 3.0 seconds so the caster can't cast it again until it's worked itself out.
*The below will summon YourSummonREF from wherever they are to the player. In this example, it's dealt with by a spell, but the function could be placed and/or called elsweyr. If as a spell, be sure to set the cooldown time to about 3.0 seconds so the caster can't cast it again until it's worked itself out.
Anonymous user

Navigation menu