Difference between revisions of "Game Script"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Qazaaq
(Added F4SE member)
imported>ShadeMe
(Add missing F4SE global functions, and "F4SE" to section header)
Line 242: Line 242:
**Emits a warning to the papyrus log and the game warning system.
**Emits a warning to the papyrus log and the game warning system.


== Global Functions ==
== F4SE Global Functions ==
*ObjectReference Function [[GetCurrentConsoleRef - Game|GetCurrentConsoleRef]]()
*ObjectReference Function [[GetCurrentConsoleRef - Game|GetCurrentConsoleRef]]()
**Returns the current console reference.
**Returns the current console reference.
*PluginInfo[] Function [[GetInstalledPlugins - Game|GetInstalledPlugins]]()
**Returns an array of currently installed esm and esp files.
*PluginInfo[] Function [[GetInstalledLightPlugins - Game|GetInstalledLightPlugins]]()
**Returns an array of currently installed esl files.
*string[] Function [[GetPluginDependencies - Game|GetPluginDependencies]](string asPluginName)
**Returns an array of plugin dependencies for the specified plugin.
*Function [[SetGameSettingBool - Game|SetGameSettingBool]](string asSetting, bool abValue)
**Set the value of a boolean GameSetting.
*Function [[SetGameSettingInt - Game|SetGameSettingInt]](string asSetting, int aiValue)
**Set the value of a int GameSetting.
*Function [[SetGameSettingFloat - Game|SetGameSettingFloat]](string asSetting, float afValue)
**Set the value of a float GameSetting.
*Function [[SetGameSettingString - Game|SetGameSettingString]](string asSetting, string asString)
**Set the value of a string GameSetting.


== Member Functions ==
== Member Functions ==
None
== F4SE Member Functions ==
None
None


== Events ==
== Events ==
None
None
== See Also ==
[[Data_File|Data Files]]

Revision as of 23:58, 21 October 2017

Collection of game-specific global functions

Definition

ScriptName Game Native Hidden

Properties

None

