Difference between revisions of "Game Script"

imported>CraftySentinel
(→‎SKSE Global Functions: Added New SKSE Member Functions.)
imported>Pickysaurus
(→‎SKSE Global Functions: Added IsPluginInstalled)
 
(17 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
'''Extends:''' None
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]


Collection of game-specific global functions
Collection of game-specific global functions


== Definition ==
== Definition ==
<source lang="papyrus">
<source lang="papyrus">
ScriptName Game
ScriptName Game Hidden
</source>
</source>


== Properties ==
None


== Global Functions ==
== Global Functions ==
'''Function [[AddAchievement - Game|AddAchievement]](int aiAchievementID)'''
*Adds the specified achievement/trophy to the player's gamer profile.


'''Function [[AddPerkPoints - Game|AddPerkPoints]](int aiPerkPoints)'''
:'''[[AddAchievement - Game|AddAchievement]](Int ''aiAchievementID'')'''
*Adds the given number of perk points to the player. Clamped at 255.
:*Adds the specified achievement/trophy to the player's gamer profile.


'''Function [[AdvanceSkill - Game|AdvanceSkill]](string asSkillName, float afMagnitude)'''
:'''[[AddPerkPoints - Game|AddPerkPoints]](Int ''aiPerkPoints'')'''
*Advance the given skill on the player by the provided amount of skill usage
:*Adds the given number of perk points to the player. Clamped at 255.


'''bool Function [[AddHavokBallAndSocketConstraint - Game|AddHavokBallAndSocketConstraint]](ObjectReference arRefA, string arRefANode, ObjectReference arRefB, string arRefBNode, float afRefALocalOffsetX, float afRefALocalOffsetY, float afRefALocalOffsetZ, float afRefBLocalOffsetX, float afRefBLocalOffsetY, float afRefBLocalOffsetZ)'''
:'''[[AdvanceSkill - Game|AdvanceSkill]](String ''asSkillName'', Float ''afMagnitude'')'''
*Adds a ball-and-socket constraint between two rigid bodies, identified by their ref and node names
:*Advance the given skill on the player by the provided amount of skill usage


'''int Function [[CalculateFavorCost - Game|CalculateFavorCost]](int aiFavorPrice)'''
:'''Bool [[AddHavokBallAndSocketConstraint - Game|AddHavokBallAndSocketConstraint]](ObjectReference ''arRefA'', String ''arRefANode'', ObjectReference ''arRefB'', String ''arRefBNode'', Float ''afRefALocalOffsetX'', Float ''afRefALocalOffsetY'', Float ''afRefALocalOffsetZ'', Float ''afRefBLocalOffsetX'', Float ''afRefBLocalOffsetY'', Float ''afRefBLocalOffsetZ'')'''
*Calculates how many points the player would have to pay for a favor of the specified price.
:*Adds a ball-and-socket constraint between two rigid bodies, identified by their ref and node names


'''Function [[ClearPrison - Game|ClearPrison]]()'''
:'''Int [[CalculateFavorCost - Game|CalculateFavorCost]](Int ''aiFavorPrice'')'''
*Clears all Prison variables on the PlayerCharacter so the game will know he is out of prison.
:*Calculates how many points the player would have to pay for a favor of the specified price.


'''Function [[ClearTempEffects - Game|ClearTempEffects]]()'''
:'''[[ClearPrison - Game|ClearPrison]]()'''
*Clears all temp effects (such as terrain effects) in the game.
:*Clears all Prison variables on the PlayerCharacter so the game will know he is out of prison.


'''Function [[DisablePlayerControls - Game|DisablePlayerControls]](bool abMovement, bool abFighting, bool abCamSwitch, bool abLooking, bool abSneaking, bool abMenu, bool abActivate, bool abJournalTabs, int aiDisablePOVType)'''
:'''[[ClearTempEffects - Game|ClearTempEffects]]()'''
*Disables the specified player controls.
:*Clears all temp effects (such as terrain effects) in the game.


'''Function [[EnableFastTravel - Game|EnableFastTravel]](bool abEnable)'''
:'''[[DisablePlayerControls - Game|DisablePlayerControls]](Bool ''abMovement'', Bool ''abFighting'', Bool ''abCamSwitch'', Bool ''abLooking'', Bool ''abSneaking'', Bool ''abMenu'', Bool ''abActivate'', Bool ''abJournalTabs'', Int ''aiDisablePOVType'')'''
*Enables or disables the player's ability to fast travel.
:*Disables the specified player controls.


'''Function [[EnablePlayerControls - Game|EnablePlayerControls]](bool abMovement, bool abFighting, bool abCamSwitch, bool abLooking, bool abSneaking, bool abMenu, bool abActivate, bool abJournalTabs, int aiDisablePOVType)'''
:'''[[EnableFastTravel - Game|EnableFastTravel]](Bool ''abEnable'')'''
*Enables the specified player controls.
:*Enables or disables the player's ability to fast travel.


'''Function [[FadeOutGame - Game|FadeOutGame]](bool abFadingOut, bool abBlackFade, float afSecsBeforeFade, float afFadeDuration)'''
:'''[[EnablePlayerControls - Game|EnablePlayerControls]](Bool ''abMovement'', Bool ''abFighting'', Bool ''abCamSwitch'', Bool ''abLooking'', Bool ''abSneaking'', Bool ''abMenu'', Bool ''abActivate'', Bool ''abJournalTabs'', Int ''aiDisablePOVType'')'''
*Fades the game in and out with the specified parameters.
:*Enables the specified player controls.


'''Function [[FastTravel - Game|FastTravel]](ObjectReference akDestination)'''
:'''[[FadeOutGame - Game|FadeOutGame]](Bool ''abFadingOut'', Bool ''abBlackFade'', Float ''afSecsBeforeFade'', Float ''afFadeDuration'')'''
*Fast-travels the player to the specified object's location.
:*Fades the game in and out with the specified parameters.


'''Actor Function [[FindClosestActor - Game|FindClosestActor]](float afX, float afY, float afZ, float afRadius)'''
:'''[[FastTravel - Game|FastTravel]](ObjectReference ''akDestination'')'''
*Finds the closest actor within a given radius of a location
:*Fast-travels the player to the specified object's location.


'''Actor Function [[FindClosestActorFromRef - Game|FindClosestActorFromRef]](ObjectReference arCenter, float afRadius)'''
:'''Actor [[FindClosestActor - Game|FindClosestActor]](Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afRadius'')'''
*Finds the closest actor within a given radius of a reference
:*Finds the closest actor within a given radius of a location


'''ObjectReference Function [[FindClosestReferenceOfAnyTypeInList - Game|FindClosestReferenceOfAnyTypeInList]](FormList arBaseObjects, float afX, float afY, float afZ, float afRadius)'''
:'''Actor [[FindClosestActorFromRef - Game|FindClosestActorFromRef]](ObjectReference ''arCenter'', Float ''afRadius'')'''
*Finds the closest reference of any of the base objects in the list within a given radius of a location
:*Finds the closest actor within a given radius of a reference


