Turok
 
Loading...
Searching...
No Matches
kGame Class Reference

Public Member Functions

void CallDelayedMapScript (const kStr &in funcName, kActor@ instigator, const float delay)
 even with delay 0 it will be called when map scripts update
 
void CallDelayedMapScript (const int scriptID, kActor@ instigator, const float delay)
 even with delay 0 it will be called when map scripts update
 
void CallMapScript (const int scriptID, kActor@ instigator)
 Use to call map script right away.
 
void HaltMapScript (const int scriptID)
 
void PlaySound (const kStr &in path)
 
void PlaySoundID (const int soundID)
 
void PlayMusic (const kStr &in path, const bool loop)
 
bool MusicIsPlaying ()
 
bool MusicIsPaused ()
 
void PauseMusic ()
 
void ResumeMusic ()
 
kStr MusicSong ()
 
void MusicPitch (const float pitch)
 
int PlayTactile (const kStr &in path, int channel, int pos)
 Start controller vibration from tactile sound file. Returns a handle.
 
bool IsTactilePlaying (int vibHandle)
 
bool IsTactilePlaying (int vibHandle, const kStr &in path)
 
void StopMusic ()
 
void StopTactile (int vibHandle)
 
void StopAllTactile ()
 
void Restart ()
 
void PrintLine (const kStr &in text, const int lineNumber, const int ticks=120)
 Print a message to the HUD.
 
void Print (const kStr &in text, const int ticks=120)
 Print a message to the HUD on the next line.
 
void PrintHelp (const kStr &in text, const bool endGame=false)
 
void StartTimer ()
 
void StopTimer ()
 
void RemoveTimer ()
 
void ChangeMap (const kStr &in path)
 
void ShowMainMenu (const bool mouseCenter=true)
 
const int GetMapNumberFromName (const kStr &in mapName)
 This returns the HUB number NOT the map number. mapName is the HUB name such as "Map_Jungle".
 
const int GetMapIDFromName (const kStr &in mapName)
 This returns the mapID from the mapName.
 
const int GetCurrentMapID ()
 
const int GetDifficulty ()
 EnumDifficulty. Internally calls GameVariables.GetInt("g_difficulty")
 
void SetDifficulty (const int value)
 EnumDifficulty.
 
float GetGameSpeed ()
 
void SetGameSpeed (const float speed, const float blendSpeed)
 Sets the current GameSpeed. kPuppet and kPlayerWeapon are not effected by GameSpeed.
 
bool GetHubKeyInfo (const uint hubID, int &out nKeys, int &out remainingKeys, int &out keyBits)
 
bool SetHubKey (const uint hubID, int key)
 
void SpawnFx (const kStr &in fxPath, kActor@ source, const kVec3 &in velocity, const kVec3 &in origin, const kQuat &in rotation)
 
void SpawnFx (const kStr &in fxPath, kPuppet@ source, const kVec3 &in velocity, const kVec3 &in origin, const kQuat &in rotation)
 
void SpawnFx (const kStr &in fxPath, kActor@ source, const kVec3 &in origin, const kQuat &in rotation)
 
void SpawnFx (const kStr &in fxPath, kPuppet@ source, const kVec3 &in origin, const kQuat &in rotation)
 
void SpawnFx (const kStr &in fxPath, kActor@ source, const kVec3 &in origin, const float yaw, const float pitch)
 
void SpawnFx (const kStr &in fxPath, kPuppet@ source, const kVec3 &in origin, const float yaw, const float pitch)
 
void SpawnFx (const kStr &in fxPath, const kVec3 &in origin, const int sectorIndex)
 
kStr GetLocalizedText (const kStr &in key)
 
const bool AutomapEnabled ()
 is the automap displaying on screen
 
const bool AutomapDeactived ()
 
void AutomapToggle (const bool toggle)
 show/hide the automap.
 
void AutomapDeactive (const bool toggle)
 permanently deactivates the automap.
 
void AutomapCustom (const bool toggle)
 allow actors with custom automap colors to be drawn to the automap. (for mods)
 
void LifeForcePulse ()
 Shows the LifeForces on the HUD.
 
void LivesPulse ()
 Shows the Lives on the HUD.
 
void RunWalkPulse ()
 Shows the RunWalk graphic on the HUD.
 
