Difference between revisions of "Game Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Behippo
(→‎SKSE Global Functions: - Added SKSE Global Functions list.)
imported>PurpleLunchbox
Line 2: Line 2:
[[Category:Papyrus]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:Script Objects]]
[[Category:SKSE]]


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

Revision as of 22:03, 13 May 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.

SKSE Global Functions

int Function GetPerkPoints()

  • Returns the number of perk points available to the player.

Function SetPerkPoints(int perkPoints)

  • Sets the number of perk points available to the player.

Function ModPerkPoints(int perkPoints)

  • Changes the number of perk points available to the player by the specified amount.

Member Functions

None

Events

None