mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge pull request #1636 from Verteiron/master
Add support for Papyrus scripts
This commit is contained in:
@@ -1795,6 +1795,13 @@ Pan:
|
||||
extensions:
|
||||
- .pan
|
||||
|
||||
Papyrus:
|
||||
type: programming
|
||||
color: "#6600cc"
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .psc
|
||||
|
||||
Parrot:
|
||||
type: programming
|
||||
color: "#f3ca0a"
|
||||
|
||||
68
samples/Papyrus/CAMTEST_OverShoulderME.psc
Normal file
68
samples/Papyrus/CAMTEST_OverShoulderME.psc
Normal file
@@ -0,0 +1,68 @@
|
||||
Scriptname CAMTEST_OverShoulderME extends activemagiceffect
|
||||
{Play with camera effects}
|
||||
|
||||
;--=== Imports ===--
|
||||
|
||||
Import Utility
|
||||
Import Game
|
||||
|
||||
;--=== Properties ===--
|
||||
|
||||
Actor Property PlayerRef Auto
|
||||
ActorBase Property CAMTEST_CameraActor Auto
|
||||
|
||||
;--=== Variables ===--
|
||||
|
||||
Actor Player
|
||||
|
||||
Actor Camera
|
||||
|
||||
Actor Target
|
||||
|
||||
Float PosX
|
||||
Float PosY
|
||||
Float PosZ
|
||||
Float SpeedMult
|
||||
|
||||
ObjectReference Mist
|
||||
ObjectReference Fog
|
||||
|
||||
;--=== Events ===--
|
||||
|
||||
Event OnInit()
|
||||
Player = PlayerRef
|
||||
EndEvent
|
||||
|
||||
Event onEffectStart(Actor akTarget, Actor akCaster)
|
||||
Camera = Player.PlaceActorAtMe(CAMTEST_CameraActor)
|
||||
Camera.EnableAI(False)
|
||||
Camera.SetScale(0.1)
|
||||
Camera.TranslateTo(Player.X + 40,Player.Y,Player.Z,0,0,0,800,30)
|
||||
DisablePlayerControls(abMovement = true, abFighting = true, abCamSwitch = true, abLooking = true, abSneaking = true, abMenu = true, abActivate = true, abJournalTabs = false)
|
||||
SetPlayerAIDriven(True)
|
||||
ForceThirdPerson()
|
||||
SetHUDCartMode()
|
||||
SetInChargen(True, True, False)
|
||||
SetCameraTarget(Camera)
|
||||
ForceFirstPerson()
|
||||
Wait(1)
|
||||
Camera.SplineTranslateTo(Player.X + 4000,Player.Y,Player.Z + 1000,15,0,Camera.GetHeadingAngle(Player) + Camera.GetAngleZ(),1800,800,100)
|
||||
; Camera.SetLookAt(Player)
|
||||
Wait(10)
|
||||
Camera.SplineTranslateTo(Player.X + 1000,Player.Y - 500,Player.Z + 500,25,0,Camera.GetHeadingAngle(Player) + Camera.GetAngleZ(),1800,800,100)
|
||||
Wait(10)
|
||||
SetHUDCartMode(False)
|
||||
SetCameraTarget(Player)
|
||||
SetInChargen(False, False, False)
|
||||
EnablePlayerControls()
|
||||
SetPlayerAIDriven(False)
|
||||
EndEvent
|
||||
|
||||
Event onUpdate()
|
||||
EndEvent
|
||||
|
||||
Event onEffectFinish(Actor akTarget, Actor akCaster)
|
||||
EndEvent
|
||||
|
||||
;--=== Functions ===--
|
||||
|
||||
1
samples/Papyrus/vMFX_FXPlugin.psc
Normal file
1
samples/Papyrus/vMFX_FXPlugin.psc
Normal file
@@ -0,0 +1 @@
|
||||
Scriptname vMFX_FXPlugin extends Quest
|
||||
120
samples/Papyrus/vSCM_MetaQuestScript.psc
Normal file
120
samples/Papyrus/vSCM_MetaQuestScript.psc
Normal file
@@ -0,0 +1,120 @@
|
||||
Scriptname vSCM_MetaQuestScript extends Quest
|
||||
{Do initialization and track variables for scripts}
|
||||
|
||||
;--=== Imports ===--
|
||||
|
||||
Import Utility
|
||||
Import Game
|
||||
|
||||
;--=== Properties ===--
|
||||
|
||||
Actor Property PlayerRef Auto
|
||||
|
||||
Float Property ModVersion Auto Hidden
|
||||
|
||||
String Property ModName = "Smarter Combat Music" Auto Hidden
|
||||
|
||||
Message Property vSCM_ModLoadedMSG Auto
|
||||
Message Property vSCM_ModUpdatedMSG Auto
|
||||
|
||||
;--=== Variables ===--
|
||||
|
||||
Float _CurrentVersion
|
||||
String _sCurrentVersion
|
||||
|
||||
Bool _Running
|
||||
|
||||
Float _ScriptLatency
|
||||
Float _StartTime
|
||||
Float _EndTime
|
||||
|
||||
;--=== Events ===--
|
||||
|
||||
Event OnInit()
|
||||
If ModVersion == 0
|
||||
DoUpkeep(True)
|
||||
EndIf
|
||||
EndEvent
|
||||
|
||||
Event OnReset()
|
||||
Debug.Trace("SCM: Metaquest event: OnReset")
|
||||
EndEvent
|
||||
|
||||
Event OnGameReloaded()
|
||||
Debug.Trace("SCM: Metaquest event: OnGameReloaded")
|
||||
EndEvent
|
||||
|
||||
;--=== Functions ===--
|
||||
|
||||
Function DoUpkeep(Bool DelayedStart = True)
|
||||
;FIXME: CHANGE THIS WHEN UPDATING!
|
||||
_CurrentVersion = 0.01
|
||||
_sCurrentVersion = GetVersionString(_CurrentVersion)
|
||||
String sErrorMessage
|
||||
If DelayedStart
|
||||
Wait(RandomFloat(2,4))
|
||||
EndIf
|
||||
Debug.Trace("SCM: " + ModName)
|
||||
Debug.Trace("SCM: Performing upkeep...")
|
||||
Debug.Trace("SCM: Loaded version is " + GetVersionString(ModVersion) + ", Current version is " + _sCurrentVersion)
|
||||
If ModVersion == 0
|
||||
Debug.Trace("SCM: Newly installed, doing initialization...")
|
||||
DoInit()
|
||||
If ModVersion == _CurrentVersion
|
||||
Debug.Trace("SCM: Initialization succeeded.")
|
||||
Else
|
||||
Debug.Trace("SCM: WARNING! Initialization had a problem!")
|
||||
EndIf
|
||||
ElseIf ModVersion < _CurrentVersion
|
||||
Debug.Trace("SCM: Installed version is older. Starting the upgrade...")
|
||||
DoUpgrade()
|
||||
If ModVersion != _CurrentVersion
|
||||
Debug.Trace("SCM: WARNING! Upgrade failed!")
|
||||
Debug.MessageBox("WARNING! " + ModName + " upgrade failed for some reason. You should report this to the mod author.")
|
||||
EndIf
|
||||
Debug.Trace("SCM: Upgraded to " + _CurrentVersion)
|
||||
vSCM_ModUpdatedMSG.Show(_CurrentVersion)
|
||||
Else
|
||||
Debug.Trace("SCM: Loaded, no updates.")
|
||||
;CheckForOrphans()
|
||||
EndIf
|
||||
CheckForExtras()
|
||||
UpdateConfig()
|
||||
Debug.Trace("SCM: Upkeep complete!")
|
||||
EndFunction
|
||||
|
||||
Function DoInit()
|
||||
Debug.Trace("SCM: Initializing...")
|
||||
_Running = True
|
||||
ModVersion = _CurrentVersion
|
||||
vSCM_ModLoadedMSG.Show(_CurrentVersion)
|
||||
EndFunction
|
||||
|
||||
Function DoUpgrade()
|
||||
_Running = False
|
||||
If ModVersion < 0.01
|
||||
Debug.Trace("SCM: Upgrading to 0.01...")
|
||||
ModVersion = 0.01
|
||||
EndIf
|
||||
_Running = True
|
||||
Debug.Trace("SCM: Upgrade complete!")
|
||||
EndFunction
|
||||
|
||||
Function UpdateConfig()
|
||||
Debug.Trace("SCM: Updating configuration...")
|
||||
|
||||
Debug.Trace("SCM: Updated configuration values, some scripts may update in the background!")
|
||||
EndFunction
|
||||
|
||||
String Function GetVersionString(Float fVersion)
|
||||
Int Major = Math.Floor(fVersion) as Int
|
||||
Int Minor = ((fVersion - (Major as Float)) * 100.0) as Int
|
||||
If Minor < 10
|
||||
Return Major + ".0" + Minor
|
||||
Else
|
||||
Return Major + "." + Minor
|
||||
EndIf
|
||||
EndFunction
|
||||
|
||||
Function CheckForExtras()
|
||||
EndFunction
|
||||
Reference in New Issue
Block a user