void WeaponWheelPulse ()
 Shows the WeaponWheel on the HUD.
 
bool SetWeaponWheelPic (const int weapon, const kStr &in imagePath)
 
bool ClearWeaponWheelPic (const int weapon)
 
void SetLivesPic (const kStr &in imagePath)
 
void ClearLivesPic ()
 
void SetLifeForcePic (const kStr &in imagePath)
 
void ClearLifeForcePic ()
 
void MessageBox (const kStr &in msg1, const kStr &in msg2)
 
void ConfirmMenu (const kStr &in msg1, const kStr &in msg2)
 
void SaveMenu ()
 Opens the save game menu. Should always check if(PlayLoop.CanOpenSaveMenu())
 
void LoadMenu ()
 Opens the load game menu. Should always check if(PlayLoop.CanOpenPauseMenu())
 
void SetDamageFlash ()
 Shows the damage screen flash.
 
void SetPickupFlash ()
 Shows the pickup screen flash.
 
void SetArmorFlash ()
 Shows the armor damage screen flash.
 
const uint ConButtons ()
 EnumPlayerConButtons.
 
uint MenuButtons (void) const int64 GetTimestamp()
 
void GetDateAndTime (int &out seconds, int &out minutes, int &out hours, int &out day, int &out month, int &out year, kStr &out text)
 
void KillAllFx ()
 
void StopSounds ()
 
void AddText (const int id, const int font, const kStr &in text, const float x, const float y, const int edge=0, const float scale=1.0f, const bool center=false, const bool shadow=false, const int r=255, const int g=255, const int b=255, const int a=255, const int r2=255, const int g2=255, const int b2=255, const int a2=255)
 add custom text to the HUD. HUD size is 640x480 (pillar box). AddPic must be done in OnPostBeginLevel or later. if the id already exists then simply sets all it's variables.
 
bool SetTextMsg (const int id, const kStr &in text)
 
bool SetTextOrigin (const int id, const float x, const float y)
 
bool SetTextColor (const int id, const int r=255, const int g=255, const int b=255, const int a=255)
 
bool SetTextColors (const int id, const int r=255, const int g=255, const int b=255, const int a=255, const int r2=255, const int g2=255, const int b2=255, const int a2=255)
 
bool SetTextProps (const int id, const float scale, const int font=0, const int edge=0, const bool center=false, const bool shadow=false)
 Set the text scale, font, edge, center, shadow.
 
bool RemoveText (const int id)
 
void ClearText ()
 
void GetTextSize (const kStr &in text, const int font, const float scale, float &out width, float &out height)
 EnumGameFontType.
 
float GetHUDOffset (const bool user=false)
 if user is false will return the width to the edge of the screen (negative value). if true will return the width from the menu option "HUD Position".
 
bool AddPic (const int id, const kStr &in path, const float x, const float y, const float w, const float h, const int edge=0, const float s1=0.0f, const float t1=0.0f, const float s2=1.0f, const float t2=1.0f, const int r=255, const int g=255, const int b=255, const int a=255)
 add custom image to the HUD. HUD size is 640x480 (pillar box). AddPic must be done in OnPostBeginLevel or later. if the id already exists then simply sets all it's variables.
 
bool SetPicTex (const int id, const kStr &in path)
 
bool SetPicOrigin (const int id, const float x, const float y)
 
bool SetPicEdge (const int id, const int edge)
 edge 1=left side 2=right side (for convenience. You can set to 0 and offset x position with GetHUDOffset() as well)
 
bool SetPicAngle (const int id, const float angle)
 in rads
 
bool SetPicWH (const int id, const float w, const float h)
 
bool SetPicUV (const int id, const float s1=0.0f, const float t1=0.0f, const float s2=1.0f, const float t2=1.0f)
 
bool SetPicColor (const int id, const int r=255, const int g=255, const int b=255, const int a=255)
 
bool RemovePic (const int id)
 
void ClearPics (const bool clearImageCache=false)
 
bool & HideHealth ()
 Hide health display on the HUD.
 
bool & HideAmmo ()
 Hide ammo display on the HUD.
 
bool & HideLifeForces ()
 Hide LifeForces display on the HUD.
 
bool & HideRunWalk ()
 Hide RunWalk display on the HUD.
 