'''ObjectReference Function [[FindClosestReferenceOfAnyTypeInListFromRef - Game|FindClosestReferenceOfAnyTypeInListFromRef]](FormList arBaseObjects, ObjectReference arCenter, float afRadius)'''
:'''ObjectReference [[FindClosestReferenceOfAnyTypeInList - Game|FindClosestReferenceOfAnyTypeInList]](FormList ''arBaseObjects'', Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afRadius'')'''
*Finds the closest reference of any of the base objects in the list within a given radius of a reference
:*Finds the closest reference of any of the base objects in the list within a given radius of a location


'''ObjectReference Function [[FindClosestReferenceOfType - Game|FindClosestReferenceOfType]](Form arBaseObject, float afX, float afY, float afZ, float afRadius)'''
:'''ObjectReference [[FindClosestReferenceOfAnyTypeInListFromRef - Game|FindClosestReferenceOfAnyTypeInListFromRef]](FormList ''arBaseObjects'', ObjectReference ''arCenter'', Float ''afRadius'')'''
*Finds the closest reference of a given base object within a given radius of a location
:*Finds the closest reference of any of the base objects in the list within a given radius of a reference


'''ObjectReference Function [[FindClosestReferenceOfTypeFromRef - Game|FindClosestReferenceOfTypeFromRef]](Form arBaseObject, ObjectReference arCenter, float afRadius)'''
:'''ObjectReference [[FindClosestReferenceOfType - Game|FindClosestReferenceOfType]](Form ''arBaseObject'', Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afRadius'')'''
*Finds the closest reference of a given base object within a given radius of a reference
:*Finds the closest reference of a given base object within a given radius of a location


'''Actor Function [[FindRandomActor - Game|FindRandomActor]](float afX, float afY, float afZ, float afRadius)'''
:'''ObjectReference [[FindClosestReferenceOfTypeFromRef - Game|FindClosestReferenceOfTypeFromRef]](Form ''arBaseObject'', ObjectReference ''arCenter'', Float ''afRadius'')'''
*Finds a random actor within a given radius of a location
:*Finds the closest reference of a given base object within a given radius of a reference


'''Actor Function [[FindRandomActorFromRef - Game|FindRandomActorFromRef]](ObjectReference arCenter, float afRadius)'''
:'''Actor [[FindRandomActor - Game|FindRandomActor]](Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afRadius'')'''
*Finds a random actor within a given radius of a reference
:*Finds a random actor within a given radius of a location


'''ObjectReference Function [[FindRandomReferenceOfAnyTypeInList - Game|FindRandomReferenceOfAnyTypeInList]](FormList arBaseObjects, float afX, float afY, float afZ, float afRadius)'''
:'''Actor [[FindRandomActorFromRef - Game|FindRandomActorFromRef]](ObjectReference ''arCenter'', Float ''afRadius'')'''
*Finds a random reference of any of the base objects in the list within a given radius of a location
:*Finds a random actor within a given radius of a reference


'''ObjectReference Function [[FindRandomReferenceOfAnyTypeInListFromRef - Game|FindRandomReferenceOfAnyTypeInListFromRef]](FormList arBaseObjects, ObjectReference arCenter, float afRadius)'''
:'''ObjectReference [[FindRandomReferenceOfAnyTypeInList - Game|FindRandomReferenceOfAnyTypeInList]](FormList ''arBaseObjects'', Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afRadius'')'''
*Finds a random reference of any of the base objects in the list within a given radius of a reference
:*Finds a random reference of any of the base objects in the list within a given radius of a location


'''ObjectReference Function [[FindRandomReferenceOfType - Game|FindRandomReferenceOfType]](Form arBaseObject, float afX, float afY, float afZ, float afRadius)'''
:'''ObjectReference [[FindRandomReferenceOfAnyTypeInListFromRef - Game|FindRandomReferenceOfAnyTypeInListFromRef]](FormList ''arBaseObjects'', ObjectReference ''arCenter'', Float ''afRadius'')'''
*Finds a random reference of a given base object within a given radius of a location
:*Finds a random reference of any of the base objects in the list within a given radius of a reference


'''ObjectReference Function [[FindRandomReferenceOfTypeFromRef - Game|FindRandomReferenceOfTypeFromRef]](Form arBaseObject, ObjectReference arCenter, float afRadius)'''
:'''ObjectReference [[FindRandomReferenceOfType - Game|FindRandomReferenceOfType]](Form ''arBaseObject'', Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afRadius'')'''
*Finds a random reference of a given base object within a given radius of a reference
:*Finds a random reference of a given base object within a given radius of a location


'''Function [[ForceFirstPerson - Game|ForceFirstPerson]]()'''
:'''ObjectReference [[FindRandomReferenceOfTypeFromRef - Game|FindRandomReferenceOfTypeFromRef]](Form ''arBaseObject'', ObjectReference ''arCenter'', Float ''afRadius'')'''
*Forces the player camera into 1st-person.
:*Finds a random reference of a given base object within a given radius of a reference


'''Function [[ForceThirdPerson - Game|ForceThirdPerson]]()'''
:'''[[ForceFirstPerson - Game|ForceFirstPerson]]()'''
*Forces the player camera into 3rd-person.
:*Forces the player camera into 1st-person.


'''Form Function [[GetForm - Game|GetForm]](int aiFormID)'''
:'''[[ForceThirdPerson - Game|ForceThirdPerson]]()'''
*Obtains a [[Form Script|Form]] from the game by its form ID number.
:*Forces the player camera into 3rd-person.


'''Form Function [[GetFormFromFile - Game|GetFormFromFile]](int aiFormID, string asFilename)'''
:'''Form [[GetForm - Game|GetForm]](Int ''aiFormID'')'''
*Obtains the form specified by its form ID number which originated in the specified file.
:*Obtains a [[Form Script|Form]] from the game by its form ID number.


'''float Function [[GetGameSettingFloat - Game|GetGameSettingFloat]](string asGameSetting)'''
:'''Form [[GetFormFromFile - Game|GetFormFromFile]](Int ''aiFormID'', String ''asFilename'')'''
*Obtains the value of a float game setting.
:*Obtains the form specified by its form ID number which originated in the specified file.


'''float Function [[GetGameSettingInt - Game|GetGameSettingInt]](string asGameSetting)'''
:'''Float [[GetGameSettingFloat - Game|GetGameSettingFloat]](String ''asGameSetting'')'''
*Obtains the value of an int game setting.
:*Obtains the value of a float game setting.


'''float Function [[GetGameSettingString - Game|GetGameSettingString]](string asGameSetting)'''
:'''Float [[GetGameSettingInt - Game|GetGameSettingInt]](String ''asGameSetting'')'''
*Obtains the value of a string game setting.
:*Obtains the value of an int game setting.


'''Actor Function [[GetPlayer - Game|GetPlayer]]()'''
:'''Float [[GetGameSettingString - Game|GetGameSettingString]](String ''asGameSetting'')'''
*Obtains the [[Actor Script|Actor]] that represents the player.
:*Obtains the value of a string game setting.


'''ObjectReference Function [[GetPlayerGrabbedRef - Game|GetPlayerGrabbedRef]]()'''
:'''Actor [[GetPlayer - Game|GetPlayer]]()'''
*Obtains the [[ObjectReference Script|ObjectReference]] the player is currently grabbing.
:*Obtains the [[Actor Script|Actor]] that represents the player.


