function AddHealth(Pawn P, float fHealth, optional bool bDontTakeKnockback, optional bool bBypassHealthCap, optional bool bPlayBumpline) - Same as SetHealth(), but adds to the pawn's health instead
function bool AddInventory(class<KWInventoryCollection> CollectionClass, int iNumItems) - Adds to the inventory collection CollectionClass by iNumItems
function AddShamrocks(int iShamrockCount, optional bool bBypassHealthCap, optional bool bPlayBumpline) - Same as SetShamrocks(), but adds to the shamrock count instead
function Announce(string sText1, optional float fDuration, optional Color cTextColor, optional string sText2, optional string sText3, optional string sText4) - Announces text onto the center of the screen with the text sText1 for fDuration seconds with the color for the text being cTextColor. Can optionally provide 3 more texts
function bool AssertM(bool B, coerce string S) - A KnowWonder function that logs the error S if B is false, then returns B
function string CC(string S) - Runs the player console command S, then returns the return from the console command S (if applicable)
function ChangeLevel(string sLevelName, optional bool bKeepInventory) - A simple function to change the current level to level name sLevelName. bKeepInventory will cause inventories to transfer across maps
function ClearInventory() - Clears all player inventories
function CM(coerce string S) - An alias for ClientMessage()
function CMAndLog(coerce string S) - Runs CM() and Log() with the value S
function int CopySavedGame(int iCopyFromID, int iPasteAsID) - Copies the save game slot iCopyFromID and pastes it with the ID iPasteAsID, then returns an integer higher than -1 if the copy succeeded. -1 means it failed to copy, 0 means the slot iPasteAsID already existed but the copy still succeeded, and 1 means the slot iPasteAsID did not initially exist and the copy succeeded
function DestroyAll(class<Actor> aClass) - Destroys all actors with the class aClass (via FancyDestroy())
function bool DoesFileExist(string sFileName) - Checks if the file sFileName exists in the game's directory or not. This function will only return true if the file does exist and if the file's line break system is CRLF (essentially, binary files will not be identified otherwise)
function bool DivideInventory(class<KWInventoryCollection> CollectionClass, float fDivisor) - Divides the inventory collection CollectionClass by fDivisor
function bool DoesMapFileExist(string sMapName) - [Expensive Function] Returns true if the map name sMapName is found to exist in the game's directory
function FadeScreen(Color ScreenColor, optional float fFadeTime, optional KWGame.enumMoveType FadeType, optional bool bFlash) - A simple way to fade the screen to a certain color. ScreenColor will be the new screen's color, fFadeTime is the time in seconds a fade will take to change, FadeType is the easing type for the transition, and bFlash will cause the change to act like a flash
function FancyDestroy(Actor A) - Destroys the actor A. This function will run a more sophisticated method of the destruction of an actor, and will try to destroy any other important actors that may be tied to it
function bool FancyPlayMovie(string sMovieName, bool bUseSound, optional bool bLoopMovie, optional bool bNoSmartPlay, optional string sMovieName512, optional string sMovieName640, optional string sMovieName1024) - Plays the movie sMovieName on top of the current player's screen. By default, this function assumes that 512, 640 and 1024 versions of your movie exist, and assumes they are done the same way KnowWonder formatted their movie names. bUseSound allows the movie to play its own sound, bLoopMovie makes the movie infinitely loop until it's manually stopped, and bNoSmartPlay will mean you must manually specify the 512, 640 and 1024 versions of your movie (next 3 arguments). Returns true if a movie has been started
function bool FancySetRotation(Actor TargetActor, optional rotator NewRotation, optional float fAccuracy, optional bool bYawOnly) - Sets the rotation of the actor TargetActor to equal NewRotation. If the rotation is blocked, the rotation will be adjusted in all directions to see if any are valid. If any are valid, the closest rotation to the original will be the rotation that is set on TargetActor. fAccuracy specifies the percentage of all possible calculations that should be made (don't change this unless you know what you're doing, 0.000122 would be the highest safe recommended accuracy) and bYawOnly will cause only Yaw adjustments to be made. Returns true if the SetRotation() was successful
function FindCurrentMusic(out string CurrentMusic) - Outputs the current music through CurrentMusic
function string FormatMovieString(string S) - Adds ".bik" to the end of the string S if it's not already there and returns it
function Actor GetActorFromLabel(string rTag) - Returns with the first actor located in the current level that has the label equal to rTag
function array<string> GetAvailableMaps(optional bool bDoNotRemoveUnr) - [Expensive Function] Returns an array of all map names that are in the game's map directory. If bDoNotRemoveUnr=true, then .unr will not be removed from the map names
function class<Actor> GetClassByString(string S) - Casts string S into an actor class and returns it
function string GetCurrentMap() - Returns the current map name (the map that is currently loaded)
function Movie GetCurrentMovie() - Returns the current movie that is playing
function vector GetCurrentMovieResolution() - Returns a vector that contains the current Movie's resolution
function string GetCurrentMusic() - Returns the current music that is playing
function int GetCurrentSaveSlot() - Returns the current save slot that is being ran on
function float GetDeltaTime() - Returns the current frame delta time, allowing you to get a value for how long it took for the current game frame to generate in milliseconds
function float GetFPSCap() - Returns the current native FPS cap the game is using (equals 0.0 if uncapped)
function int GetInventoryCount(class<KWInventoryCollection> CollectionClass) - Gets the inventory count of the inventory collection CollectionClass
function byte GetIKAction(byte Key) - Returns the current action from the InteractionKey Key
function string GetIniEntry(string SectionName, string KeyName, string PackageName) - Returns a string of the current default value for the variable KeyName from within class SectionName from the package PackageName. Typically PackageName will be equal to "user" in order to access user.ini, which contains any configuration variable values
function string GetLanguage() - Returns the current game's language, which will be returned in the same format as shown in Default.ini
function float GetLevelLoadTime(optional bool bGetOriginal) - Returns the time it took in seconds for the level to load. This only returns a value a single tick AFTER the level has finished loading, meaning you can't simply check what the level load time was from the PostLoadGame() event, rather you'll need to constantly check every tick for when it updates for a single tick. If bGetOriginal=true, then you can get the original load time (this load time does not go back down to 0.0, so it can always be read from)
function float GetMaxHealth(Pawn P) - Returns the maximum health that the pawn P can have
function vector GetMouseCoords() - Returns a vector that contains the coordinates of the mouse cursor
function vector GetResolution() - Returns a vector that contains the current game's resolution
function GivePawnController(KWPawn P) - Gives the KWPawn P its default controller, as well as initializing various aspects of the pawn. Typically always needed/used when spawning in pawns with controllers
function HackMovementAnims(SHHeroPawn SHHP, array<name> MovementAnims) - Hacks the variable MovementAnims on the pawn SHHP to equal the animations provided. This is an essential hack because modifying MovementAnims directly will crash the game. This hack is only available for SHHeroPawn's
function bool IsDebugModeEnabled() - Returns true if debug mode is currently enabled
function bool IsFullscreen() - Returned true if the game is currently in fullscreen
function int IsHUDItemLoaded(class<KWHudItem> C) - Returns a value higher than -1 if the HUD item class C is currently loaded. The value that is returned will correspond with the index to that specific HUD item
function bool IsInBonusLevel() - Returns true if the current map is a bonus level. This is done by checking if the current map's name contains the phrase "Beanstalk", and if it does, then it's assumed it's a bonus world
function bool IsKeyInAction(byte Key, byte Action) - Returns true if the key Key is in the action Action. This can be used to determine whether a key is being pressed
function bool IsMouseAvailable() - Returns true if the mouse is available
function bool IsMouseVisible() - Returns true if the mouse is visible
function bool IsMoviePaused() - Returns true if the current movie is paused
function bool IsMoviePlaying() - Returns true if the current movie is playing (playing as in the movie is showing)
function bool IsMovingForward(Actor A) - Returns true if the actor A is moving forward
function bool IsShrek22() - Returns true if the game is running the Shrek 2.2 full-game modification
function bool IsUTracing() - Returns true if U Tracing is enabled
function KillPawn(Pawn P, optional bool bPlayBumpline) - Kills the pawn P. If bPlayBumpline=true, then the pawn will attempt to play a bumpline when killed
function KWDeleteSaveGame(int iSlot) - Attempts to delete the save game with the ID iSlot. This will fail to delete the save game if the game is currently running off of that save game
function LipSyncDialog(KWPawn LipSyncOwner, Sound DialogSound, string sDialogLine) - Runs a backup lipsyncing implementation on the pawn LipSyncOwner, playing the sound DialogSound and reading from the dialog sDialogLine (the dialog line MUST be provided in order for the system to work). This should only be used if lipsyncing is unavailable (e.g. the AllDialog.uax sound package is modified)
function LoadAGame(int iSlot, optional bool bLoadCurrentSaveSlot) - Loads the save slot iSlot. If bLoadCurrentSaveSlot=true, then iSlot is made to equal the current game slot
function int LoadHUDItem(class<KWHudItem> C) - Loads in a new HUD item with the class C and returns the index of the new HUD item
function LogAndCM(coerce string S) - Runs Log() and CM() with the value S
function bool PauseMovie(bool B) - The provided variable B determines whether or not the current movie should pause or not, then returns true if the current movie is matching the value of B in terms of whether it's paused
function bool MFancySetLocation(Actor TargetActor, optional vector NewLocation, optional int iSetLocationAttempts, optional bool bZOnly) - Sets the location of TargetActor to the location NewLocation. If the location is blocked, then NewLocation will be adjusted in all directions to see if an adjustment makes it possible to set the location of the actor. iSetLocationAttempts determines how many tries a SetLocation() attempt should be made in all 6 directions, and bZOnly will cause only Z-axis adjustments to be made if needed. Returns true if the SetLocation() was successful
function bool MFancySpawn(class<Actor> ClassType, optional vector vSpawnLocation, optional rotator rSpawnRotation, optional out Actor outActor, optional int iSpawnAttempts, optional bool bZOnly) - Spawns in the actor with the class ClassType at the location vSpawnLocation, with the rotation rSpawnRotation. If the location is blocked, then vSpawnLocation will be adjusted in all directions to see if an adjustment makes it possible to spawn the actor in. outActor is an actor reference of the newly-spawned actor, iSpawnAttempts determines how many tries a Spawn() attempt should be made in all 6 directions, and bZOnly will cause only Z-axis adjustments to be made if needed. Returns true if the Spawn() was successful
function name MergeNames(name N1, name N2) - Takes the 2 name variables, merges them together, then returns it
function bool MultiplyInventory(class<KWInventoryCollection> CollectionClass, float fMultiplier) - Multiplies the inventory collection CollectionClass by fMultiplier
function bool NeedSAPFont() - ??? (Native KnowWonder function with an unknown use)
function bool PlayAMusic(string sMusic, optional float fFadeInTime, optional bool bDoNotLoop, optional bool bStab) - Plays the music track sMusic that fades in over the course of fFadeInTime seconds. bDoNotLoop will cause the music to only play a single time, and bStab will cause the music to stab. It's unknown what a music stab is (it's a KnowWonder function), and it appears to break the game's music, so it's recommended to never use this. Returns true if the current music track matches sMusic. If the keyword | is used at the right of sMusic, then the music track name provided after will play in the case that the first music track fails to play (due to it not being located)
function Sound PlayASound(optional string sSoundString, optional Sound SoundOverride, optional float fVolume, optional bool bMoveCurrentPlayersMouth, optional Actor.ESoundSlot SoundSlot) - Plays a 2D sound with the name sSoundString. If you want to use a direct sound reference instead, make SoundOverride the sound you wish to play. fVolume determines the volume of the sound, and bMoveCurrentPlayersMouth will allow a sound to move the current player's mouth, which you typically will not want. Returns the sound that is played (if no sound is returned, then the sound was either improperly provided or sSoundString was not equal to any existing sound package names)
function Sound PlayASound3D(Actor A, optional string sSoundString, optional Sound SoundOverride, optional float fVolume, optional float fRadius, optional float fPitch, optional bool bMoveCurrentPlayersMouth, optional Actor.ESoundSlot SoundSlot) - Plays a 3D sound from the actor A with the name sSoundString. If you want to use a direct sound reference instead, make SoundOverride the sound you wish to play. fVolume determines the volume of the sound, fRadius determines how far away the sound can be heard from, fPitch determines the pitch at which the sound should play at, and bMoveCurrentPlayersMouth will allow a sound to move the current player's mouth, which you typically will not want. Returns the sound that is played (if no sound is returned, then the sound was either improperly provided or sSoundString was not equal to any existing sound package names)
function bool PlayMovie(string sMovieName, bool bUseSound, optional bool bLoopMovie) - Plays the movie sMovieName on top of the current player's screen. bUseSound allows the movie to play its own sound and bLoopMovie makes the movie infinitely loop until it's manually stopped. Returns true if a movie has been started
function PopupText(string sPopupMessage, string sTopPopupMessage, float fPopupDuration, Color cTextColor) - Pops up text onto the screen using the game's native subtitle system. sPopupMessage is the message seen on the bottom, sTopPopupMessage is the message seen on the top, fPopupDuration is how long the popup will show in seconds, and cTextColor is the color of the text that will be used. sTopPopupMessage should be equal to "" if you do not wish to put a message at the top of the screen. If a top message is used, then the cutscene bars will appear on both the top and bottom of the screen
function Quit() - Quits the game
function RestartLevel(optional bool bDoNotKeepInventory) - A simple function to easily restart the current level
function RestartSound() - [Very Expensive Function] Restarts the sound driver. This is helpful if the default sound device changes during play. Only use this function if absolutely necessary, because it will usually lag the game between 300-1500 milliseconds between each execution. The plus to using this method of restarting the sound driver instead of the console command is that it properly restarts the music, since that would otherwise be broken to some extent (it would stop playing altogether)
function int SaveAGame(int iSlot, optional bool bSaveToCurrentSaveSlot) - Saves the current running game to save slot iSlot. If bSaveToCurrentSaveSlot=true, then iSlot is made to equal the current game slot. Returns the slot that was saved to, which is not always equal to iSlot due to bSaveToCurrentSlot being able to change it
function bool SaveGameExists(int iSlot) - Returns true if the save game with the ID iSlot exists
function Screenshot() - Takes a screenshot of the current game window and outputs it into the System folder
function SetDebugMode(bool bEnabled) - Sets whether debug mode is enabled to bEnabled
function SetHealth(Pawn P, float fHealth, optional bool bDontTakeKnockback, optional bool bBypassHealthCap, optional bool bPlayBumpline) - Sets the health of pawn P to equal fHealth. bDontTakeKnockback will prevent any sort of knockback from occurring, bBypassHealthCap will cause any sort of health cap to be ignored, and bPlayBumpline will cause the pawn to say a bumpline in accordance with whether the pawn gets healed or hurt, assuming the pawn is applicable for saying a bumpline in the first place
function SetIKAction(byte Key, byte Action) - Sets MUtils current InteractionKey Key's action to equal Action. Should only be used if you actually know what you're doing
function bool SetInventory(class<KWInventoryCollection> CollectionClass, int iNumItems) - Sets the inventory collection CollectionClass to equal iNumItems
function vector SetMouseCoords(vector V) - Sets the coordinates of the mouse cursor to V, then returns the coordinates of the mouse cursor after the change to its position has been made
function bool SetMouseVisibility(bool B) - Sets the visibility of the mouse to equal B, then returns true if the mouse visibility equals B
function SetNearClip(float F) - Sets the near clipping plane value to F. This value is the gap between how close the player's camera can be against anything, before un-rendering it. This means that higher values will make it so that more will be un-rendered when the camera is closer to anything
function SetShamrocks(int iShamrockCount, optional bool bBypassHealthCap, optional bool bPlayBumpline) - Sets the amount of shamrocks the current player has to iShamrockCount. bBypassHealthCap will cause all health caps to be bypassed, and bPlayBumpline will cause the current player to say a bumpline in accordance with whether the current player gets healed or hurt, assuming the current player is applicable for saying a bumpline in the first place
function SetUTracing(bool bNewUTracing, optional bool bTraceNative) - Sets whether U Tracing is enabled or not to equal bNewUTracing. When U Tracing is enabled, it constantly logs each tick of every single actor, and it typically is dangerous to use this function unless you actually know what you're doing. bTraceNative will cause all U Traces to only be native ones
function bool StopAMusic(optional float fFadeOutTime) - Stops all music from playing. fFadeOutTime equals how long it will take for the music to fade out in seconds. Returns true if no music is playing
function bool StopMovie() - Stops the current movie from playing, if a movie is currently playing. Returns true if a movie is not playing
function StopMovieOnEnd() - Tells the current movie to stop playing once it reaches the end of the movie. This is used to end a looping movie
function bool SubtractInventory(class<KWInventoryCollection> CollectionClass, int iNumItems) - Subtracts from the inventory collection CollectionClass by iNumItems
function bool UnloadHUDItem(class<KWHudItem> C) - Unloads the HUD item with the class C and returns true if the HUD item was successfully unloaded
function UnloadMutators(optional string sMapName) - Removes all running mutators by restarting the current map in a special way. If sMapName is provided, this will be the map that is loaded instead of restarting the current map
static function DrawShadowText(Canvas C, string sText, Color cTextColor, Color cTextShadowColor, int iXOffset, int iYOffset, float fShadowDist) - Similar to DrawText() from within Canvas, but draws a drop shadow for the text sText. cTextColor is the color of the text, cTextShadowColor is the color of the shadow, iXOffset and iYOffset is the position for the text, and fShadowDist is the distance the shadow will be from sText
static function float GuessReadDuration(string S, optional float fCPS) - Returns a rough amount of time in seconds it would likely take to read a string, given a CPS. fCPS determines the Characters Per Second the user will be estimated to read at, with the default being 7.0
static function Font GetFontFromEnum(EFont FontEnum) - Returns a font based on the value of the EFont enumerator that contains all fonts that are available in the game by default
static function GameEngine GetGameEngine() - Returns the current game engine
static function float GetHealth(Pawn P) - Returns the current health of pawn P
static function string GetMPakVersion() - Returns the current version of MPak
static function RenderDevice GetRenderDevice() - Returns the current rendering device
static function bool IsMainPlayer(Pawn P) - Returns true if the pawn P is classified as a main player
static function bool IsNameInNameArray(name N, array<name> Ns) - Returns true if the name N appears in the name array Ns
static function bool IsStockMap(string sMapName) - Returns true if the map name sMapName is equal to a stock map's name
static function Color MakeColor(byte R, byte G, byte B, byte A) - A simple way to make a color. Returns a color from 4 bytes provided. Unlike Canvas's MakeColor() function, this function allows you to set the value of A to equal 0 (requires explicit specification)
static function SetCheatsEnabled(bool B) - Sets whether cheating is enabled. This change is permanent until either the game is reset or the inverse function is ran. This change will not apply if the PlayerController's class is not a ShrekController or a DonkeyController. Check the console commands list to understand which console commands can be disabled with this function