bool & HideLives ()
 Hide Lives display on the HUD.
 
bool & HideBossBar ()
 Hide BossBar display on the HUD.
 
bool & HideAirBar ()
 Hide AirBar display on the HUD.
 
bool & HideWeaponWheel ()
 Hide WeaponWheel display on the HUD.
 
bool & HideCrosshair ()
 Hide Crosshair display on the HUD.
 
bool & HideHelpMessages ()
 Hide HelpMessages display on the HUD.
 
bool & HideMessages ()
 Hide Messages display on the HUD.
 
bool & HideTimers ()
 Hide Timers display on the HUD.
 
const float GetExtraZFar ()
 
void SetExtraZFar (const float zfar)
 affects actors, ai, particles, fog and underwater. (works normally unlike the cvar r_zfarextent)
 
const float ShakeIntensity ()
 
kVec3 WorldToHUDPoint (const kVec3 &in origin)
 
bool SphereInView (const kVec3 &in origin, const float radius)
 
bool BoxInView (const kVec3 &in min, const kVec3 &in max)
 
const float ViewZFar ()
 
void SaveModFile (const kStr &in filename)
 make sure to call GameModFileData.Empty() before adding key/values to save
 
bool LoadModFile (const kStr &in filename)
 make sure to call GameModFileData.Empty() after you're done loading
 
bool LoadModDataFile (const kStr &in filename)
 Returns false if couldn't load file. Clears and Sets GameModFileData with the contents of the loaded file.
 
void SetNoModSelect (const bool bToggle=true)
 Disable the mod select menu when selecting new game for workshop mods only. (seta g_nomodselect "1")
 
void PlayMovie (const kStr &in filename, const bool skippable=true)
 Only .ogv files (replaces/adds .ogv extension to filename). Can not read from kpfs.
 
kStr GetActionBind (const int action, const bool first=true, const bool sort=true)
 Returns the key bind name of action. Returns empty string if nothing is bound.
 
kStr GetCommandBind (const kStr &in command, const bool first=true, const bool sort=true)
 Returns the key bind name of the console command. Returns empty string if nothing is bound.
 
bool IsJoystickActive ()
 if true the players last input was from a controller.
 
kStr GetInputImagePath (const kStr &in bindName)
 
bool InputImageExists (const kStr &in path)
 
void SetCursorHotPos (int x, int y)
 change the mouses cursors click point (default is 0, 0)
 
void SetModBindings (const bool show=true)
 Shows custom mod bindings in menu Bindings > Actions.
 
kStr PlayerName ()
 Returns "Player" if could not get name.
 
void MarkActorPersistentBit (const int actorIndex, const bool clear=false, const int hubID=-1, const int mapNum=0)
 an invalid hub or map uses current maps persistent data.
 
const bool IsActorPersistentMarked (const int actorIndex, const int hubID=-1, const int mapNum=0)
 an invalid hub or map uses current maps persistent data.
 
const bool GetPreventOpenPauseMenu ()
 
void SetPreventOpenPauseMenu (const bool value)
 
void ShowPauseMenu ()
 Should always check if(PlayLoop.CanOpenPauseMenu())
 
void OverrideSkyHeight (const float height)
 Set to 0 to stop overriding.
 
const int BossDamageScaler (const int difficulty, const int damage)
 
int PurgeUnusedModels ()
 Returns number of models freed.
 
void CenterMouse ()
 
kVec3 GetWorldSunLightColor ()
 
kVec3 GetWorldSunAmbientColor ()
 
kVec3 GetWorldSunDirection ()
 
void SetWorldSunLightColor (const float r, const float g, const float b)
 
void SetWorldSunAmbientColor (const float r, const float g, const float b)
 
void SetWorldSunDirection (const float x, const float y, const float z)
 
bool IsWorkshop ()
 Returns true if game was run through the steam workshop (ran with command arg -workshop)
 
void OverridePerPolyCollision (const int value)
 0=none, 1=force disable, 2=force enable
 
void DisableLegalText ()
 Removes the text at the bottom of the title screen.
 
void OverrideFogType (const int value)
 0=none, 1=force Radial, 2=force Plane
 
void ClearInterpolationOnGameObjects ()
 Clears Interpolation on all gameobjects and the camera if it's active.
 