'''Actor Function [[GetPlayersLastRiddenHorse - Game|GetPlayersLastRiddenHorse]]()'''
:'''ObjectReference [[GetPlayerGrabbedRef - Game|GetPlayerGrabbedRef]]()'''
*Gets this actors last ridden horse if it is the player. Returns None if player has not ridden a horse is not the player.
:*Obtains the [[ObjectReference Script|ObjectReference]] the player is currently grabbing.


'''float Function [[GetRealHoursPassed - Game|GetRealHoursPassed]]()'''
:'''Actor [[GetPlayersLastRiddenHorse - Game|GetPlayersLastRiddenHorse]]()'''
*Returns the number of real-life hours that have passed playing the game.
:*Gets this actors last ridden horse if it is the player. Returns None if player has not ridden a horse is not the player.


'''float Function [[GetSunPositionX - Game|GetSunPositionX]]()'''
:'''Float [[GetRealHoursPassed - Game|GetRealHoursPassed]]()'''
*Gets the X position of the sun.
:*Returns the number of real-life hours that have passed playing the game.


'''float Function [[GetSunPositionY - Game|GetSunPositionY]]()'''
:'''Float [[GetSunPositionX - Game|GetSunPositionX]]()'''
*Gets the Y position of the sun.
:*Gets the X position of the sun.


'''float Function [[GetSunPositionZ - Game|GetSunPositionZ]]()'''
:'''Float [[GetSunPositionY - Game|GetSunPositionY]]()'''
*Gets the Z position of the sun.
:*Gets the Y position of the sun.


'''Function [[HideTitleSequenceMenu - Game|HideTitleSequenceMenu]]()'''
:'''Float [[GetSunPositionZ - Game|GetSunPositionZ]]()'''
*Hides the title sequence menu.
:*Gets the Z position of the sun.


'''Function [[IncrementSkill - Game|IncrementSkill]](string asSkillName)'''
:'''[[HideTitleSequenceMenu - Game|HideTitleSequenceMenu]]()'''
*Advances the provided Skill by the one point (for the player only).
:*Hides the title sequence menu.


'''Function [[IncrementSkillBy - Game|IncrementSkillBy]](string asSkillName, int aiCount)'''
:'''[[IncrementSkill - Game|IncrementSkill]](String ''asSkillName'')'''
*Advances the provided Skill by the given number of points (for the player only).
:*Advances the provided Skill by the one point (for the player only).


'''Function [[IncrementStat - Game|IncrementStat]](string asStatName, int aiModAmount) native global'''
:'''[[IncrementSkillBy - Game|IncrementSkillBy]](String ''asSkillName'', Int ''aiCount'')'''
*Modifies the specified MiscStat by the given amount
:*Advances the provided Skill by the given number of points (for the player only).


'''bool Function [[IsActivateControlsEnabled - Game|IsActivateControlsEnabled]]()'''
:'''[[IncrementStat - Game|IncrementStat]](String ''asStatName'', Int ''aiModAmount'')'''
*Are the activation controls enabled?
:*Modifies the specified MiscStat by the given amount


'''bool Function [[IsCamSwitchControlsEnabled - Game|IsCamSwitchControlsEnabled]]()'''
:'''Bool [[IsActivateControlsEnabled - Game|IsActivateControlsEnabled]]()'''
*Are the camera switch controls enabled?
:*Are the activation controls enabled?


'''bool Function [[IsFastTravelEnabled - Game|IsFastTravelEnabled]]()'''
:'''Bool [[IsCamSwitchControlsEnabled - Game|IsCamSwitchControlsEnabled]]()'''
*Is fast travel enabled?
:*Are the camera switch controls enabled?


'''bool Function [[IsFastTravelControlsEnabled - Game|IsFastTravelControlsEnabled]]()'''
:'''Bool [[IsFastTravelEnabled - Game|IsFastTravelEnabled]]()'''
*Are fast travel controls enabled?
:*Is fast travel enabled?


'''bool Function [[IsFightingControlsEnabled - Game|IsFightingControlsEnabled]]()'''
:'''Bool [[IsFastTravelControlsEnabled - Game|IsFastTravelControlsEnabled]]()'''
*Are the fighting controls enabled?
:*Are fast travel controls enabled?


'''bool Function [[IsJournalControlsEnabled - Game|IsJournalControlsEnabled]]()'''
:'''Bool [[IsFightingControlsEnabled - Game|IsFightingControlsEnabled]]()'''
*Are the journal menu controls enabled?
:*Are the fighting controls enabled?


'''bool Function [[IsLookingControlsEnabled - Game|IsLookingControlsEnabled]]()'''
:'''Bool [[IsJournalControlsEnabled - Game|IsJournalControlsEnabled]]()'''
*Are the looking controls enabled?
:*Are the journal menu controls enabled?


'''bool Function [[IsMenuControlsEnabled - Game|IsMenuControlsEnabled]]()'''
:'''Bool [[IsLookingControlsEnabled - Game|IsLookingControlsEnabled]]()'''
*Are the menu controls enabled?
:*Are the looking controls enabled?


'''bool Function [[IsMovementControlsEnabled - Game|IsMovementControlsEnabled]]()'''
:'''Bool [[IsMenuControlsEnabled - Game|IsMenuControlsEnabled]]()'''
*Are the movement controls enabled?
:*Are the menu controls enabled?


'''bool Function [[IsPlayerSungazing - Game|IsPlayerSungazing]]()'''
:'''Bool [[IsMovementControlsEnabled - Game|IsMovementControlsEnabled]]()'''
*Checks to the see if the player is looking directly at the sun.
:*Are the movement controls enabled?


'''bool Function [[IsSneakingControlsEnabled - Game|IsSneakingControlsEnabled]]()'''
:'''Bool [[IsPlayerSungazing - Game|IsPlayerSungazing]]()'''
*Are the sneaking controls enabled?
:*Checks to the see if the player is looking directly at the sun.


'''bool Function [[IsWordUnlocked - Game|IsWordUnlocked]](WordOfPower akWord)'''
:'''Bool [[IsSneakingControlsEnabled - Game|IsSneakingControlsEnabled]]()'''
*Is the word of power unlocked on the player?
:*Are the sneaking controls enabled?


'''Function [[PlayBink - Game|PlayBink]](string asFileName, bool abInterruptible, bool abMuteAudio, bool abMuteMusic, bool abLetterbox)'''
:'''Bool [[IsWordUnlocked - Game|IsWordUnlocked]](WordOfPower ''akWord'')'''
*Plays a bink video
:*Is the word of power unlocked on the player?


'''Function [[PrecacheCharGen - Game|PrecacheCharGen]]()'''
:'''[[PlayBink - Game|PlayBink]](String ''asFileName'', Bool ''abInterruptible'', Bool ''abMuteAudio'', Bool ''abMuteMusic'', Bool ''abLetterbox'')'''
*Precaches all the data used by character gen to avoid hitches with file I/O.
:*Plays a bink video


'''Function [[PrecacheCharGenClear - Game|PrecacheCharGenClear]]()'''
:'''[[PrecacheCharGen - Game|PrecacheCharGen]]()'''
*Clears all the previously cached data used by character gen.
:*Precaches all the data used by character gen to avoid hitches with file I/O.


'''int Function [[QueryStat - Game|QueryStat]](string asStat)'''
:'''[[PrecacheCharGenClear - Game|PrecacheCharGenClear]]()'''
*Queries the given stat and returns its value.
:*Clears all the previously cached data used by character gen.


