Notepad++ Setup
Revision as of 16:56, 1 February 2012 by imported>Cipscis (Added instructions for syntax highlighting, including language definition file's content)
Notepad++ is a freeware text editor that can be used to edit and compile Papyrus scripts. It can be downloaded from the official Notepad++ site. Notepad++ supports user-defined syntax highlighting autocomplete, folding, and can be set up to quickly compile Papyrus scripts, making it a more robust option than using the basic in-editor text editor.
Setting up a quick compile
- Open Notepad++
- Hit F5 (run)
- Paste the line: "C:\Program Files (x86)\Steam\steamapps\common\skyrim\Papyrus compiler\ScriptCompile.bat" $(FILE_NAME)
- NOTE: Inside the quotes, paste in the equivalent path on your PC while points to that ScriptCompile.bat file.
- Select Save
- Name it something useful like “Compile”
- Set up a keyboard shortcut if you want, such as CTRL+F5.
- You can find the new shortcut under the Run menu option, or just use the keyboard shortcut.
- You can change the keyboard shortcut under Settings -> Shortcut Mapper -> Run Tab
- This will compile the script you are currently tabbed to while in notepad++.
Setting up Papyrus Language Definitions
Autocomplete
- Download this file: Papyrus Language Definitions
- Install the papyrus.xml file by placing it in your Notepad++\plugins\APIs directory (for example, C:\Program Files (x86)\Notepad++\plugins\APIs)
Syntax Highlighting
- Create an XML file with the following content:
<NotepadPlus>
<UserLang name="Papyrus" ext="psc">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="yes" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">"00"00</Keywords>
<Keywords name="Folder+">Event Function If State While</Keywords>
<Keywords name="Folder-">EndEvent EndFunction EndIf EndState EndWhile Native</Keywords>
<Keywords name="Operators">- ! % & ( ) * , . / [ ] | + < = ></Keywords>
<Keywords name="Comment">1{ 2} 0;</Keywords>
<Keywords name="Words1">Activate Add AddItem AddSpell AddToFaction Apply ApplyCrossFade ApplyHavokImpulse BlockActivation CalculateEncounterLevel CanPayCrimeGold Clear ClearDestruction CompleteAllObjectives CompleteQuest CreateDetectionEvent DamageActorValue DamageAV DamageObject Delete DeleteWhenAble Disable DisablePlayerControls DropObject Enable ENableFastTravel EnablePlayerControls EquipItem EquipShout EquipSpell EvaluatePackage Fire ForceActive ForceActorValue ForceAV ForceLocationTo ForceRefTo Get GetActorBase GetActorOwner GetActorReference GetActorValue GetActorValuePercentage GetAlias GetAV GetAVPercentage GetBaseActorValue GetBaseAV GetBaseObject GetClass GetCombatTarget GetCrimeFaction GetCrimeGold GetCrimeGoldNonViolent GetCrimeGoldViolent GetCurrentDestructionStage GetCurrentLocation GetCurrentPackage GetCurrentStageID GetDistance GetEditorLocation GetEquippedShout GetEquippedSpell GetFactionOwner GetFactionRank GetFactionReaction GetFavorPoints GetForm GetHigestRelationshipRank GetItemCount GetKey GetKeywordData GetLevel GetLinkedRef GetLocation GtLockLevel GetLowestRelationshipRank GetMass GetOpenState GetOwningQuest GetParentCell GetPlayer GetPlayerGrabbedRef GetPositionX GetPositionY GetPositionZ GetRace GetReaction GetReference GetRefTypeAliveCount GetRefTypeDeadCount GetRegard GetRelationshipRank GetReputation GetSex GetStage GetStageDone GetState GetValue GoToState HasAssociation HasCommonParent HasEffectKeyword HasFamilyRelationship HasKeyword HasLOS HasParentRelationship HasRefType Is3DLoaded IsActionComplete IsActivateChild IsAlarmed IsAlerted IsChild IsCleared IsCompleted IsDead IsDetectedBy IsDisabled IsDoingFavor IsEuiped IsInCombat IsInFaction IsInInterior IsLoaded IsLockBroken IsLocked IsObjectiveCompleted IsObjectiveDisplayed IsPlayerExpelled IsPlaying IsRunning IsSameLocation IsStageDone IsStartin IsStopped IsStopping IsTrespassing Kill Lock MessageBox ModActorValue ModAV ModCrimeGold ModFactionRank ModFavorPoints ModFavorPointsWithGlobal ModReaction ModRegard MoveTo MoveToPackageLocation MoveToWhenUnloaded PlaceActorAtMe PlaceAtMe Play PlayAnimation PlayAnimationAndWait PlayerPayCrimeGold ProcessTrapHit RandomFloat RandomInt RegisterForAnimationEvent RegisterForSingleUpdate RegisterForUpdate RegisterForUpdateGameTime Remove RemoveAllItems RemoveFromAllFactions RemoveFromFaction RemoveCrossFade RemoveItem RemoveSpell Reset RestoreActorValue RestoreAV SendAssaultAlarm SendPlayerToJail SendStoryEvent SendStoryEventAndWait SendTrespassAlarm ServeTime Set SetActive SetActorOwner SetActorValue SetAlert SetAlly SetAngle SetAV SetCleared SetCrimeFaction SetCrimeGold SetCurrentStageID SetDoingFavor SetEnemy SetEssential SetFactionOwner SetFactionRank SetKeywordData SetLockLevel SetObjectiveCompleted SetObjectiveDisplayed SetOpen SetOutfit SetPlayerExpelled SetPosition SetPublic SetRaction SetRelationshipRank SetStage SetValue Show Start StartCombat Stop StopCombat StopCombatAlarm TeachWord Trace TraceConditional TranslateTo TryToAddToFaction TryToDisable TryoEnable TryToKill TryToMoveTo TryToRemoveFromFaction TryToReset TryToStopCombat UnEquipItem UnregisterForAnimationEvent UnregisterForUpdate UnregisterForUpdateGameTime Wait</Keywords>
<Keywords name="Words2">OnActivate OnAnimationEvent OnAttachedToCell OnBeginState OnCellAttach OnCellDetach OnCellLoad OnClose OnCombatStateChanged OnContainerChanged OnDeath OnDying OnDestructionStageChanged OnDetachedFromCell OnEffectFinish OnEffectStart OnEndState OnEnterBleedout OnEquipped OnGainLOS OnGetUp OnGrab OnHit OnInit OnItemAdded OnItemRemoved OnLoad OnLocationChange OnLockStateChanged OnLostLOS OnMagicEffectApply OnObjectEquipped OnObjectUnequipped OnOpen OnPackageChange OnPackageEnd OnPackageStart OnRaceSwitchComplete OnRead OnRelease OnReset OnSell OnSleepStart OnSleepStop OnStoryActivateActor OnStoryAddToPlayer OnStoryArrest OnStoryAssaultActor OnStoryBribeNPC OnStoryCastMagic OnStoryChangeLocation OnStoryCraftItem OnStoryCrimeGold OnStoryCure OnStoryDialogue OnStoryDiscoverDeadBody OnStoryEscapeJail OnStoryFlatterNPC OnStoryHello OnStoryIncreaseLevel OnStoryIncreaseSkill OnStoryInfection OnStoryIntimidateNPC OnStoryJail OnStoryKillActor OnStoryNewVoicePower OnStoryPayFine OnStoryPickLock OnStoryPlayerGetsFavor OnStoryRelationshipChange OnStoryRemoveFromPlayer OnStoryScript OnStoryServedTime OnStoryTrespass OnTrackedStatsEvent OnTranslationAlmostComplete OnTranslationComplete OnTranslationFailed OnTrapHit OnTrapHitStart OnTrapHitStop OnTrigger OnTriggerEnter OnTriggerLeave OnUnequipped OnUnload OnUpdate OnUpdateGameTime OnWardHit</Keywords>
<Keywords name="Words3">Activator Actor ActorBase Alias Ammo Armor AssociationType Book Cell Class EffectShader EncounterZone Explosion Faction Form GlobalVariable ImageSpaceModifier Key Keyword LeveledItem Location LocationAlias LocationRefType MagickEfect Message MiscObject MusicType Notification ObjectReference Outfit Package Projectile Quest Race ReferenceAlias Scene Shout Sound Spell Topic TopicInfo VisualEffect Weapon Weather WordOfPower</Keywords>
<Keywords name="Words4">As Auto AutoReadOnly Bool Conditional Debug Else ElseIf EndProperty Extends False Float Game Global Hidden Import Int Length New None Parent Property Return ScriptName Self String True Utility</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="3" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="2" />
<WordsStyle name="NUMBER" styleID="4" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFF00" fontName="" fontStyle="2" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
- Install the custom language by opening the "User Defined Language" window in Notepad++ (accessible via the lightning button on the toolbar or via View > User-Defined Dialogue...), and import the XML file you created via the "Import..." button.