void ShowDummyMenu (void)
 Actors OnMenuTick fucntion will now be processed. Call ClearDummyMenu to close the dummy menu.
 
void ClearDummyMenu (bool bClearAll=false)
 
void ToggleCursor (bool b=false)
 

Detailed Description

Definition at line 1516 of file t1_scriptAPI.cpp.

Member Function Documentation

◆ AddPic()

bool kGame::AddPic ( const int id,
const kStr &in path,
const float x,
const float y,
const float w,
const float h,
const int edge = 0,
const float s1 = 0.0f,
const float t1 = 0.0f,
const float s2 = 1.0f,
const float t2 = 1.0f,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255 )

add custom image to the HUD. HUD size is 640x480 (pillar box). AddPic must be done in OnPostBeginLevel or later. if the id already exists then simply sets all it's variables.

Parameters
edge1=left side 2=right side (for convenience. You can set to 0 and offset x position with GetHUDOffset() as well)

◆ AddText()

void kGame::AddText ( const int id,
const int font,
const kStr &in text,
const float x,
const float y,
const int edge = 0,
const float scale = 1.0f,
const bool center = false,
const bool shadow = false,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255,
const int r2 = 255,
const int g2 = 255,
const int b2 = 255,
const int a2 = 255 )

add custom text to the HUD. HUD size is 640x480 (pillar box). AddPic must be done in OnPostBeginLevel or later. if the id already exists then simply sets all it's variables.

Parameters
fontEnumGameFontType
edge1=left side 2=right side (for convenience. You can set to 0 and offset x position with GetHUDOffset() as well)

◆ AutomapCustom()

void kGame::AutomapCustom ( const bool toggle)

allow actors with custom automap colors to be drawn to the automap. (for mods)

◆ AutomapDeactive()

void kGame::AutomapDeactive ( const bool toggle)

permanently deactivates the automap.

◆ AutomapDeactived()

const bool kGame::AutomapDeactived ( )

◆ AutomapEnabled()

const bool kGame::AutomapEnabled ( )

is the automap displaying on screen

◆ AutomapToggle()

void kGame::AutomapToggle ( const bool toggle)

show/hide the automap.

◆ BossDamageScaler()

const int kGame::BossDamageScaler ( const int difficulty,
const int damage )

◆ BoxInView()

bool kGame::BoxInView ( const kVec3 &in min,
const kVec3 &in max )

◆ CallDelayedMapScript() [1/2]

void kGame::CallDelayedMapScript ( const int scriptID,
kActor@ instigator,
const float delay )

even with delay 0 it will be called when map scripts update

◆ CallDelayedMapScript() [2/2]

void kGame::CallDelayedMapScript ( const kStr &in funcName,
kActor@ instigator,
const float delay )

even with delay 0 it will be called when map scripts update

◆ CallMapScript()

void kGame::CallMapScript ( const int scriptID,
kActor@ instigator )

Use to call map script right away.

◆ CenterMouse()

void kGame::CenterMouse ( )

◆ ChangeMap()

void kGame::ChangeMap ( const kStr &in path)

◆ ClearDummyMenu()

void kGame::ClearDummyMenu ( bool bClearAll = false)

◆ ClearInterpolationOnGameObjects()

void kGame::ClearInterpolationOnGameObjects ( )

Clears Interpolation on all gameobjects and the camera if it's active.

◆ ClearLifeForcePic()

void kGame::ClearLifeForcePic ( )

◆ ClearLivesPic()

void kGame::ClearLivesPic ( )

◆ ClearPics()

void kGame::ClearPics ( const bool clearImageCache = false)

◆ ClearText()

void kGame::ClearText ( )

◆ ClearWeaponWheelPic()

bool kGame::ClearWeaponWheelPic ( const int weapon)

◆ ConButtons()

const uint kGame::ConButtons ( )

◆ ConfirmMenu()

void kGame::ConfirmMenu ( const kStr &in msg1,
const kStr &in msg2 )
Parameters
msg1top line
msg2bottom line
// Usage:
Game.ConfirmMenu("Confirm This", "Is that correct?");
// Then check for result on Tick:
int result;
GameVariables.GetInt("ConfirmMenuResult", result);
switch(result)
{
case 1:
Sys.Print("Selected No");
GameVariables.SetValue("ConfirmMenuResult", "0");
break;
case 2:
Sys.Print("Selected Yes");
GameVariables.SetValue("ConfirmMenuResult", "0");
break;
default: // There's no ConfirmMenuResult waiting
break;
}
kSys Sys
kGame Game
kDict GameVariables