'''Function [[QuitToMainMenu - Game|QuitToMainMenu]]()'''
:'''Int [[QueryStat - Game|QueryStat]](String ''asStat'')'''
*Forces the game back to the main menu.
:*Queries the given stat and returns its value.


'''bool Function [[RemoveHavokConstraints - Game|RemoveHavokConstraints]](ObjectReference arFirstRef, string arFirstRefNodeName, ObjectReference arSecondRef, string arSecondRefNodeName)'''
:'''[[QuitToMainMenu - Game|QuitToMainMenu]]()'''
*Removes any constraint between two rigid bodies
:*Forces the game back to the main menu.


'''Function [[RequestAutoSave - Game|RequestAutoSave]]()'''
:'''Bool [[RemoveHavokConstraints - Game|RemoveHavokConstraints]](ObjectReference ''arFirstRef'', String ''arFirstRefNodeName'', ObjectReference ''arSecondRef'', String ''arSecondRefNodeName'')'''
*Requests for an auto-save to be made.
:*Removes any constraint between two rigid bodies


'''Function [[RequestModel - Game|RequestModel]](string asModelName)'''
:'''[[RequestAutoSave - Game|RequestAutoSave]]()'''
*Requests the specified model.
:*Requests for an auto-save to be made.


'''Function [[RequestSave - Game|RequestSave]]()'''
:'''[[RequestModel - Game|RequestModel]](String ''asModelName'')'''
*Requests for a normal save to be made.
:*Requests the specified model.


'''Function [[SendWereWolfTransformation - Game|SendWereWolfTransformation]]()'''
:'''[[RequestSave - Game|RequestSave]]()'''
*Finds an actor in high who can detect the player to call werewolf crime on the player
:*Requests for a normal save to be made.


'''Function [[ServeTime - Game|ServeTime]]()'''
:'''[[SendWereWolfTransformation - Game|SendWereWolfTransformation]]()'''
*Has the player serve their jail time.
:*Finds an actor in high who can detect the player to call werewolf crime on the player


'''Function [[SetAllowFlyingMountLandingRequests - Game|SetAllowFlyingMountLandingRequests]](bool abAllow)'''
:'''[[ServeTime - Game|ServeTime]]()'''
*Allow or disallow the player requests to have a flying mount land.
:*Has the player serve their jail time.


'''Function [[SetBeastForm - Game|SetBeastForm]](bool abEntering)'''
:'''[[SetAllowFlyingMountLandingRequests - Game|SetAllowFlyingMountLandingRequests]](Bool ''abAllow'')'''
*Flags the player as being in/out of "beast form".
:*Allow or disallow the player requests to have a flying mount land.


'''Function [[SetCameraTarget - Game|SetCameraTarget]](Actor arTarget)'''
:'''[[SetBeastForm - Game|SetBeastForm]](Bool ''abEntering'')'''
*Sets the camera target actor
:*Flags the player as being in/out of "beast form".


'''Function [[SetHudCartMode - Game|SetHudCartMode]](bool abSetCartMode)'''
:'''[[SetCameraTarget - Game|SetCameraTarget]](Actor ''arTarget'')'''
*Flags the HUD as being in "cart mode" or not.
:*Sets the camera target actor


'''Function [[SetInChargen - Game|SetInChargen]](bool abDisableSaving, bool abDisableWaiting, bool abShowControlsDisabledMessage)'''
:'''[[SetHudCartMode - Game|SetHudCartMode]](Bool ''abSetCartMode'')'''
*Enable/disable various functionality which we want in chargen.
:*Flags the HUD as being in "cart mode" or not.


'''Function [[SetPlayerAIDriven - Game|SetPlayerAIDriven]](bool abAIDriven)'''
:'''[[SetInChargen - Game|SetInChargen]](Bool ''abDisableSaving'', Bool ''abDisableWaiting'', Bool ''abShowControlsDisabledMessage'')'''
*Enables or disables the AI driven flag on the player.
:*Enable/disable various functionality which we want in chargen.


'''Function [[SetPlayerReportCrime - Game|SetPlayerReportCrime]](bool abReportCrime)'''
:'''[[SetPlayerAIDriven - Game|SetPlayerAIDriven]](Bool ''abAIDriven'')'''
*Set the state of the player as an actor who commits crimes
:*Enables or disables the AI driven flag on the player.


'''Function [[SetSittingRotation - Game|SetSittingRotation]](float afValue)'''
:'''[[SetPlayerReportCrime - Game|SetPlayerReportCrime]](Bool ''abReportCrime'')'''
*Set the player's sitting camera offset rotation.
:*Set the state of the player as an actor who commits crimes


'''Function [[SetSunGazeImageSpaceModifier - Game|SetSunGazeImageSpaceModifier]](ImageSpaceModifier apImod)'''
:'''[[SetSittingRotation - Game|SetSittingRotation]](Float ''afValue'')'''
*Will cause the specified ImageSpace Modifier to be triggered when the player begins looking at the sun
:*Set the player's sitting camera offset rotation.


'''Function [[ShakeCamera - Game|ShakeCamera]](ObjectReference akSource, float afStrength)'''
:'''[[SetSunGazeImageSpaceModifier - Game|SetSunGazeImageSpaceModifier]](ImageSpaceModifier ''apImod'')'''
*Shakes the camera from the specified location with the specified strength.
:*Will cause the specified ImageSpace Modifier to be triggered when the player begins looking at the sun


'''Function [[ShakeController - Game|ShakeController]](float afLeftStrength, float afRightStrength, float afDuration)'''
:'''[[ShakeCamera - Game|ShakeCamera]](ObjectReference ''akSource'', Float ''afStrength'')'''
*Shakes the controller for the specified amount of time.
:*Shakes the camera from the specified location with the specified strength.


'''Function [[ShowFirstPersonGeometry - Game|ShowFirstPersonGeometry]](bool abShow)'''
:'''[[ShakeController - Game|ShakeController]](Float ''afLeftStrength'', Float ''afRightStrength'', Float ''afDuration'')'''
*Shows or hides the first-person geometry
:*Shakes the controller for the specified amount of time.


'''Function [[ShowLimitedRaceMenu - Game|ShowLimitedRaceMenu]]()'''
:'''[[ShowFirstPersonGeometry - Game|ShowFirstPersonGeometry]](Bool ''abShow'')'''
*Shows the race/sex change menu, but without the ability to change race or sex.
:*Shows or hides the first-person geometry


'''Function [[ShowRaceMenu - Game|ShowRaceMenu]]()'''
:'''[[ShowLimitedRaceMenu - Game|ShowLimitedRaceMenu]]()'''
*Shows the race/sex change menu.
:*Shows the race/sex change menu, but without the ability to change race or sex.


'''Function [[ShowTitleSequenceMenu - Game|ShowTitleSequenceMenu]]()'''
:'''[[ShowRaceMenu - Game|ShowRaceMenu]]()'''
*Shows the title sequence menu.
:*Shows the race/sex change menu.


'''Function [[ShowTrainingMenu - Game|ShowTrainingMenu]](Actor aActor)'''
:'''[[ShowTitleSequenceMenu - Game|ShowTitleSequenceMenu]]()'''
*Shows the training menu provided by actor parameter.
:*Shows the title sequence menu.


