Difference between revisions of "Game Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>Jog
Line 14: Line 14:


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


== Member Functions ==
== Member Functions ==

Revision as of 13:46, 20 February 2012


Collection of game-specific global functions

Definition

ScriptName Game

Properties

None

Global Functions

Function AddAchievement(int aiAchievementID)

  • Adds the specified achievement/trophy to the player's gamer profile.

Function AdvanceSkill(string asSkillName, float afMagnitude)

  • Advance the given skill on the player by the provided amount of skill usage

bool Function 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(int aiFavorPrice)

  • Calculates how many points the player would have to pay for a favor of the specified price.

Function ClearPrison()

  • Clears all Prison variables on the PlayerCharacter so the game will know he is out of prison.

Function ClearTempEffects()

  • Clears all temp effects (such as terrain effects) in the game.

Function 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(bool abEnable)

  • Enables or disables the player's ability to fast travel.

Function 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(bool abFadingOut, bool abBlackFade, float afSecsBeforeFade, float afFadeDuration)

  • Fades the game in and out with the specified parameters.

Function FastTravel(ObjectReference akDestination)

  • Fast-travels the player to the specified object's location.

Actor Function FindClosestActor(float afX, float afY, float afZ, float afRadius)

  • Finds the closest actor within a given radius of a location

Actor Function FindClosestActorFromRef(ObjectReference arCenter, float afRadius)

  • Finds the closest actor within a given radius of a reference

ObjectReference Function 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(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(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(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(float afX, float afY, float afZ, float afRadius)

  • Finds a random actor within a given radius of a location

Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius)

  • Finds a random actor within a given radius of a reference

ObjectReference Function 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(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(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(Form arBaseObject, ObjectReference arCenter, float afRadius)

  • Finds a random reference of a given base object within a given radius of a reference

Function ForceFirstPerson()

  • Forces the player camera into 1st-person.

Function ForceThirdPerson()

  • Forces the player camera into 3rd-person.

Form Function GetForm(int aiFormID)

  • Obtains a Form from the game by its form ID number.

float Function GetGameSettingFloat(string asGameSetting)

  • Obtains the value of a float game setting.

float Function GetGameSettingInt(string asGameSetting)

  • Obtains the value of an int game setting.

float Function GetGameSettingString(string asGameSetting)

  • Obtains the value of a string game setting.

Actor Function GetPlayer()

  • Obtains the Actor that represents the player.

ObjectReference Function GetPlayerGrabbedRef()

Actor Function 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()

  • Returns the number of real-life hours that have passed playing the game.

Function HideTitleSequenceMenu()

  • Hides the title sequence menu.

Function IncrementSkill(string asSkillName)

  • Advances the provided Skill by the one point (for the player only).

Function IncrementSkillBy(string asSkillName, int aiCount)

  • Advances the provided Skill by the given number of points (for the player only).

Function IncrementStat(string asStatName, int aiModAmount) native global

  • Modifies the specified MiscStat by the given amount

bool Function IsActivateControlsEnabled()

  • Are the activation controls enabled?

bool Function IsCamSwitchControlsEnabled()

  • Are the camera switch controls enabled?

bool Function IsFastTravelEnabled()

  • Is fast travel enabled?

bool Function IsFightingControlsEnabled()

  • Are the fighting controls enabled?

bool Function IsJournalControlsEnabled()

  • Are the journal menu controls enabled?

bool Function IsLookingControlsEnabled()

  • Are the looking controls enabled?

bool Function IsMenuControlsEnabled()

  • Are the menu controls enabled?

bool Function IsMovementControlsEnabled()

  • Are the movement controls enabled?

bool Function IsSneakingControlsEnabled()

  • Are the sneaking controls enabled?

bool Function IsWordUnlocked(WordOfPower akWord)

  • Is the word of power unlocked on the player?

Function PlayBink(string asFileName, bool abInterruptible, bool abMuteAudio, bool abMuteMusic, bool abLetterbox)

  • Plays a bink video

Function PrecacheCharGen()

  • Precaches all the data used by character gen to avoid hitches with file I/O.

Function PrecacheCharGenClear()

  • Clears all the previously cached data used by character gen.

int Function QueryStat(string asStat)

  • Queries the given stat and returns its value.

Function QuitToMainMenu()

  • Forces the game back to the main menu.

bool Function RemoveHavokConstraints(ObjectReference arFirstRef, string arFirstRefNodeName, ObjectReference arSecondRef, string arSecondRefNodeName)

  • Removes any constraint between two rigid bodies

Function RequestAutoSave()

  • Requests for an auto-save to be made.

Function RequestModel(string asModelName)

  • Requests the specified model.

Function RequestSave()

  • Requests for a normal save to be made.

Function SendWereWolfTransformation()

  • Finds an actor in high who can detect the player to call werewolf crime on the player

Function ServeTime()

  • Has the player serve their jail time.

Function SetBeastForm(bool abEntering)

  • Flags the player as being in/out of "beast form".

Function SetCameraTarget(Actor arTarget)

  • Sets the camera target actor

Function SetHudCartMode(bool abSetCartMode)

  • Flags the HUD as being in "cart mode" or not.

Function SetInChargen(bool abDisableSaving, bool abDisableWaiting, bool abShowControlsDisabledMessage)

  • Enable/disable various functionality which we want in chargen.

Function SetPlayerAIDriven(bool abAIDriven)

  • Enables or disables the AI driven flag on the player.

Function SetPlayerReportCrime(bool abReportCrime)

  • Set the state of the player as an actor who commits crimes

Function SetSittingRotation(float afValue)

  • Set the player's sitting camera offset rotation.

Function ShakeCamera(ObjectReference akSource, float afStrength)

  • Shakes the camera from the specified location with the specified strength.

Function ShakeController(float afLeftStrength, float afRightStrength, float afDuration)

  • Shakes the controller for the specified amount of time.

Function ShowFirstPersonGeometry(bool abShow)

  • Shows or hides the first-person geometry

Function ShowRaceMenu()

  • Shows the race/sex change menu.

Function ShowTitleSequenceMenu()

  • Shows the title sequence menu.

Function ShowTrainingMenu(Actor aActor)

  • Shows the training menu provided by actor parameter.

Function StartTitleSequence(string asSequenceName)

  • Plays the specified sequence in the title menu.

Function TeachWord(WordOfPower akWord)

Function TriggerScreenBlood(int aiValue)

  • Trigger on-screen blood splatter.

Function UnlockWord(WordOfPower akWord)

  • Unlocks the specified WordOfPower so the player can use it

bool Function UsingGamepad()

  • Returns whether the player is using a gamepad or not.

Member Functions

None

Events

None