◆ DisableLegalText()

void kGame::DisableLegalText ( )

Removes the text at the bottom of the title screen.

◆ GetActionBind()

kStr kGame::GetActionBind ( const int action,
const bool first = true,
const bool sort = true )

Returns the key bind name of action. Returns empty string if nothing is bound.

Parameters
actionEnumInputActions
firstif is false returns a string of all the bound keys separated by the ; character.
sortsortsbinds by keyboard, mouse, and controller binds. depending on if controller or keyboard is active.

◆ GetCommandBind()

kStr kGame::GetCommandBind ( const kStr &in command,
const bool first = true,
const bool sort = true )

Returns the key bind name of the console command. Returns empty string if nothing is bound.

Parameters
commandthe name of the console command.
"weapon 0" to "weapon 13"
"automap"
"changeammotype"
"runwalktoggle"
"menu_up"
"menu_down"
"menu_left"
"menu_right"
"*menu_select"
"menu_back"
"menu_cancel"
"menu_activate"
firstif is false returns a string of all the bound keys separated by the ; character.
sortsorts binds by keyboard, mouse, and controller binds. depending on if controller or keyboard is active.

◆ GetCurrentMapID()

const int kGame::GetCurrentMapID ( )

◆ GetDateAndTime()

void kGame::GetDateAndTime ( int &out seconds,
int &out minutes,
int &out hours,
int &out day,
int &out month,
int &out year,
kStr &out text )

◆ GetDifficulty()

const int kGame::GetDifficulty ( )

EnumDifficulty. Internally calls GameVariables.GetInt("g_difficulty")

◆ GetExtraZFar()

const float kGame::GetExtraZFar ( )

◆ GetGameSpeed()

float kGame::GetGameSpeed ( )

◆ GetHubKeyInfo()

bool kGame::GetHubKeyInfo ( const uint hubID,
int &out nKeys,
int &out remainingKeys,
int &out keyBits )

◆ GetHUDOffset()

float kGame::GetHUDOffset ( const bool user = false)

if user is false will return the width to the edge of the screen (negative value). if true will return the width from the menu option "HUD Position".

◆ GetInputImagePath()

kStr kGame::GetInputImagePath ( const kStr &in bindName)

◆ GetLocalizedText()

kStr kGame::GetLocalizedText ( const kStr &in key)

◆ GetMapIDFromName()

const int kGame::GetMapIDFromName ( const kStr &in mapName)

This returns the mapID from the mapName.

◆ GetMapNumberFromName()

const int kGame::GetMapNumberFromName ( const kStr &in mapName)

This returns the HUB number NOT the map number. mapName is the HUB name such as "Map_Jungle".

◆ GetPreventOpenPauseMenu()

const bool kGame::GetPreventOpenPauseMenu ( )

◆ GetTextSize()

void kGame::GetTextSize ( const kStr &in text,
const int font,
const float scale,
float &out width,
float &out height )

◆ GetWorldSunAmbientColor()

kVec3 kGame::GetWorldSunAmbientColor ( )

◆ GetWorldSunDirection()

kVec3 kGame::GetWorldSunDirection ( )

◆ GetWorldSunLightColor()

kVec3 kGame::GetWorldSunLightColor ( )

◆ HaltMapScript()

void kGame::HaltMapScript ( const int scriptID)

◆ HideAirBar()

bool & kGame::HideAirBar ( )

Hide AirBar display on the HUD.

◆ HideAmmo()

bool & kGame::HideAmmo ( )

Hide ammo display on the HUD.

◆ HideBossBar()

bool & kGame::HideBossBar ( )

Hide BossBar display on the HUD.

◆ HideCrosshair()

bool & kGame::HideCrosshair ( )

Hide Crosshair display on the HUD.

◆ HideHealth()

bool & kGame::HideHealth ( )

Hide health display on the HUD.

◆ HideHelpMessages()

bool & kGame::HideHelpMessages ( )