'''Function [[StartTitleSequence - Game|StartTitleSequence]](string asSequenceName)'''
:'''[[ShowTrainingMenu - Game|ShowTrainingMenu]](Actor ''aActor'')'''
*Plays the specified sequence in the title menu.
:*Shows the training menu provided by actor parameter.


'''Function [[TeachWord - Game|TeachWord]](WordOfPower akWord)'''
:'''[[StartTitleSequence - Game|StartTitleSequence]](String ''asSequenceName'')'''
*Teaches the specified [[WordOfPower Script|WordOfPower]] to the player
:*Plays the specified sequence in the title menu.


'''Function [[TriggerScreenBlood - Game|TriggerScreenBlood]](int aiValue)'''
:'''[[TeachWord - Game|TeachWord]](WordOfPower ''akWord'')'''
*Trigger on-screen blood splatter.
:*Teaches the specified [[WordOfPower Script|WordOfPower]] to the player


'''Function [[UnlockWord - Game|UnlockWord]](WordOfPower akWord)'''
:'''[[TriggerScreenBlood - Game|TriggerScreenBlood]](Int ''aiValue'')'''
*Unlocks the specified [[WordOfPower Script|WordOfPower]] so the player can use it
:*Trigger on-screen blood splatter.
 
:'''[[UnlockWord - Game|UnlockWord]](WordOfPower ''akWord'')'''
:*Unlocks the specified [[WordOfPower Script|WordOfPower]] so the player can use it
 
:'''Bool [[UsingGamepad - Game|UsingGamepad]]()'''
:*Returns whether the player is using a gamepad or not.


'''bool Function [[UsingGamepad - Game|UsingGamepad]]()'''
*Returns whether the player is using a gamepad or not.


== SKSE Global Functions ==
== SKSE Global Functions ==
'''int Function [[GetPerkPoints - Game|GetPerkPoints]]()'''
*Returns the number of perk points available to the player.


'''Function [[SetPerkPoints - Game|SetPerkPoints]](int perkPoints)'''
:'''Int [[GetPerkPoints - Game|GetPerkPoints]]()'''
*Sets the number of perk points available to the player.
:*Returns the number of perk points available to the player.


'''Function [[ModPerkPoints - Game|ModPerkPoints]](int perkPoints)'''
:'''[[SetPerkPoints - Game|SetPerkPoints]](Int ''perkPoints'')'''
*Changes the number of perk points available to the player by the specified amount.
:*Sets the number of perk points available to the player.


'''Function [[SetGameSettingBool - Game|SetGameSettingBool]](String setting, bool value)'''
:'''[[ModPerkPoints - Game|ModPerkPoints]](Int ''perkPoints'')'''
*Changes the value of boolean Game Settings.
:*Changes the number of perk points available to the player by the specified amount.


'''Function [[SetGameSettingInt - Game|SetGameSettingInt]](String setting, int value)'''
:'''Int [[GetModCount - Game|GetModCount]]()'''
*Changes the value of integer Game Settings.
:*Returns the number of mods currently active.


'''Function [[SetGameSettingFloat - Game|SetGameSettingFloat]](String setting, float value)'''
:'''Int [[GetModByName - Game|GetModByName]](String ''name'')'''
*Changes the value of float Game Settings.
:*Returns the index of the specified mod.


'''Function [[SetGameSettingString - Game|SetGameSettingString]](String setting, string value)'''
:'''String [[GetModName - Game|GetModName]](Int ''modIndex'')'''
*Changes the value of string Game Settings.
:*Returns the mods name at the specified index.


'''int Function [[GetModCount - Game|GetModCount]]()'''
:'''String [[GetModAuthor - Game|GetModAuthor]](Int ''modIndex'')'''
*Returns the number of mods currently active.
:*Returns the specified mod's author.


'''string Function [[GetModName - Game|GetModName]](int modIndex)'''
:'''String [[GetModDescription - Game|GetModDescription]](Int ''modIndex'')'''
*Returns the mods name at the specified index.
:*Returns the specified mod's description.


'''string Function [[GetModAuthor - Game|GetModAuthor]](int modIndex)'''
:'''Int [[GetModDependencyCount - Game|GetModDependencyCount]](Int ''modIndex'')'''
*Returns the specified mod's author.
:*Returns the dependency count of the specified mod.


'''string Function [[GetModDescription - Game|GetModDescription]](int modIndex)'''
:'''Int [[GetNthModDependency - Game|GetNthModDependency]](Int ''modIndex'', Int ''n'')'''
*Returns the specified mod's description.
:*Returns the mod index of the specified Dependency.


'''int Function [[GetModDependencyCount - Game|GetModDependencyCount]](int modIndex)'''
:'''Bool [[IsPluginInstalled - Game|IsPluginInstalled]](String ''name'')'''
*Returns the dependency count of the specified mod.
:*Returns if the named mod is found in the load order.


'''int Function [[GetNthModDependency - Game|GetNthModDependency]](int modIndex, int n)'''
:'''Int [[GetLightModCount - Game|GetLightModCount]]()'''
*Returns the mod index of the specified Dependency.
:*Returns the number of light mods currently active.


'''int Function [[GetCameraState - Game|GetCameraState]]()'''
:'''Int [[GetLightModByName - Game|GetLightModByName]](String ''name'')'''
*Returns the character's current camera state.(0 - first person;1 - auto vanity;2 - VATS;3 - free;4 - iron sights;5 - furniture;6 - transition;7 - tweenmenu;8 - third person 1;9 - third person 2;10 - horse;11 - bleedout;12 - dragon)
:*Returns the index of the specified light mod.


'''Function [[SaveGame - Game|SaveGame]](string name)'''
:'''String [[GetLightModName - Game|GetLightModName]](Int ''modIndex'')'''
*Saves the game with the specified name.
:*Returns the light mod's name at the specified index.


'''Function [[LoadGame - Game|LoadGame]](string name)'''
:'''String [[GetLightModAuthor - Game|GetLightModAuthor]](Int ''modIndex'')'''
*Loads the save with the specified name.
:*Returns the specified light mod's author.


'''int Function [[GetNumTintMasks - Game|GetNumTintMasks]]()'''
:'''String [[GetLightModDescription - Game|GetLightModDescription]](Int ''modIndex'')'''
*Returns the total number of tints for the player.
:*Returns the specified light mod's description.


'''int Function [[GetNthTintMaskColor - Game|GetNthTintMaskColor]](int n)'''
:'''Int [[GetLightModDependencyCount - Game|GetLightModDependencyCount]](Int ''modIndex'')'''
*Returns the color of the Nth tint mask.
:*Returns the dependency count of the specified light mod.


'''int Function [[GetNthTintMaskType - Game|GetNthTintMaskType]](int n)'''
:'''Int [[GetNthLightModDependency - Game|GetNthLightModDependency]](Int ''modIndex'', Int ''n'')'''
*Returns the type of the Nth tint mask.
:*Returns the mod index of the specified Dependency.


'''int Function [[SetNthTintMaskColor - Game|GetNthTintMaskColor]](int n, int color)'''
:'''[[SetGameSettingFloat - Game|SetGameSettingFloat]](String ''setting'', Float ''value'')'''
*Sets the color of the Nth tint mask.
:*Changes the value of float Game Settings.


