Code Snippets Papyrus

Short texts Papyrus 🧑‍💻 Code snippets Papyrus ✍️ Reading lists Papyrus 👀

Make Shooting Bow Bad.psc

scriptName Apprentice_Test_Effect extends ActiveMagicEffect float CurrentAlpha event OnEffectStart(Actor target, Actor caster) RegisterForUpdate(1.0) CurrentAlpha = UI.GetFloat(“HUD Menu”, “_root.HUDMovieBaseInstance.CrosshairInstance._alpha”) UI.SetFloat(“HUD Menu”, “_root.HUDMovieBaseInstance.CrosshairInstance._alpha”, 0.0) endEvent event OnEffectFinish(Actor target, Actor caster) UnregisterForUpdate() UI.SetFloat(“HUD Menu”, “_root.HUDMovieBaseInstance.CrosshairInstance._alpha”, CurrentAlpha) endEvent event OnUpdate() Debug.Notification(“Attacking!”) Game.ShakeCamera(afStrength = 0.1) Game.GetPlayer().SetActorValue(“Stamina”, 0.0) endEvent

Custom Skyrim Console Command

; Credit: milzschnitte ; Source: https://www.loverslab.com/topic/58600-skyrim-custom-console-commands-using-papyrus/ Scriptname MyScript extends ReferenceAlias Event OnInit() UnregisterForMenu(“Console”) RegisterForMenu(“Console”) endEvet Event OnPlayerLoadGame() UnregisterForMenu(“Console”) RegisterForMenu(“Console”) endEvent Event OnMenuOpen(string menuName) if menuName==”Console” RegisterForKey(28) RegisterForKey(156) endif endEvent Event OnMenuClose(string menuName) if menuName==”Console” UnregisterForKey(28) UnregisterForKey(156) endif endEvent Event OnKeyDown(int keyCode) if keyCode==28 || keyCode==156 int cmdCount = UI.GetInt(“Console”, “_global.Console.ConsoleInstance.Commands.length”) if cmdCount>0 cmdCount-=1 string cmdLine […]