Hide HelpMessages display on the HUD.

◆ HideLifeForces()

bool & kGame::HideLifeForces ( )

Hide LifeForces display on the HUD.

◆ HideLives()

bool & kGame::HideLives ( )

Hide Lives display on the HUD.

◆ HideMessages()

bool & kGame::HideMessages ( )

Hide Messages display on the HUD.

◆ HideRunWalk()

bool & kGame::HideRunWalk ( )

Hide RunWalk display on the HUD.

◆ HideTimers()

bool & kGame::HideTimers ( )

Hide Timers display on the HUD.

◆ HideWeaponWheel()

bool & kGame::HideWeaponWheel ( )

Hide WeaponWheel display on the HUD.

◆ InputImageExists()

bool kGame::InputImageExists ( const kStr &in path)

◆ IsActorPersistentMarked()

const bool kGame::IsActorPersistentMarked ( const int actorIndex,
const int hubID = -1,
const int mapNum = 0 )

an invalid hub or map uses current maps persistent data.

◆ IsJoystickActive()

bool kGame::IsJoystickActive ( )

if true the players last input was from a controller.

◆ IsTactilePlaying() [1/2]

bool kGame::IsTactilePlaying ( int vibHandle)

◆ IsTactilePlaying() [2/2]

bool kGame::IsTactilePlaying ( int vibHandle,
const kStr &in path )

◆ IsWorkshop()

bool kGame::IsWorkshop ( )

Returns true if game was run through the steam workshop (ran with command arg -workshop)

◆ KillAllFx()

void kGame::KillAllFx ( )

◆ LifeForcePulse()

void kGame::LifeForcePulse ( )

Shows the LifeForces on the HUD.

◆ LivesPulse()

void kGame::LivesPulse ( )

Shows the Lives on the HUD.

◆ LoadMenu()

void kGame::LoadMenu ( )

Opens the load game menu. Should always check if(PlayLoop.CanOpenPauseMenu())

◆ LoadModDataFile()

bool kGame::LoadModDataFile ( const kStr &in filename)

Returns false if couldn't load file. Clears and Sets GameModFileData with the contents of the loaded file.

◆ LoadModFile()

bool kGame::LoadModFile ( const kStr &in filename)

make sure to call GameModFileData.Empty() after you're done loading

◆ MarkActorPersistentBit()

void kGame::MarkActorPersistentBit ( const int actorIndex,
const bool clear = false,
const int hubID = -1,
const int mapNum = 0 )

an invalid hub or map uses current maps persistent data.

◆ MenuButtons()

uint kGame::MenuButtons ( void ) const

◆ MessageBox()

void kGame::MessageBox ( const kStr &in msg1,
const kStr &in msg2 )

◆ MusicIsPaused()

bool kGame::MusicIsPaused ( )

◆ MusicIsPlaying()

bool kGame::MusicIsPlaying ( )

◆ MusicPitch()

void kGame::MusicPitch ( const float pitch)

◆ MusicSong()

kStr kGame::MusicSong ( )

◆ OverrideFogType()

void kGame::OverrideFogType ( const int value)

0=none, 1=force Radial, 2=force Plane

◆ OverridePerPolyCollision()

void kGame::OverridePerPolyCollision ( const int value)

0=none, 1=force disable, 2=force enable

◆ OverrideSkyHeight()

void kGame::OverrideSkyHeight ( const float height)

Set to 0 to stop overriding.

◆ PauseMusic()

void kGame::PauseMusic ( )

◆ PlayerName()

kStr kGame::PlayerName ( )

Returns "Player" if could not get name.

◆ PlayMovie()

void kGame::PlayMovie ( const kStr &in filename,
const bool skippable = true )

Only .ogv files (replaces/adds .ogv extension to filename). Can not read from kpfs.

◆ PlayMusic()

void kGame::PlayMusic ( const kStr &in path,
const bool loop )

◆ PlaySound()

void kGame::PlaySound ( const kStr &in path)

◆ PlaySoundID()

void kGame::PlaySoundID ( const int soundID)

◆ PlayTactile()

int kGame::PlayTactile ( const kStr &in path,
int channel,
int pos )

Start controller vibration from tactile sound file. Returns a handle.

