Difference between revisions of "Game Script"
m
no edit summary
imported>CraftySentinel m (→SKSE Global Functions: Minor Formatting change) |
imported>CraftySentinel m |
||
Line 1: | Line 1: | ||
[[Category:Scripting]] | |||
[[Category:Papyrus]] | |||
[[Category:Script Objects]] | |||
[[Category:SKSE]] | |||
[[Category:SKSE Script Objects]] | |||
Collection of game-specific global functions | Collection of game-specific global functions | ||
Line 11: | Line 9: | ||
== Definition == | == Definition == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
ScriptName Game | ScriptName Game | ||
</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)''' | |||
*Adds the given number of perk points to the player. Clamped at 255. | |||
'''Function [[AdvanceSkill - Game|AdvanceSkill]](string asSkillName, float afMagnitude)''' | |||
*Advance the given skill on the player by the provided amount of skill usage | |||
'''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)''' | |||
*Adds a ball-and-socket constraint between two rigid bodies, identified by their ref and node names | |||
'''int Function [[CalculateFavorCost - Game|CalculateFavorCost]](int aiFavorPrice)''' | |||
*Calculates how many points the player would have to pay for a favor of the specified price. | |||
'''Function [[ClearPrison - Game|ClearPrison]]()''' | |||
*Clears all Prison variables on the PlayerCharacter so the game will know he is out of prison. | |||
'''Function [[ClearTempEffects - Game|ClearTempEffects]]()''' | |||
*Clears all temp effects (such as terrain effects) in the game. | |||
'''Function [[DisablePlayerControls - 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. | |||
'''Function [[EnableFastTravel - Game|EnableFastTravel]](bool abEnable)''' | |||
*Enables or disables the player's ability to fast travel. | |||
'''Function [[EnablePlayerControls - Game|EnablePlayerControls]](bool abMovement, bool abFighting, bool abCamSwitch, bool abLooking, bool abSneaking, bool abMenu, bool abActivate, bool abJournalTabs, int aiDisablePOVType)''' | |||
*Enables the specified player controls. | |||
'''Function [[FadeOutGame - Game|FadeOutGame]](bool abFadingOut, bool abBlackFade, float afSecsBeforeFade, float afFadeDuration)''' | |||
*Fades the game in and out with the specified parameters. | |||
'''Function [[FastTravel - Game|FastTravel]](ObjectReference akDestination)''' | |||
*Fast-travels the player to the specified object's location. | |||
'''Actor Function [[FindClosestActor - Game|FindClosestActor]](float afX, float afY, float afZ, float afRadius)''' | |||
*Finds the closest actor within a given radius of a location | |||
'''Actor Function [[FindClosestActorFromRef - Game|FindClosestActorFromRef]](ObjectReference arCenter, float afRadius)''' | |||
*Finds the closest actor within a given radius of a reference | |||
'''ObjectReference Function [[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 location | |||
'''ObjectReference Function [[FindClosestReferenceOfAnyTypeInListFromRef - Game|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 Function [[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 location | |||
'''ObjectReference Function [[FindClosestReferenceOfTypeFromRef - Game|FindClosestReferenceOfTypeFromRef]](Form arBaseObject, ObjectReference arCenter, float afRadius)''' | |||
*Finds the closest reference of a given base object within a given radius of a reference | |||
'''Actor Function [[FindRandomActor - Game|FindRandomActor]](float afX, float afY, float afZ, float afRadius)''' | |||
*Finds a random actor within a given radius of a location | |||
'''Actor Function [[FindRandomActorFromRef - Game|FindRandomActorFromRef]](ObjectReference arCenter, float afRadius)''' | |||
*Finds a random actor within a given radius of a reference | |||
'''ObjectReference Function [[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 location | |||
'''ObjectReference Function [[FindRandomReferenceOfAnyTypeInListFromRef - Game|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 Function [[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 location | |||
'''ObjectReference Function [[FindRandomReferenceOfTypeFromRef - Game|FindRandomReferenceOfTypeFromRef]](Form arBaseObject, ObjectReference arCenter, float afRadius)''' | |||
*Finds a random reference of a given base object within a given radius of a reference | |||
'''Function [[ForceFirstPerson - Game|ForceFirstPerson]]()''' | |||
*Forces the player camera into 1st-person. | |||
'''Function [[ForceThirdPerson - Game|ForceThirdPerson]]()''' | |||
*Forces the player camera into 3rd-person. | |||
'''Form Function [[GetForm - Game|GetForm]](int aiFormID)''' | |||
*Obtains a [[Form Script|Form]] from the game by its form ID number. | |||
'''Form Function [[GetFormFromFile - Game|GetFormFromFile]](int aiFormID, string asFilename)''' | |||
*Obtains the form specified by its form ID number which originated in the specified file. | |||
'''float Function [[GetGameSettingFloat - Game|GetGameSettingFloat]](string asGameSetting)''' | |||
*Obtains the value of a float game setting. | |||
'''float Function [[GetGameSettingInt - Game|GetGameSettingInt]](string asGameSetting)''' | |||
*Obtains the value of an int game setting. | |||
'''float Function [[GetGameSettingString - Game|GetGameSettingString]](string asGameSetting)''' | |||
*Obtains the value of a string game setting. | |||
'''Actor Function [[GetPlayer - Game|GetPlayer]]()''' | |||
*Obtains the [[Actor Script|Actor]] that represents the player. | |||
'''ObjectReference Function [[GetPlayerGrabbedRef - Game|GetPlayerGrabbedRef]]()''' | |||
*Obtains the [[ObjectReference Script|ObjectReference]] the player is currently grabbing. | |||
'''Actor Function [[GetPlayersLastRiddenHorse - Game|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 Function [[GetRealHoursPassed - Game|GetRealHoursPassed]]()''' | |||
*Returns the number of real-life hours that have passed playing the game. | |||
'''float Function [[GetSunPositionX - Game|GetSunPositionX]]()''' | |||
*Gets the X position of the sun. | |||
'''float Function [[GetSunPositionY - Game|GetSunPositionY]]()''' | |||
*Gets the Y position of the sun. | |||
'''float Function [[GetSunPositionZ - Game|GetSunPositionZ]]()''' | |||
*Gets the Z position of the sun. | |||
'''Function [[HideTitleSequenceMenu - Game|HideTitleSequenceMenu]]()''' | |||
*Hides the title sequence menu. | |||
'''Function [[IncrementSkill - Game|IncrementSkill]](string asSkillName)''' | |||
*Advances the provided Skill by the one point (for the player only). | |||
'''Function [[IncrementSkillBy - Game|IncrementSkillBy]](string asSkillName, int aiCount)''' | |||
*Advances the provided Skill by the given number of points (for the player only). | |||
'''Function [[IncrementStat - Game|IncrementStat]](string asStatName, int aiModAmount) native global''' | |||
*Modifies the specified MiscStat by the given amount | |||
'''bool Function [[IsActivateControlsEnabled - Game|IsActivateControlsEnabled]]()''' | |||
*Are the activation controls enabled? | |||
'''bool Function [[IsCamSwitchControlsEnabled - Game|IsCamSwitchControlsEnabled]]()''' | |||
*Are the camera switch controls enabled? | |||
'''bool Function [[IsFastTravelEnabled - Game|IsFastTravelEnabled]]()''' | |||
*Is fast travel enabled? | |||
'''bool Function [[IsFastTravelControlsEnabled - Game|IsFastTravelControlsEnabled]]()''' | |||
*Are fast travel controls enabled? | |||
'''bool Function [[IsFightingControlsEnabled - Game|IsFightingControlsEnabled]]()''' | |||
*Are the fighting controls enabled? | |||
'''bool Function [[IsJournalControlsEnabled - Game|IsJournalControlsEnabled]]()''' | |||
*Are the journal menu controls enabled? | |||
'''bool Function [[IsLookingControlsEnabled - Game|IsLookingControlsEnabled]]()''' | |||
*Are the looking controls enabled? | |||
'''bool Function [[IsMenuControlsEnabled - Game|IsMenuControlsEnabled]]()''' | |||
*Are the menu controls enabled? | |||
'''bool Function [[IsMovementControlsEnabled - Game|IsMovementControlsEnabled]]()''' | |||
*Are the movement controls enabled? | |||
'''bool Function [[IsPlayerSungazing - Game|IsPlayerSungazing]]()''' | |||
*Checks to the see if the player is looking directly at the sun. | |||
'''bool Function [[IsSneakingControlsEnabled - Game|IsSneakingControlsEnabled]]()''' | |||
*Are the sneaking controls enabled? | |||
'''bool Function [[IsWordUnlocked - Game|IsWordUnlocked]](WordOfPower akWord)''' | |||
*Is the word of power unlocked on the player? | |||
'''Function [[PlayBink - Game|PlayBink]](string asFileName, bool abInterruptible, bool abMuteAudio, bool abMuteMusic, bool abLetterbox)''' | |||
*Plays a bink video | |||
'''Function [[PrecacheCharGen - Game|PrecacheCharGen]]()''' | |||
*Precaches all the data used by character gen to avoid hitches with file I/O. | |||
'''Function [[PrecacheCharGenClear - Game|PrecacheCharGenClear]]()''' | |||
*Clears all the previously cached data used by character gen. | |||
'''int Function [[QueryStat - Game|QueryStat]](string asStat)''' | |||
*Queries the given stat and returns its value. | |||
'''Function [[QuitToMainMenu - Game|QuitToMainMenu]]()''' | |||
*Forces the game back to the main menu. | |||
'''bool Function [[RemoveHavokConstraints - Game|RemoveHavokConstraints]](ObjectReference arFirstRef, string arFirstRefNodeName, ObjectReference arSecondRef, string arSecondRefNodeName)''' | |||
*Removes any constraint between two rigid bodies | |||
'''Function [[RequestAutoSave - Game|RequestAutoSave]]()''' | |||
*Requests for an auto-save to be made. | |||
'''Function [[RequestModel - Game|RequestModel]](string asModelName)''' | |||
*Requests the specified model. | |||
'''Function [[RequestSave - Game|RequestSave]]()''' | |||
*Requests for a normal save to be made. | |||
'''Function [[SendWereWolfTransformation - Game|SendWereWolfTransformation]]()''' | |||
*Finds an actor in high who can detect the player to call werewolf crime on the player | |||
'''Function [[ServeTime - Game|ServeTime]]()''' | |||
*Has the player serve their jail time. | |||
'''Function [[SetAllowFlyingMountLandingRequests - Game|SetAllowFlyingMountLandingRequests]](bool abAllow)''' | |||
*Allow or disallow the player requests to have a flying mount land. | |||
'''Function [[SetBeastForm - Game|SetBeastForm]](bool abEntering)''' | |||
*Flags the player as being in/out of "beast form". | |||
'''Function [[SetCameraTarget - Game|SetCameraTarget]](Actor arTarget)''' | |||
*Sets the camera target actor | |||
'''Function [[SetHudCartMode - Game|SetHudCartMode]](bool abSetCartMode)''' | |||
*Flags the HUD as being in "cart mode" or not. | |||
'''Function [[SetInChargen - Game|SetInChargen]](bool abDisableSaving, bool abDisableWaiting, bool abShowControlsDisabledMessage)''' | |||
*Enable/disable various functionality which we want in chargen. | |||
'''Function [[SetPlayerAIDriven - Game|SetPlayerAIDriven]](bool abAIDriven)''' | |||
*Enables or disables the AI driven flag on the player. | |||
'''Function [[SetPlayerReportCrime - Game|SetPlayerReportCrime]](bool abReportCrime)''' | |||
*Set the state of the player as an actor who commits crimes | |||
'''Function [[SetSittingRotation - Game|SetSittingRotation]](float afValue)''' | |||
*Set the player's sitting camera offset rotation. | |||
'''Function [[SetSunGazeImageSpaceModifier - Game|SetSunGazeImageSpaceModifier]](ImageSpaceModifier apImod)''' | |||
*Will cause the specified ImageSpace Modifier to be triggered when the player begins looking at the sun | |||
'''Function [[ShakeCamera - Game|ShakeCamera]](ObjectReference akSource, float afStrength)''' | |||
*Shakes the camera from the specified location with the specified strength. | |||
'''Function [[ShakeController - Game|ShakeController]](float afLeftStrength, float afRightStrength, float afDuration)''' | |||
*Shakes the controller for the specified amount of time. | |||
'''Function [[ShowFirstPersonGeometry - Game|ShowFirstPersonGeometry]](bool abShow)''' | |||
*Shows or hides the first-person geometry | |||
'''Function [[ShowLimitedRaceMenu - Game|ShowLimitedRaceMenu]]()''' | |||
*Shows the race/sex change menu, but without the ability to change race or sex. | |||
'''Function [[ShowRaceMenu - Game|ShowRaceMenu]]()''' | |||
*Shows the race/sex change menu. | |||
'''Function [[ShowTitleSequenceMenu - Game|ShowTitleSequenceMenu]]()''' | |||
*Shows the title sequence menu. | |||
'''Function [[ShowTrainingMenu - Game|ShowTrainingMenu]](Actor aActor)''' | |||
*Shows the training menu provided by actor parameter. | |||
'''Function [[StartTitleSequence - Game|StartTitleSequence]](string asSequenceName)''' | |||
*Plays the specified sequence in the title menu. | |||
'''Function [[TeachWord - Game|TeachWord]](WordOfPower akWord)''' | |||
*Teaches the specified [[WordOfPower Script|WordOfPower]] to the player | |||
'''Function [[TriggerScreenBlood - Game|TriggerScreenBlood]](int aiValue)''' | |||
*Trigger on-screen blood splatter. | |||
'''Function [[UnlockWord - Game|UnlockWord]](WordOfPower akWord)''' | |||
*Unlocks the specified [[WordOfPower Script|WordOfPower]] so the player can use it | |||
| | '''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)''' | |||
*Sets the number of perk points available to the player. | |||
'''Function [[ModPerkPoints - Game|ModPerkPoints]](int perkPoints)''' | |||
*Changes the number of perk points available to the player by the specified amount. | |||
'''Function [[SetGameSettingBool - Game|SetGameSettingBool]](String setting, bool value)''' | |||
*Changes the value of boolean Game Settings. | |||
'''Function [[SetGameSettingInt - Game|SetGameSettingInt]](String setting, int value)''' | |||
*Changes the value of integer Game Settings. | |||
'''Function [[SetGameSettingFloat - Game|SetGameSettingFloat]](String setting, float value)''' | |||
*Changes the value of float Game Settings. | |||
'''Function [[SetGameSettingString - Game|SetGameSettingString]](String setting, string value)''' | |||
*Changes the value of string Game Settings. | |||
'''int Function [[GetModCount - Game|GetModCount]]()''' | |||
*Returns the number of mods currently active. | |||
'''string Function [[GetModName - Game|GetModName]](int modIndex)''' | |||
*Returns the mods name at the specified index. | |||
'''string Function [[GetModAuthor - Game|GetModAuthor]](int modIndex)''' | |||
*Returns the specified mod's author. | |||
'''string Function [[GetModDescription - Game|GetModDescription]](int modIndex)''' | |||
*Returns the specified mod's description. | |||
'''int Function [[GetModDependencyCount - Game|GetModDependencyCount]](int modIndex)''' | |||
*Returns the dependency count of the specified mod. | |||
'''int Function [[GetNthModDependency - Game|GetNthModDependency]](int modIndex, int n)''' | |||
*Returns the mod index of the specified Dependency. | |||
'''int Function [[GetCameraState - Game|GetCameraState]]()''' | |||
*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) | |||
== Member Functions == | |||
None | |||
== Events == | |||
None | |||