'''string Function [[GetNthTintMaskTexturePath - Game|GetNthTintMaskTexturePath]](int n)'''
:'''[[SetGameSettingInt - Game|SetGameSettingInt]](String ''setting'', Int ''value'')'''
*Returns the texture path of the Nth tint mask.
:*Changes the value of integer Game Settings.


'''Function [[SetNthTintMaskTexturePath - Game|SetNthTintMaskTexturePath]](int n)'''
:'''[[SetGameSettingBool - Game|SetGameSettingBool]](String ''setting'', Bool ''value'')'''
*Sets the texturepath of the Nth tint mask.
:*Changes the value of boolean Game Settings.


'''int Function [[GetNumTintsByType - Game|GetNumTintsByType]](int type)'''
:'''[[SetGameSettingString - Game|SetGameSettingString]](String ''setting'', String ''value'')'''
*Returns how many indexes there are for this type.
:*Changes the value of string Game Settings.


'''int Function [[GetTintMaskColor - Game|GetTintMaskColor]](int type, int index)'''
:'''[[SaveGame - Game|SaveGame]](String ''name'')'''
*Returns the color for the particular tintMask type and index.
:*Saves the game with the specified name.


'''Function [[SetTintMaskColor - Game|SetTintMaskColor]](int color, int type, int index)'''
:'''[[LoadGame - Game|LoadGame]](String ''name'')'''
*Sets the tintMask color for the particular type and index
:*Loads the save with the specified name.


== Member Functions ==
:'''Int [[GetNumTintMasks - Game|GetNumTintMasks]]()'''
None
:*Returns the total number of tints for the player.


== Events ==
:'''Int [[GetNthTintMaskColor - Game|GetNthTintMaskColor]](Int ''n'')'''
None
:*Returns the color of the Nth tint mask.
 
:'''Int [[GetNthTintMaskType - Game|GetNthTintMaskType]](Int ''n'')'''
:*Returns the type of the Nth tint mask.
 
:'''Int [[SetNthTintMaskColor - Game|SetNthTintMaskColor]](Int ''n'', Int ''color'')'''
:*Sets the color of the Nth tint mask.
 
:'''String [[GetNthTintMaskTexturePath - Game|GetNthTintMaskTexturePath]](Int ''n'')'''
:*Returns the texture path of the Nth tint mask.
 
:'''[[SetNthTintMaskTexturePath - Game|SetNthTintMaskTexturePath]](String ''path'', Int ''n'')'''
:*Sets the texturepath of the Nth tint mask.
 
:'''Int [[GetNumTintsByType - Game|GetNumTintsByType]](Int ''type'')'''
:*Returns how many indexes there are for this type.
 
:'''Int [[GetTintMaskColor - Game|GetTintMaskColor]](Int ''type'', Int ''index'')'''
:*Returns the color for the particular tintMask type and index.
 
:'''[[SetTintMaskColor - Game|SetTintMaskColor]](Int ''color'', Int ''type'', Int ''index'')'''
:*Sets the tintMask color for the particular type and index.
 
:'''String [[GetTintMaskTexturePath - Game|GetTintMaskTexturePath]](Int ''type'', Int ''index'')'''
:*Returns the tintMask texture for the particular type and index.
 
:'''[[SetTintMaskTexturePath - Game|SetTintMaskTexturePath]](String ''path'', Int ''type'', Int ''index'')'''
:*Sets the tintMask texture for the particular type and index.
 
:'''[[UpdateTintMaskColors - Game|UpdateTintMaskColors]]()'''
:*Updates Tint Mask colors without updating the entire model.
 
:'''[[UpdateHairColor - Game|UpdateHairColor]]()'''
:*Instantly updates the player's hair color.
 
:'''Int [[GetCameraState - Game|GetCameraState]]()'''
:*Returns the character's current camera state.
 
:'''[[SetMiscStat - Game|SetMiscStat]](String ''name'', Int ''value'')'''
:*Sets the Misc Stat to the specified value.
 
:'''[[SetPlayersLastRiddenHorse - Game|SetPlayersLastRiddenHorse]](Actor ''horse'')'''
:*Sets the players last ridden horse, None will clear the last ridden horse.
 
:'''Int [[GetSkillLegendaryLevel - Game|GetSkillLegendaryLevel]](String ''actorValue'')'''
:*Returns the legendary level for the skill. -1 indicates that the skill cannot have a legendary level. ''This is marked as deprecated in SKSE's Game.psc.''
 
:'''[[SetSkillLegendaryLevel - Game|SetSkillLegendaryLevel]](String ''actorValue'', Int ''level'')'''
:*Sets the legendary level for the skill. ''This is marked as deprecated in SKSE's Game.psc.''
 
:'''Float [[GetPlayerExperience - Game|GetPlayerExperience]]()'''
:*Returns the players experience for this level (not total experience).
 
:'''[[SetPlayerExperience - Game|SetPlayerExperience]](Float ''exp'')'''
:*Sets the player's experience to the specified amount (This will not trigger a level up notification)
 
:'''Float [[GetExperienceForLevel - Game|GetExperienceForLevel]](Int ''currentLevel'')'''
:*Calculates the experience required for the player to level-up at the specified level
 
:'''Bool [[GetPlayerMovementMode - Game|GetPlayerMovementMode]]()'''
:*Returns true if in run mode, false if in walk mode. (This is only an indication of the control mode not if the player is actually running or walking.)
 
:'''[[UpdateThirdPerson - Game|UpdateThirdPerson]]()'''
:*Updates the camera when changing shoulder positions.
 
:'''[[UnbindObjectHotkey - Game|UnbindObjectHotkey]](Int ''hotkey'')'''
:*Unbinds a favorited item bound to the specified hotkey. (0-7 reflects keys 1-8)
 
:'''Form [[GetHotkeyBoundObject - Game|GetHotkeyBoundObject]](Int ''hotkey'')'''
:*Returns the base form object that is bound to the specified hotkey.
 
:'''Bool [[IsObjectFavorited - Game|IsObjectFavorited]](Form ''form'')'''
:*Returns whether the specified base form is favorited by the player.
 
:'''Form [[GetFormEx - Game|GetFormEx]](Int ''formId'')'''
:*Performs the same function as [[GetForm - Game|GetForm]] but also works for form IDs greater than 0x80000000.
 
:'''[[SetPlayerLevel]](Int ''Level'')'''
:*Sets the player's level.
 
:'''ObjectReference [[GetCurrentCrosshairRef]]()'''
:*Returns the current crosshair ref.
 
:'''ObjectReference [[GetCurrentConsoleRef]]()'''
:*Returns the currently selected ref in the console.
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]

Latest revision as of 06:36, 7 June 2020

Extends: None

Collection of game-specific global functions


DefinitionEdit

ScriptName Game Hidden


Global FunctionsEdit

AddAchievement(Int aiAchievementID)
  • Adds the specified achievement/trophy to the player's gamer profile.
AddPerkPoints(Int aiPerkPoints)
  • Adds the given number of perk points to the player. Clamped at 255.
AdvanceSkill(String asSkillName, Float afMagnitude)
  • Advance the given skill on the player by the provided amount of skill usage