Parameters
paththe path to the .bnvib file
channelkexVibrationPlayer::channel_e
poskexVibrationPlayer::position_e

◆ Print()

void kGame::Print ( const kStr &in text,
const int ticks = 120 )

Print a message to the HUD on the next line.

Parameters
text
ticksnumber of ticks message will be visible. 60 ticks = 1 second.

◆ PrintHelp()

void kGame::PrintHelp ( const kStr &in text,
const bool endGame = false )

◆ PrintLine()

void kGame::PrintLine ( const kStr &in text,
const int lineNumber,
const int ticks = 120 )

Print a message to the HUD.

Parameters
text
lineNumbermust be in range 0..7
ticksnumber of ticks message will be visible. 60 ticks = 1 second.

◆ PurgeUnusedModels()

int kGame::PurgeUnusedModels ( )

Returns number of models freed.

◆ RemovePic()

bool kGame::RemovePic ( const int id)

◆ RemoveText()

bool kGame::RemoveText ( const int id)

◆ RemoveTimer()

void kGame::RemoveTimer ( )

◆ Restart()

void kGame::Restart ( )

◆ ResumeMusic()

void kGame::ResumeMusic ( )

◆ RunWalkPulse()

void kGame::RunWalkPulse ( )

Shows the RunWalk graphic on the HUD.

◆ SaveMenu()

void kGame::SaveMenu ( )

Opens the save game menu. Should always check if(PlayLoop.CanOpenSaveMenu())

◆ SaveModFile()

void kGame::SaveModFile ( const kStr &in filename)

make sure to call GameModFileData.Empty() before adding key/values to save

◆ SetArmorFlash()

void kGame::SetArmorFlash ( )

Shows the armor damage screen flash.

◆ SetCursorHotPos()

void kGame::SetCursorHotPos ( int x,
int y )

change the mouses cursors click point (default is 0, 0)

◆ SetDamageFlash()

void kGame::SetDamageFlash ( )

Shows the damage screen flash.

◆ SetDifficulty()

void kGame::SetDifficulty ( const int value)

EnumDifficulty.

◆ SetExtraZFar()

void kGame::SetExtraZFar ( const float zfar)

affects actors, ai, particles, fog and underwater. (works normally unlike the cvar r_zfarextent)

◆ SetGameSpeed()

void kGame::SetGameSpeed ( const float speed,
const float blendSpeed )

Sets the current GameSpeed. kPuppet and kPlayerWeapon are not effected by GameSpeed.

Parameters
speed0..1
blendSpeedmust be >= 1.0. This is the time it takes to lerp from current speed to the new speed. (lerp time = 1.0 / blendSpeed)

◆ SetHubKey()

bool kGame::SetHubKey ( const uint hubID,
int key )

◆ SetLifeForcePic()

void kGame::SetLifeForcePic ( const kStr &in imagePath)

◆ SetLivesPic()

void kGame::SetLivesPic ( const kStr &in imagePath)

◆ SetModBindings()

void kGame::SetModBindings ( const bool show = true)

Shows custom mod bindings in menu Bindings > Actions.

◆ SetNoModSelect()

void kGame::SetNoModSelect ( const bool bToggle = true)

Disable the mod select menu when selecting new game for workshop mods only. (seta g_nomodselect "1")

◆ SetPicAngle()

bool kGame::SetPicAngle ( const int id,
const float angle )

in rads

◆ SetPicColor()

bool kGame::SetPicColor ( const int id,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255 )

◆ SetPicEdge()

bool kGame::SetPicEdge ( const int id,
const int edge )

edge 1=left side 2=right side (for convenience. You can set to 0 and offset x position with GetHUDOffset() as well)

◆ SetPickupFlash()

void kGame::SetPickupFlash ( )

Shows the pickup screen flash.

◆ SetPicOrigin()

bool kGame::SetPicOrigin ( const int id,
const float x,
const float y )

◆ SetPicTex()

bool kGame::SetPicTex ( const int id,
const kStr &in path )

◆ SetPicUV()

bool kGame::SetPicUV ( const int id,
const float s1 = 0.0f,
const float t1 = 0.0f,
const float s2 = 1.0f,
const float t2 = 1.0f )

◆ SetPicWH()

bool kGame::SetPicWH ( const int id,
const float w,
const float h )