Global Functions

  • Function AddAchievement(int aiAchievementID)
    • Adds the specified achievement/trophy to the player's gamer profile.
  • Function AddPerkPoints(int aiPerkPoints)
    • Adds the given number of perk points to the player. Clamped at 255.
  • Function AdvanceSkill(string asSkillName, float afMagnitude)
    • Advance the given skill on the player by the provided amount of skill usage
  • 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 EnablePipboyHDRMask(bool abEnable)
    • Enables/disables the HDR mask for the pipboy screen.
  • Function Error(string asMessage)
    • Emits an error and stack trace to the papyrus log and the game warning system (not removed by compiler in release builds)
  • Function FadeOutGame(bool abFadingOut, bool abBlackFade, float afSecsBeforeFade, float afFadeDuration, bool abStayFaded)
    • 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 ForceDisableSSRGodraysDirLight(bool abDisableSSR, bool abDisableGodrays, bool abDisableDirLight)
    • Selectively disable certain rendering effects.
  • Function ForceFirstPerson()
    • Forces the player camera into 1st-person.
  • Function ForceThirdPerson()
    • Forces the player camera into 3rd-person.
  • ActorValue Function GetAggressionAV()
    • Get the Aggression Actor Value
  • ActorValue Function GetAgilityAV()
    • Get the Agility Actor Value
  • MiscObject Function GetCaps()
    • Get the base Caps001 object, the basic unit of money in the game.
  • ActorValue Function GetCharismaAV()
    • Get the Charisma Actor Value
  • ActorValue Function GetConfidenceAV()
    • Get the Confidence Actor Value
  • int Function GetDifficulty()
    • Returns the game's current difficulty setting.
  • ActorValue Function GetEnduranceAV()
    • Get the Endurance Actor Value
  • Form Function GetForm(int aiFormID)
    • Obtains a Form from the game by its form ID number.
  • Form Function GetFormFromFile(int aiFormID, string asFilename)
    • Obtains a Form from the game by its form ID number and expected file.
  • 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.
  • ActorValue Function GetHealthAV()
    • Get the Health Actor Value
  • ActorValue Function GetIntelligenceAV()
    • Get the Intelligence Actor Value
  • ActorValue Function GetLuckAV()
    • Get the Luck Actor Value
  • ActorValue Function GetPerceptionAV()
    • Get the Perception Actor Value
  • Actor Function GetPlayer()
    • Obtains the Actor that represents the player.
  • Actor[] Function GetPlayerFollowers()
    • Returns an array of the player's followers.
  • ObjectReference Function GetPlayerGrabbedRef()
  • float Function GetPlayerRadioFrequency()
    • Returns the frequency the player's radio is currently set at.
  • Actor Function GetPlayersLastRiddenHorse()
    • Gets the player's last ridden horse, if any.
  • int Function GetPlayerLevel()
    • Returns the player's current level
  • float Function GetRealHoursPassed()
    • Returns the number of real-life hours that have passed playing the game.
  • ActorValue Function GetSuspiciousAV()
    • Get the Suspicious Actor Value
  • ActorValue Function GetStrengthAV()
    • Get the Strength Actor Value
  • int Function GetXPForLevel(int auiLevel)
    • Obtains the total amount of XP necessary to obtain the passed-in level
  • Function GivePlayerCaps(int nCaps)
    • Gives the player X caps
  • Function HideTitleSequenceMenu()
    • Hides the title sequence menu.
  • Function IncrementSkill(ActorValue akActorValue, int aiCount)
    • Advances the provided Skill by the given number of points (for the player only).
  • Function IncrementStat(string asStatName, int aiModAmount)
    • Modifies the specified MiscStat by the given amount
  • Function InitializeMarkerDistances()
    • Called to tell the Compass displays to refresh after gamesettings are updated related to hardcore mode
  • bool Function IsActivateControlsEnabled()
    • Are the activation controls enabled?
  • bool Function IsCamSwitchControlsEnabled()
    • Are the camera switch controls enabled?
  • bool Function IsFastTravelControlsEnabled()
    • Are fast travel controls enabled?
  • bool Function IsFastTravelEnabled()
    • Is fast travel enabled?
  • bool Function IsFavoritesControlsEnabled()
    • Is the favorites controls enabled?
  • bool Function IsFightingControlsEnabled()
    • Are the fighting controls enabled?
  • bool Function IsJournalControlsEnabled()
    • Are the journal menu controls enabled?
  • bool Function IsJumpingControlsEnabled()
    • Are the jumping 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 IsPluginInstalled(string asName)
    • Checks to see if the specified plugin is installed and activated
  • bool Function IsPlayerInRadioRange(float afFrequency)
    • Returns whether the player is within the outer radius of a transmitter using the given frequency.
  • bool Function IsPlayerListening(float afFrequency)
    • Returns whether the player actively listening to a transmitter that uses the given frequency.
  • bool Function IsPlayerRadioOn()
    • Is the player's radio currently turned on?
  • bool Function IsSneakingControlsEnabled()
    • Are the sneaking controls enabled?
  • bool Function IsVATSControlsEnabled()
    • Are the VATS controls enabled?
  • bool Function IsVATSPlaybackActive()
    • Is VATS playback currently running?
  • Function PassTime(int aiHours)
    • Pass the given number of hours as if the player waited.
  • Function PlayBink(string asFileName, bool abInterruptible, bool abMuteAudio, bool abMuteMusic, bool abLetterbox, bool abIsNewGameBink)
    • Plays a bink video
  • Function PlayEventCamera(CameraShot akCamera, ObjectReference akRef)
    • Plays an event camera attached to the given reference
  • 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.
  • Function RemovePlayerCaps(int nCaps)
    • Removes X caps from the player.
  • 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 RewardPlayerXP(int auiXPAmount, bool abDirect)
    • Rewards the player with a certain amount of XP, optionally ignoring any XP gain modifiers.
  • Function ServeTime()
    • Has the player serve their jail time.
  • Function SetCameraTarget(Actor arTarget)
    • Sets the camera target actor
  • Function SetCharGenHUDMode(int aiCGHUDMode)
    • Sets or clears CharGen-specific HUD modes.
  • Function SetInChargen(bool abDisableSaving, bool abDisableWaiting, bool abShowControlsDisabledMessage)
    • Enable/disable various functionality which we want in chargen.
  • Function SetInsideMemoryHUDMode(bool aInsideMemory)
    • Sets or clears InsideMemory HUD Mode
  • Function SetPlayerAIDriven(bool abAIDriven)
    • Enables or disables the AI driven flag on the player.
  • Function SetPlayerOnElevator|(bool abOnElevator)
    • Sets/clears the player as on an elevator
  • Function SetPlayerRadioFrequency(float afFrequency)
    • Sets the frequency the player's radio should be turned to
  • 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, float afDuration)
    • 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 ShowAllMapMarkers()
    • Shows all map markers on the world map.
  • Function ShowFatigueWarningOnHUD()
    • Causes the Fatigue Warning to show on the HUD
  • Function ShowFirstPersonGeometry(bool abShow)
    • Shows or hides the first-person geometry
  • Function ShowPerkVaultBoyOnHUD(string aVaultBoySwf, Sound aSoundDescriptor = None)
    • Plays the specified Perk VaultBoy Swf and sound on the HUD.
  • Function ShowPipboyBootSequence(string asAnimationName)
    • Shows the specified pipboy boot sequence
  • Function ShowPipboyPlugin()
    • Shows the pipboy plugin animation on the pipboy
  • Function ShowRaceMenu(ObjectReference akMenuTarget, int uiMode, ObjectReference akMenuSpouseFemale, ObjectReference akMenuSpouseMale, ObjectReference akVendor)
    • Shows the race/sex change menu.
  • Function ShowSPECIALMenu()
    • Shows the SPECIAL change menu.
  • Function ShowTitleSequenceMenu()
    • Shows the title sequence menu.
  • Function ShowTrainingMenu(Actor aActor)
    • Shows the training menu provided by actor parameter.
  • Function StartDialogueCameraOrCenterOnTarget(ObjectReference akCameraTarget)
    • Start dialogue cameras or swing first person camera to the target
  • Function StartTitleSequence(string asSequenceName)
    • Plays the specified sequence in the title menu.
  • Function StopDialogueCamera(bool abConsiderResume, bool abSwitchingTo1stP)
    • Stops all dialogue cameras
  • Function TriggerScreenBlood(int aiValue)
    • Trigger on-screen blood splatter.
  • Function TurnPlayerRadioOn(bool abRadioOn)
    • Turns the player's radio on and off.
  • bool Function UsingGamepad()
    • Returns whether the player is using a gamepad or not.
  • Function Warning(string asMessage)
    • Emits a warning to the papyrus log and the game warning system.

F4SE Global Functions

  • PluginInfo[] Function GetInstalledPlugins()
    • Returns an array of currently installed esm and esp files.
  • string[] Function GetPluginDependencies(string asPluginName)
    • Returns an array of plugin dependencies for the specified plugin.
  • Function SetGameSettingBool(string asSetting, bool abValue)
    • Set the value of a boolean GameSetting.
  • Function SetGameSettingInt(string asSetting, int aiValue)
    • Set the value of a int GameSetting.
  • Function SetGameSettingFloat(string asSetting, float afValue)
    • Set the value of a float GameSetting.
  • Function SetGameSettingString(string asSetting, string asString)
    • Set the value of a string GameSetting.

Member Functions

None

F4SE Member Functions

None

Events

None

See Also

Data Files