Bool AddHavokBallAndSocketConstraint(ObjectReference arRefA, String arRefANode, ObjectReference arRefB, String arRefBNode, Float afRefALocalOffsetX, Float afRefALocalOffsetY, Float afRefALocalOffsetZ, Float afRefBLocalOffsetX, Float afRefBLocalOffsetY, Float afRefBLocalOffsetZ)
  • Adds a ball-and-socket constraint between two rigid bodies, identified by their ref and node names
Int CalculateFavorCost(Int aiFavorPrice)
  • Calculates how many points the player would have to pay for a favor of the specified price.
ClearPrison()
  • Clears all Prison variables on the PlayerCharacter so the game will know he is out of prison.
ClearTempEffects()
  • Clears all temp effects (such as terrain effects) in the game.
DisablePlayerControls(Bool abMovement, Bool abFighting, Bool abCamSwitch, Bool abLooking, Bool abSneaking, Bool abMenu, Bool abActivate, Bool abJournalTabs, Int aiDisablePOVType)
  • Disables the specified player controls.
EnableFastTravel(Bool abEnable)
  • Enables or disables the player's ability to fast travel.
EnablePlayerControls(Bool abMovement, Bool abFighting, Bool abCamSwitch, Bool abLooking, Bool abSneaking, Bool abMenu, Bool abActivate, Bool abJournalTabs, Int aiDisablePOVType)
  • Enables the specified player controls.
FadeOutGame(Bool abFadingOut, Bool abBlackFade, Float afSecsBeforeFade, Float afFadeDuration)
  • Fades the game in and out with the specified parameters.
FastTravel(ObjectReference akDestination)
  • Fast-travels the player to the specified object's location.
Actor FindClosestActor(Float afX, Float afY, Float afZ, Float afRadius)
  • Finds the closest actor within a given radius of a location
Actor FindClosestActorFromRef(ObjectReference arCenter, Float afRadius)
  • Finds the closest actor within a given radius of a reference
ObjectReference FindClosestReferenceOfAnyTypeInList(FormList arBaseObjects, Float afX, Float afY, Float afZ, Float afRadius)
  • Finds the closest reference of any of the base objects in the list within a given radius of a location
ObjectReference FindClosestReferenceOfAnyTypeInListFromRef(FormList arBaseObjects, ObjectReference arCenter, Float afRadius)
  • Finds the closest reference of any of the base objects in the list within a given radius of a reference
ObjectReference FindClosestReferenceOfType(Form arBaseObject, Float afX, Float afY, Float afZ, Float afRadius)
  • Finds the closest reference of a given base object within a given radius of a location
ObjectReference FindClosestReferenceOfTypeFromRef(Form arBaseObject, ObjectReference arCenter, Float afRadius)
  • Finds the closest reference of a given base object within a given radius of a reference
Actor FindRandomActor(Float afX, Float afY, Float afZ, Float afRadius)
  • Finds a random actor within a given radius of a location
Actor FindRandomActorFromRef(ObjectReference arCenter, Float afRadius)
  • Finds a random actor within a given radius of a reference
ObjectReference FindRandomReferenceOfAnyTypeInList(FormList arBaseObjects, Float afX, Float afY, Float afZ, Float afRadius)
  • Finds a random reference of any of the base objects in the list within a given radius of a location
ObjectReference FindRandomReferenceOfAnyTypeInListFromRef(FormList arBaseObjects, ObjectReference arCenter, Float afRadius)
  • Finds a random reference of any of the base objects in the list within a given radius of a reference
ObjectReference FindRandomReferenceOfType(Form arBaseObject, Float afX, Float afY, Float afZ, Float afRadius)
  • Finds a random reference of a given base object within a given radius of a location
ObjectReference FindRandomReferenceOfTypeFromRef(Form arBaseObject, ObjectReference arCenter, Float afRadius)
  • Finds a random reference of a given base object within a given radius of a reference
ForceFirstPerson()
  • Forces the player camera into 1st-person.
ForceThirdPerson()
  • Forces the player camera into 3rd-person.
Form GetForm(Int aiFormID)
  • Obtains a Form from the game by its form ID number.
Form GetFormFromFile(Int aiFormID, String asFilename)
  • Obtains the form specified by its form ID number which originated in the specified file.
Float GetGameSettingFloat(String asGameSetting)
  • Obtains the value of a float game setting.
Float GetGameSettingInt(String asGameSetting)
  • Obtains the value of an int game setting.
Float GetGameSettingString(String asGameSetting)
  • Obtains the value of a string game setting.
Actor GetPlayer()
  • Obtains the Actor that represents the player.
ObjectReference GetPlayerGrabbedRef()
Actor GetPlayersLastRiddenHorse()
  • Gets this actors last ridden horse if it is the player. Returns None if player has not ridden a horse is not the player.
Float GetRealHoursPassed()
  • Returns the number of real-life hours that have passed playing the game.
Float GetSunPositionX()
  • Gets the X position of the sun.
Float GetSunPositionY()
  • Gets the Y position of the sun.
Float GetSunPositionZ()
  • Gets the Z position of the sun.
HideTitleSequenceMenu()
  • Hides the title sequence menu.
IncrementSkill(String asSkillName)
  • Advances the provided Skill by the one point (for the player only).
IncrementSkillBy(String asSkillName, Int aiCount)
  • Advances the provided Skill by the given number of points (for the player only).
IncrementStat(String asStatName, Int aiModAmount)
  • Modifies the specified MiscStat by the given amount
Bool IsActivateControlsEnabled()
  • Are the activation controls enabled?
Bool IsCamSwitchControlsEnabled()
  • Are the camera switch controls enabled?
Bool IsFastTravelEnabled()
  • Is fast travel enabled?
Bool IsFastTravelControlsEnabled()
  • Are fast travel controls enabled?
Bool IsFightingControlsEnabled()
  • Are the fighting controls enabled?
Bool IsJournalControlsEnabled()
  • Are the journal menu controls enabled?
Bool IsLookingControlsEnabled()
  • Are the looking controls enabled?
Bool IsMenuControlsEnabled()
  • Are the menu controls enabled?
Bool IsMovementControlsEnabled()
  • Are the movement controls enabled?
Bool IsPlayerSungazing()
  • Checks to the see if the player is looking directly at the sun.
Bool IsSneakingControlsEnabled()
  • Are the sneaking controls enabled?
Bool IsWordUnlocked(WordOfPower akWord)
  • Is the word of power unlocked on the player?
PlayBink(String asFileName, Bool abInterruptible, Bool abMuteAudio, Bool abMuteMusic, Bool abLetterbox)
  • Plays a bink video
PrecacheCharGen()
  • Precaches all the data used by character gen to avoid hitches with file I/O.
PrecacheCharGenClear()
  • Clears all the previously cached data used by character gen.
Int QueryStat(String asStat)
  • Queries the given stat and returns its value.
QuitToMainMenu()
  • Forces the game back to the main menu.
Bool RemoveHavokConstraints(ObjectReference arFirstRef, String arFirstRefNodeName, ObjectReference arSecondRef, String arSecondRefNodeName)
  • Removes any constraint between two rigid bodies
RequestAutoSave()
  • Requests for an auto-save to be made.
RequestModel(String asModelName)
  • Requests the specified model.
RequestSave()
  • Requests for a normal save to be made.
SendWereWolfTransformation()
  • Finds an actor in high who can detect the player to call werewolf crime on the player
ServeTime()
  • Has the player serve their jail time.