◆ SetPreventOpenPauseMenu()

void kGame::SetPreventOpenPauseMenu ( const bool value)

◆ SetTextColor()

bool kGame::SetTextColor ( const int id,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255 )

◆ SetTextColors()

bool kGame::SetTextColors ( const int id,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255,
const int r2 = 255,
const int g2 = 255,
const int b2 = 255,
const int a2 = 255 )

◆ SetTextMsg()

bool kGame::SetTextMsg ( const int id,
const kStr &in text )

◆ SetTextOrigin()

bool kGame::SetTextOrigin ( const int id,
const float x,
const float y )

◆ SetTextProps()

bool kGame::SetTextProps ( const int id,
const float scale,
const int font = 0,
const int edge = 0,
const bool center = false,
const bool shadow = false )

Set the text scale, font, edge, center, shadow.

Parameters
fontEnumGameFontType
edge1=left side 2=right side (for convenience. You can set to 0 and offset x position with GetHUDOffset() as well)

◆ SetWeaponWheelPic()

bool kGame::SetWeaponWheelPic ( const int weapon,
const kStr &in imagePath )

◆ SetWorldSunAmbientColor()

void kGame::SetWorldSunAmbientColor ( const float r,
const float g,
const float b )

◆ SetWorldSunDirection()

void kGame::SetWorldSunDirection ( const float x,
const float y,
const float z )

◆ SetWorldSunLightColor()

void kGame::SetWorldSunLightColor ( const float r,
const float g,
const float b )

◆ ShakeIntensity()

const float kGame::ShakeIntensity ( )

◆ ShowDummyMenu()

void kGame::ShowDummyMenu ( void )

Actors OnMenuTick fucntion will now be processed. Call ClearDummyMenu to close the dummy menu.

◆ ShowMainMenu()

void kGame::ShowMainMenu ( const bool mouseCenter = true)

◆ ShowPauseMenu()

void kGame::ShowPauseMenu ( )

Should always check if(PlayLoop.CanOpenPauseMenu())

◆ SpawnFx() [1/7]

void kGame::SpawnFx ( const kStr &in fxPath,
const kVec3 &in origin,
const int sectorIndex )

◆ SpawnFx() [2/7]

void kGame::SpawnFx ( const kStr &in fxPath,
kActor@ source,
const kVec3 &in origin,
const float yaw,
const float pitch )

◆ SpawnFx() [3/7]

void kGame::SpawnFx ( const kStr &in fxPath,
kActor@ source,
const kVec3 &in origin,
const kQuat &in rotation )

◆ SpawnFx() [4/7]

void kGame::SpawnFx ( const kStr &in fxPath,
kActor@ source,
const kVec3 &in velocity,
const kVec3 &in origin,
const kQuat &in rotation )

◆ SpawnFx() [5/7]

void kGame::SpawnFx ( const kStr &in fxPath,
kPuppet@ source,
const kVec3 &in origin,
const float yaw,
const float pitch )

◆ SpawnFx() [6/7]

void kGame::SpawnFx ( const kStr &in fxPath,
kPuppet@ source,
const kVec3 &in origin,
const kQuat &in rotation )

◆ SpawnFx() [7/7]

void kGame::SpawnFx ( const kStr &in fxPath,
kPuppet@ source,
const kVec3 &in velocity,
const kVec3 &in origin,
const kQuat &in rotation )

◆ SphereInView()

bool kGame::SphereInView ( const kVec3 &in origin,
const float radius )

◆ StartTimer()

void kGame::StartTimer ( )

◆ StopAllTactile()

void kGame::StopAllTactile ( )

◆ StopMusic()

void kGame::StopMusic ( )

◆ StopSounds()

void kGame::StopSounds ( )

◆ StopTactile()

void kGame::StopTactile ( int vibHandle)

◆ StopTimer()

void kGame::StopTimer ( )

◆ ToggleCursor()

void kGame::ToggleCursor ( bool b = false)

◆ ViewZFar()

const float kGame::ViewZFar ( )

◆ WeaponWheelPulse()

void kGame::WeaponWheelPulse ( )

Shows the WeaponWheel on the HUD.

◆ WorldToHUDPoint()

kVec3 kGame::WorldToHUDPoint ( const kVec3 &in origin)