SetAllowFlyingMountLandingRequests(Bool abAllow)
  • Allow or disallow the player requests to have a flying mount land.
SetBeastForm(Bool abEntering)
  • Flags the player as being in/out of "beast form".
SetCameraTarget(Actor arTarget)
  • Sets the camera target actor
SetHudCartMode(Bool abSetCartMode)
  • Flags the HUD as being in "cart mode" or not.
SetInChargen(Bool abDisableSaving, Bool abDisableWaiting, Bool abShowControlsDisabledMessage)
  • Enable/disable various functionality which we want in chargen.
SetPlayerAIDriven(Bool abAIDriven)
  • Enables or disables the AI driven flag on the player.
SetPlayerReportCrime(Bool abReportCrime)
  • Set the state of the player as an actor who commits crimes
SetSittingRotation(Float afValue)
  • Set the player's sitting camera offset rotation.
SetSunGazeImageSpaceModifier(ImageSpaceModifier apImod)
  • Will cause the specified ImageSpace Modifier to be triggered when the player begins looking at the sun
ShakeCamera(ObjectReference akSource, Float afStrength)
  • Shakes the camera from the specified location with the specified strength.
ShakeController(Float afLeftStrength, Float afRightStrength, Float afDuration)
  • Shakes the controller for the specified amount of time.
ShowFirstPersonGeometry(Bool abShow)
  • Shows or hides the first-person geometry
ShowLimitedRaceMenu()
  • Shows the race/sex change menu, but without the ability to change race or sex.
ShowRaceMenu()
  • Shows the race/sex change menu.
ShowTitleSequenceMenu()
  • Shows the title sequence menu.
ShowTrainingMenu(Actor aActor)
  • Shows the training menu provided by actor parameter.
StartTitleSequence(String asSequenceName)
  • Plays the specified sequence in the title menu.
TeachWord(WordOfPower akWord)
TriggerScreenBlood(Int aiValue)
  • Trigger on-screen blood splatter.
UnlockWord(WordOfPower akWord)
  • Unlocks the specified WordOfPower so the player can use it
Bool UsingGamepad()
  • Returns whether the player is using a gamepad or not.


SKSE Global FunctionsEdit

Int GetPerkPoints()
  • Returns the number of perk points available to the player.
SetPerkPoints(Int perkPoints)
  • Sets the number of perk points available to the player.
ModPerkPoints(Int perkPoints)
  • Changes the number of perk points available to the player by the specified amount.
Int GetModCount()
  • Returns the number of mods currently active.
Int GetModByName(String name)
  • Returns the index of the specified mod.
String GetModName(Int modIndex)
  • Returns the mods name at the specified index.
String GetModAuthor(Int modIndex)
  • Returns the specified mod's author.
String GetModDescription(Int modIndex)
  • Returns the specified mod's description.
Int GetModDependencyCount(Int modIndex)
  • Returns the dependency count of the specified mod.
Int GetNthModDependency(Int modIndex, Int n)
  • Returns the mod index of the specified Dependency.
Bool IsPluginInstalled(String name)
  • Returns if the named mod is found in the load order.
Int GetLightModCount()
  • Returns the number of light mods currently active.
Int GetLightModByName(String name)
  • Returns the index of the specified light mod.
String GetLightModName(Int modIndex)
  • Returns the light mod's name at the specified index.
String GetLightModAuthor(Int modIndex)
  • Returns the specified light mod's author.
String GetLightModDescription(Int modIndex)
  • Returns the specified light mod's description.
Int GetLightModDependencyCount(Int modIndex)
  • Returns the dependency count of the specified light mod.
Int GetNthLightModDependency(Int modIndex, Int n)
  • Returns the mod index of the specified Dependency.
SetGameSettingFloat(String setting, Float value)
  • Changes the value of float Game Settings.
SetGameSettingInt(String setting, Int value)
  • Changes the value of integer Game Settings.
SetGameSettingBool(String setting, Bool value)
  • Changes the value of boolean Game Settings.
SetGameSettingString(String setting, String value)
  • Changes the value of string Game Settings.
SaveGame(String name)
  • Saves the game with the specified name.
LoadGame(String name)
  • Loads the save with the specified name.
Int GetNumTintMasks()
  • Returns the total number of tints for the player.
Int GetNthTintMaskColor(Int n)
  • Returns the color of the Nth tint mask.
Int GetNthTintMaskType(Int n)
  • Returns the type of the Nth tint mask.
Int SetNthTintMaskColor(Int n, Int color)
  • Sets the color of the Nth tint mask.
String GetNthTintMaskTexturePath(Int n)
  • Returns the texture path of the Nth tint mask.
SetNthTintMaskTexturePath(String path, Int n)
  • Sets the texturepath of the Nth tint mask.
Int GetNumTintsByType(Int type)
  • Returns how many indexes there are for this type.
Int GetTintMaskColor(Int type, Int index)
  • Returns the color for the particular tintMask type and index.
SetTintMaskColor(Int color, Int type, Int index)
  • Sets the tintMask color for the particular type and index.
String GetTintMaskTexturePath(Int type, Int index)
  • Returns the tintMask texture for the particular type and index.
SetTintMaskTexturePath(String path, Int type, Int index)
  • Sets the tintMask texture for the particular type and index.
UpdateTintMaskColors()
  • Updates Tint Mask colors without updating the entire model.
UpdateHairColor()
  • Instantly updates the player's hair color.
Int GetCameraState()
  • Returns the character's current camera state.
SetMiscStat(String name, Int value)
  • Sets the Misc Stat to the specified value.
SetPlayersLastRiddenHorse(Actor horse)
  • Sets the players last ridden horse, None will clear the last ridden horse.
Int GetSkillLegendaryLevel(String actorValue)
  • Returns the legendary level for the skill. -1 indicates that the skill cannot have a legendary level. This is marked as deprecated in SKSE's Game.psc.
SetSkillLegendaryLevel(String actorValue, Int level)
  • Sets the legendary level for the skill. This is marked as deprecated in SKSE's Game.psc.
Float GetPlayerExperience()
  • Returns the players experience for this level (not total experience).
SetPlayerExperience(Float exp)
  • Sets the player's experience to the specified amount (This will not trigger a level up notification)
Float GetExperienceForLevel(Int currentLevel)
  • Calculates the experience required for the player to level-up at the specified level
Bool GetPlayerMovementMode()
  • Returns true if in run mode, false if in walk mode. (This is only an indication of the control mode not if the player is actually running or walking.)
UpdateThirdPerson()
  • Updates the camera when changing shoulder positions.
UnbindObjectHotkey(Int hotkey)
  • Unbinds a favorited item bound to the specified hotkey. (0-7 reflects keys 1-8)
Form GetHotkeyBoundObject(Int hotkey)
  • Returns the base form object that is bound to the specified hotkey.
Bool IsObjectFavorited(Form form)
  • Returns whether the specified base form is favorited by the player.
Form GetFormEx(Int formId)
  • Performs the same function as GetForm but also works for form IDs greater than 0x80000000.
SetPlayerLevel(Int Level)
  • Sets the player's level.
ObjectReference GetCurrentCrosshairRef()
  • Returns the current crosshair ref.
ObjectReference GetCurrentConsoleRef()
  • Returns the currently selected ref in the console.