563 int find(
const T&in value)
const;
570 int find(uint startAt,
const T&in value)
const;
588 funcdef
bool less(
const ?&in a,
const ?&in b);
589 void sort(
less&in, uint startAt = 0, uint count = uint ( - 1 ));
637 float Diff(
const float rads)
const;
673 void Set(
const float x,
const float y,
const float z);
730 void GetAngles(
float&out yaw,
float&out pitch,
float&out roll);
732 void Set(
const float x,
const float y,
const float z,
const float w);
754 kPlane(
const float a,
const float b,
const float c,
const float d);
802 void RGBToHSV(
float&out hue,
float&out sat,
float&out result)
const;
804 void RGBToHSL(
float&out hue,
float&out sat,
float&out lit)
const;
892 bool GetFloat(
const kStr&in key,
float&out floatResult,
const float defaultValue = 0);
893 bool GetInt(
const kStr&in key,
int&out intResult,
const int defaultValue = 0);
894 bool GetBool(
const kStr&in key,
bool&out boolResult,
const bool defaultValue =
false);
906 bool GetFloat(
const kStr&in key,
float&out floatResult,
const float defaultValue = 0);
907 bool GetInt(
const kStr&in key,
int&out intResult,
const int defaultValue = 0);
908 bool GetBool(
const kStr&in key,
bool&out boolResult,
const bool defaultValue =
false);
947 void SetRotationOffset(
const int nodeIndex,
const float rads,
const float x,
const float y,
const float z);
951 void HideSection(
const int nodeIndex,
const int section,
const bool hide);
993 void GetMorphFrame(
int&out frame,
int&out nextFrame,
int&out maxFrames,
float&out time)
const;
1000 void Blend(
const int animID,
float speed,
float blend,
int flags);
1162 void RunAction(
const int funcID,
const float w = 0.0f,
const float x = 0.0f,
const float y = 0.0f,
const float z = 0.0f);
1209 void FireProjectile(
const kStr&in fxPath,
const float x,
const float y,
const float z,
const bool adjustToPerspective =
false);
1296 kActor@
Spawn(
const int actorID,
const float x,
const float y,
const float z,
const float yaw,
const int sector = - 1);
1297 kActor@
Spawn(
const kStr&in actorName,
const float x,
const float y,
const float z,
const float yaw,
const int sector = - 1);
1310 void SetRotationTrack(
const int view,
const float startAngle,
const float destAngle,
const float startDist,
const float destDist,
const float startEyeZOffset = 0,
const float destEyeZOffset = 0,
const float startFocusZOffset = 0,
const float destFocusZOffset = 0);
1316 void AutoPlayBlendTrack(
const int viewA,
const int viewB,
const int viewC,
const float speed,
const int lerpType);
1505 void GetSectorLinks(
const int sectorIndex,
int&out sectorIndex1,
int&out sectorIndex2,
int&out sectorIndex3)
const;
1553 void PrintLine(
const kStr&in text,
const int lineNumber,
const int ticks = 120);
1579 bool GetHubKeyInfo(
const uint hubID,
int&out nKeys,
int&out remainingKeys,
int&out keyBits);
1641 const int64 GetTimestamp();
1642 void GetDateAndTime(
int&out seconds,
int&out minutes,
int&out hours,
int&out day,
int&out month,
int&out year,
kStr&out text);
1652 void AddText(
const int id,
const int font,
const kStr &in text,
const float x,
const float y,
1653 const int edge = 0,
const float scale = 1.0f,
const bool center =
false,
const bool shadow =
false,
1654 const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255,
1655 const int r2 = 255,
const int g2 = 255,
const int b2 = 255,
const int a2 = 255);
1658 bool SetTextColor(
const int id,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255);
1659 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);
1666 bool SetTextProps(
const int id,
const float scale,
const int font = 0,
const int edge = 0,
const bool center =
false,
const bool shadow =
false);
1669 void GetTextSize(
const kStr &in text,
const int font,
const float scale,
float &out width,
float &out height);
1677 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,
1678 const float s1 = 0.0f,
const float t1 = 0.0f,
const float s2 = 1.0f,
const float t2 = 1.0f,
1679 const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255);
1684 bool SetPicWH(
const int id,
const float w,
const float h);
1685 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);
1686 bool SetPicColor(
const int id,
const int r = 255,
const int g = 255,
const int b = 255,
const int a = 255);
1784 const bool HasAmmo(
const int weaponID,
const bool checkAlt =
true)
const;
1790 bool GiveWeapon(
const int weaponID,
const int ammo,
const bool switchNewWeapon =
true);
1795 void Victory(
const int warpActorID = - 1,
const int mapID = - 1);
1804 bool GiveAmmo(
const int weapon,
const int amount,
const bool altAmmo);
1852 float IncMax(
const float val,
const float inc,
const float dest);
1857 float NLerp(
const float a,
const float b,
const float t);
1858 float Accelerate(
const float val,
const float accel,
const float max);
1862 int Clamp(
const int i,
const int min,
const int max);
1863 float Clampf(
const float f,
const float min,
const float max);
1864 float Lerp(
float start,
const float end,
const float time);
1867 float SmoothStep(
const float from,
const float to,
const float t);
1869 float Min(
const float a,
const float b);
1870 float Max(
const float a,
const float b);
1873 const float pi = 3.1415927f;
enum EnumPlayerFlags AIF_TELEPORTIN
playing teleport in animation
enum EnumPlayerFlags AIF_FIRSTATTACK
enum EnumPlayerFlags AIF_FEIGNDEATH
kColor kexColor_ViridisScale(float v)
Not used. (garbage from kexengine)
EnumCameraLerpType
Lerp type when doing AutoPlayPositionTrack, AutoPlayRotationTrack, or AutoPlayBlendTrack....
@ CMLT_COSINE
time will never be higher than speed. time = CosTween(time * (1.0f / speed));
@ CMLT_LINEARLOOP
time is set to time / speed. If time is > 1.0 then time -= 1.0
@ CMLT_COSINE_POW
time will never be higher than speed. time = CosTween(Pow(time * (1.0f / speed), 3));
@ CMLT_LINEAR
time is set to time / speed.
@ CMLT_NONE
time is set to time / speed.
const float GAME_DELTA_TIME
enum EnumPlayerFlags AIF_GOBACKTOLEASH
kColor kexColor_Tab20(uint i)
Not used. (garbage from kexengine)
enum EnumGameButtonEvents DIFFICULTY_EASY
@ ASF3_MAKESPAWNANIMVISIBLE
clears actor flags: ~(AF_HIDDEN|AF_DISABLED)
@ ASF3_PROJECTILEATTACK9
Demon chest Hadoken (anim_aiRangeAttack9)
@ ASF3_NOTHINKER
AI will not function. Actores will not update movement. Actors OnBeginLevel will set their animation ...
@ ASF3_PLAYTRIGGERANIMONCE
MarkPersistentBit(false) when activated.
@ ASF3_KILLOUTSIDEOFVIEW
NOT USED.
@ ASF3_PROJECTILEATTACK10
High Priest Lightning Red Flames (anim_aiRangeAttack10)
@ ASF3_RETURNWARP
Used in portal scripts.
@ ASF3_WALKINSTRAIGHTLINE
Set animation to Blend(ANIM_WALKING, (m_animSpeed * m_animScalar), 10, ANF_LOOP|ANF_ROOTMOTION); and ...
@ ASF3_AVOIDPLAYERS2
NOT USED.
@ ASF3_REGENERATEFROMSTART
Regen from starting position.
@ ASF3_NOVIOLENTDEATH
ANIM_AIDEATHSTAND and ANIM_DEATHSTANDALT will not play when kAI is killed.
@ ASF3_NODRAWONCAMERA
Will not draw this actor when viewing from camera unless camera flags has CMF_SHOW_HIDDEN_OBJECTS.
enum EnumPlayerFlags AIF_HEARDLOUDNOISE
kColor kexColor_Tab20Light(uint i)
Not used. (garbage from kexengine)
@ CRF_MESH
made contact with a static object
@ CRF_ADJUST
z-axis was adjusted (ceiling or floor)
@ CRF_FLOOR
made contact with a floor
@ CRF_WALL
made contact with an edge (sector edge that isn't linked to another sector)
@ CRF_CEILING
made contact with a ceiling
@ CRF_WALLRADIUS
made contact with an edge during the wall radius collision test
@ CRF_OBJECT
made contact with an actor
enum EnumPlayerFlags AIF_TELEPORTMOVESLOW
chasing while underground
kDict GameModFileData
Use with Game.SaveModFile and Game.LoadModFile.
@ CF_HITSCAN
performs a single-pass trace. useful for hitscans
@ CF_CHECKLINKEDBRIDGES
do extensive checks against overlapping bridge sectors
@ CF_NOCLIPTARGETACTORS
don't clip actors that are targeted by moving object
@ CF_ALLOWCRAWL
collide with sectors flagged as crawlable
@ CF_STANDONOBJECTS
allow vertical clipping of objects
@ CF_ALLOWRESTRICTEDAREAS
don't collide with edges belonging to a restricted sector
@ CF_COLLIDEFLOORS
project and clip movement against non-flat floors
@ CF_USEWALLRADIUS
clip and project movement away from walls based on wall radius
@ CF_DROPOFF
allows passing through platforms or ledges
@ CF_NOCLIPSTATICS
don't collide with static models
@ CF_ALLOWCLIMB
collide with sectors flagged as climbable
@ CF_NOEXITWATER
block all edges that links to a non-water sector
@ CF_WALKWALLS
don't restrict movement to steep slopes
@ CF_NOCOLLIDEFUNC
don't invoke the OnCollide callback on the moving object
@ CF_COLLIDETRIGGERS
block edges belonging to a trigger
@ CF_NOEXITWALLS
clip all edges, regardless if they link to another sector or not
@ CF_COLLIDECORPSES
clip against actors flagged as dead
@ CF_POLYCOLLISION
clip movement against all model polygons of an object
@ CF_NOSTEPDOWN
don't clamp z-axis when walking down slopes
@ CF_NOENTERWATER
block all edges that links to a water sector
@ CF_NOCLIPACTORS
don't collide with dynamic objects/actors
@ CF_COLLIDEHEIGHT
clip against ceilings
@ CF_COLLIDECLIFFS
collide with non-walkable floors
@ CF_NOFLOORADJUST
don't keep z-axis above floor plane
@ CF_NOCEILINGADJUST
don't keep z-axis below ceiling plane
@ CF_NOSLOPESTEP
don't project z-axis movement along slopes
@ CF_IGNOREBLOCKERS
don't clip edges belonging to blocking sectors
@ CF_CLIPEDGES
clip movement against edges that don't link to sectors
@ CF_COLLIDEWATER
clip movement against the water surface
@ CF_GREASESLIDEOBJECTS
always keep movement projected away from collided objects
enum EnumGameButtonEvents DIFFICULTY_HARD
const float GAME_FRAME_UNIT
enum EnumPlayerFlags AIF_TELEPORTING
in teleport state. ignore all chase logic
enum EnumPlayerFlags AIF_ATTACKING
playing an attacking animation
kexLocPlatform_e
< Not used (garbage included automatically from kexengine)
@ LocPlatform_PlayStation5
@ LocPlatform_WindowsStore
@ LocPlatform_PlayStation4
@ LocPlatform_UserPlatformCount
@ LocPlatform_FirstUserPlatform
@ WLT_BETWEEN
In water sector and floating above the water.
@ WLT_INVALID
Not in water sectors.
@ WLT_OVER
In water sector but over the water height.
@ WLT_UNDER
In water sector and under the water height.
kColor kexColor_Random()
Not used. (garbage from kexengine)
enum EnumPlayerFlags AIF_TELEPORTAWAY
playing teleport out animation
@ IT_FLESH_UNDEAD
AKA IT_FLESH_WATER.
enum EnumPlayerFlags AIF_NOCHASE
disable chase logic
enum EnumPlayerFlags AIF_REGENERATE
enum EnumPlayerFlags AIF_RUNNING
Is playing running animation.
enum EnumPlayerFlags AIF_REGENANIMDELAY
enum EnumPlayerFlags AIF_HEARDQUIETNOISE
enum EnumPlayerFlags AIF_DAMAGEPANIC
become aggressive when target is outside it's active threshold (good for forcing AI to attack their t...
enum EnumPlayerFlags AIF_SEETARGET
kColor kexColor_LerpRGB(const kColor &in from, const kColor &in to, float time)
Not used. (garbage from kexengine)
@ WS_FIREUNDERWATER
NOT USED.
@ WS_HOLDSTER
Set when dead (with no death cinematic) or when climbing. Should set weapon anim to ANIM_WEAPONSWAPOU...
@ WS_DISCHARGE
set after OnEndFire is called. If was in WS_FIRE state and not pressing the Attack button.
kColor kexColor_FromHSL(float hue, float sat, float lit)
Not used. (garbage from kexengine)
@ PF_NOTOUCH
disables invoking onTouch callbacks
@ PF_GOD
Is reset when level beings.
@ PF_FALLINGDEATHPIT
currently falling in a death pit. Cleared after level begins.
@ PF_WEAPONSTEAL
on when campaigner steals weapon
@ PF_JUMPING
is jumping (moving up). flag is off when reached max jump height or let go of jump button.
@ PF_FIREDPROJECTILE
set when FireProjectile is called. Cleared OnTick if weapon is not in WS_FIRE state and player is not...
@ PF_NOSECTORMUSIC
disables music changes when changing sectors
@ PF_INWARPAREA
in sector area with AAF_TELEPORT flag.
@ PF_PREVENTDEATHCAM
will stop the death cinematic or the deadAnimView from triggering when the player dies.
const float GAME_FRAME_TIME
enum EnumPlayerFlags AIF_WAITFORCYCLE
prevent other animations from interrupting until the current one finishes
@ AF_NOMOVEMENT
will not do collision movement
@ AF_CLIMBWALLS
allows entering of wall sectors
@ AF_REMOVEONCOMPLETION
remove after finishing a special animation
@ AF_SNAPTOFLOOR
adjust z-axis to floor on spawn
@ AF_ALWAYSACTIVE
never sleep or go dormant
@ AF_HIDDEN
don't draw but continue updating. can't be collided
@ AF_TRIGGERSTUFF
NOT USED.
@ AF_COLLIDEDWITHWALL
collided with an edge. cleared at every OnTick call
@ AF_WOUNDEDMORTALLY
if on this actor will drop a mortal wound because it was hit by a super arrow shot
@ AF_CANBETOUCHED
allow invoking the OnTouch callback
@ AF_IGNORESOUNDEVENTS
don't call kexAnimState::Action_PlaySound
@ AF_DISABLED
don't update animations
@ AF_DEAD
actor is dead. handle special cases for collision
@ AF_CASTSHADOW
can cast a simple shadow
@ AF_ALLOWTINYENEMYCHEAT
affected by tiny enemy game cheat
@ AF_SOLID
Can be collided.
@ AF_STAYINWATER
can't exit water sectors
@ AF_ALIGNTOFLOOR
rotate along slopes
@ AF_INVINCIBLE
will not recieve damage. OnDamage and OnDeath are never called
@ AF_AVOIDWATER
clip against edges linking to water sectors
@ AF_NONSHOOTABLE
NOT USED. suppose to be: can't be shot at (ignores hitscans)
@ AF_FLOATINWATERONDEATH
rise to the surface while dead
@ AF_ACTIVATED
was triggered
@ AF_NOBLOOD
don't spawn particles flagged as blood
@ AF_ENTEREDAREAEVENT
just entered a trigger sector
@ AF_DORMANT
if on then is asleep (won't be updated onTick) else is awake
@ AF_TRIGGERANIMATION
play special animation on trigger/spawn
@ AF_TRIGGERNAIMDELAY
delay a bit before starting special animation
@ AF_HOLDTRIGGERANIM
pause special animation until triggered (is also invincible)
@ AF_STATIONARY
Sniper. don't update the animation's root motion.
@ AF_FULLVOLUME
all sounds coming from this actor will be heard at full volume
@ ASF1_CASTSHADOW
sets AF_CASTSHADOW on SetSpawnParams
@ ASF1_FLOATINWATERONDEATH
kAI will float up to the top of the water when they are dead
@ ASF1_RANDOMFEIGNDEATH
NOT USED.
@ ASF1_SCREENSHAKE
Used in floor mover scripts to shake screen.
@ ASF1_PROJECTILEATTACK2
Pistol Fire (anim_aiRangeAttack2)
@ ASF1_KAMIKAZE
if has no target then targets player and sets agitation to 300
@ ASF1_AVOIDPLAYERS
NOT USED.
@ ASF1_TELEPORTAVOIDCLIFFS
@ ASF1_NOWALLCOLLISION
NOT USED.
@ ASF1_FLOCKER
flocks to a leader kAI
@ ASF1_CANNOTCAUSEAFIGHT
if another actor was damaged by this actor with this flag set then other actor will not target this a...
@ ASF1_USEWEAKATTACKS
anim_aiAltMelee1
@ ASF1_LEADER
Flocker ai run toward Leaders to get attention.
@ ASF1_RANDOMRESURRECTION
NOT USED.
@ ASF1_DIEONEXPLOSION
NOT USED.
@ ASF1_PROJECTILEATTACK1
High Priest Flame Attack (anim_aiRangeAttack1)
@ ASF1_NOREPEATEXPLOSION
NOT USED.
@ ASF1_EXPLOSIONDEATH
NOT USED.
@ ASF1_AVOIDWATER
sets AF_AVOIDWATER on SetSpawnParams
@ ASF1_MELTONDEATH
allows melt effect and regeneration
@ ASF1_RESPAWNANIMATION
Enables respawning animation effect.
@ ASF1_TELEPORTAVOIDWATER
@ ASF1_TELEPORTWAIT
allows enemy to move around for 1.5 - 4.5 seconds before teleporting back in.
@ ASF1_TRIGGERSTUFF
Sets AF_TRIGGERSTUFF on SetupSpawnParams.
@ ASF1_USESTRONGATTACKS
anim_aiMelee1
@ ASF1_TELEPORT
allows kAI to teleport on SetupAISpawnFlags
@ AAF_ENTERCRAWL
Exactly the same as AAF_CRAWL.
@ AAF_CLIMB
climb up sectors faster than AAF_LADDER
@ AAF_ENTERED
Not shown in Editor. Used in kex editor only for fill sector commands. When map is saved in kex edito...
@ AAF_LADDER
climb up sectors slower than AAF_CLIMB
@ AAF_RESTRICTED
kAI can't enter the area
@ AAF_STOREWARPRETURN
Unused.
@ AAF_SLOPETEST
overrides AAF_CLIFF flag. If the sectors floor plane up direction is <= 0.5 then is a wall (a wall is...
@ AAF_TOGGLE
if on and AAF_BLOCK is on then sectors won't be marked on automap until it's unblocked....
kColor kexColor_Tab20Dark(uint i)
Not used. (garbage from kexengine)
enum EnumPlayerFlags AIF_REGENERATEANIM
enum EnumGameButtonEvents DIFFICULTY_NORMAL
enum EnumGameButtonEvents DIFFICULTY_HARDCORE
@ ASF2_DROPITEM_MASK6
Small Health.
@ ASF2_DROPITEM_MASK3
Medium Health.
@ ASF2_PROJECTILEATTACK8
High Priest Homing Blue Flame (anim_aiRangeAttack4)
@ ASF2_DROPITEM_MASK11
Shotgun Shells.
@ ASF2_DROPITEM_MASK14
Clip.
@ ASF2_DROPITEM_MASK12
Energy Cell.
@ ASF2_WARPDEATH
NOT USED.
@ ASF2_NOAUTOMAPDRAW
if map all or show enemies cheats are on then will not draw this actor on the automap.
@ ASF2_DROPITEM_MASK1
Explosive shells.
@ ASF2_DROPITEM_MASK5
Ultra Health.
@ ASF2_PROJECTILEATTACK3
crouch rifle Fire (anim_aiRangeAttack7)
@ ASF2_PROJECTILEATTACK4
(anim_aiRangeAttack8)
@ ASF2_STAYINWATER
sets AF_STAYINWATER on SetSpawnParams
@ ASF2_DROPITEM_MASK10
4 Rockets
@ ASF2_HOLDTRIGGERANIMATION
@ ASF2_DROPITEM_MASK13
Large Energy Cell.
@ ASF2_DROPITEM_MASK2
Grenade.
@ ASF2_STOREWARPRETURN
Used in portal scripts.
@ ASF2_ALTERNATEMOVES
is for holding two handed weapons
@ ASF2_MORTALWOUNDIMPACT
Can be hit by a super arrow shot and if ASF2_DROPITEM_MASK9 is on has a chance to drop a mortal wound...
@ ASF2_DROPITEMONDAMAGE
NOT USED.
@ ASF2_DROPITEM_MASK4
Full Health.
@ ASF2_PROJECTILEATTACK7
Grenade Throw (anim_aiRangeAttack3)
@ ASF2_PROJECTILEATTACK5
Stand Rifle Fire (anim_aiRangeAttack5)
@ ASF2_PROJECTILEATTACK6
Pipe Blow (anim_aiRangeAttack6)
@ ASF2_DROPITEM_MASK8
Minigun ammo.
@ ASF2_DROPITEM_MASK9
Mortal Wound.
@ ASF2_DROPITEM_MASK7
Large Health.
@ ASF2_REMOVEONCOMPLETION
Sets AF_REMOVEONCOMPLETION.
@ CAMS_FADEBACK_TO_CLIENT
enum EnumPlayerFlags AIF_NOTHINK
don't run ai logic
enum EnumPlayerFlags AIF_AWAYFROMLEASH
enum EnumPlayerFlags AIF_GETATTENTION
enum EnumPlayerFlags AIF_RESSURECT
enum EnumPlayerFlags AIF_WASSOLID
enum EnumPlayerFlags AIF_BLOWNAWAY
being blown away by explosion
@ CMF_CHANGE_MAP_AFTER_FADE
@ CMF_SHOW_HIDDEN_OBJECTS
@ CMF_UNLOCK_PLAYER_ON_FINISH
void delay(const float time)
used in map scripts to delay execution of script
kActorFactory ActorFactory
float Lerp(float start, const float end, const float time)
Linearly interpolates between start and end by time.
float ATan2(float y, float x)
Returns the angle in radians whose Tan is y/x.
float Clampf(const float f, const float min, const float max)
Returns clamped value between min and max.
int Abs(int i)
Returns the absolute value of i.
int Rand()
Range 0..32767.
float NLerp(const float a, const float b, const float t)
Calculates the linear parameter t that produces the interpolant value within the range [a,...
const kVec3 vecZero(0.0f, 0.0f, 0.0f)
float Floor(float f)
Returns the largest integer smaller to or equal to f.
float Pow(float x, float y)
Returns f raised to power p.
float Deg2Rad(float degs)
Degrees-to-radians conversion.
float Max(const float a, const float b)
Returns the largest of the two values.
uint8 RandByte()
Range 0..255.
float Accelerate(const float val, const float accel, const float max)
return val that increases by accel in a weird way to the max value.
float Sqrt(float f)
Returns square root of f.
float CosTween(const float t)
return (0.5f - (Cos(t * pi) * 0.5f));
float Tan(float f)
Returns the tangent of angle f in radians.
float Log(float f)
Returns the natural (base e) logarithm of a specified number.
float Fabs(float f)
Returns the absolute value of f.
float HermiteBlend(const float a, const float b, const float t)
float RandRange(const float min, const float max)
Returns a random float number between and min [inclusive] and max [inclusive].
float InvSqrt(float f)
Returns inverse square root of f.
float ACos(float f)
Returns the arc-cosine of f - the angle in radians whose cosine is f.
float Rad2Deg(float rads)
Radians-to-Degrees conversion.
float IncMax(const float val, const float inc, const float dest)
returns val +(or minus) inc and never goes above or below dest value
float Cos(float f)
Returns the cosine of angle f in radians.
const float i2f(const int i)
int to IEEE 754 float
int RandMax(const int max)
Range 0..max-1.
float Min(const float a, const float b)
Returns the smallest of the two values.
float Ceil(float f)
Returns the smallest integer greater to or equal to f.
const int f2i(const float f)
IEEE 754 float to int.
float CosArc(const float t)
return (-((Cos(Deg2Rad(360.0f * t)) - 1.0f) * 0.5f));
float SmoothStep(const float from, const float to, const float t)
Interpolates between min and max with smoothing at the limits.
int Clamp(const int i, const int min, const int max)
Returns clamped value between min and max.
int SysRand()
Range 0..32767.
float Sin(float f)
Returns the sine of angle f in radians.
float RandCFloat()
Range -1..1.
float RandFloat()
Range 0..1.
< Not used (garbage included automatically from kexengine)
const kColor magenta
255, 0, 255, 255
const kColor blue
0, 0, 255, 255
const kColor gray
127, 127, 127, 255
const kColor tab20purple2
const kColor green
0, 255, 0, 255
const kColor white
255, 255, 255, 255
const kColor red
255, 0, 0, 255
const kColor cyan
0, 255, 255, 255
const kColor yellow
255, 255, 0, 255
const kColor tab20orange2
const kColor orange
255, 127, 0, 255
const kColor transparent
0, 0, 0, 0
const kColor black
0, 0, 0, 255
funcdef bool less(const ?&in a, const ?&in b)
sorting function for sort
void resize(uint length)
Sets the new length of the array.
void insertAt(uint index, const T &in value)
Inserts a new element into the array at the specified index.
void sortAsc()
Sorts the elements in the array in ascending order. For object types, this will use the type's opCmp ...
void removeLast()
Removes the last element of the array.
int find(uint startAt, const T &in value) const
Returns the index of the first element that has the same value as the wanted value....
int findByRef(const T &in value) const
Searches for a matching address. These are especially useful for arrays of handles where specific ins...
void reverse()
Reverses the order of the elements in the array.
void removeRange(uint start, uint count)
Removes count elements starting from start.
uint length() const
Returns the length of the array.
void removeAt(uint index)
Removes the element at the specified index.
int find(const T &in value) const
Returns the index of the first element that has the same value as the wanted value....
void insertAt(uint index, const T[]&inout arr)
Inserts another array of elements into the array at the specified index.
void insertLast(const T &in value)
Appends an element at the end of the array.
void reserve(uint length)
const T & opIndex(uint index) const
void sortDesc()
Sorts the elements in the array in descending order. For object types, this will use the type's opCmp...
bool opEquals(const T[]&in) const
void sortDesc(uint startAt, uint count)
Sorts only the elements starting at index startAt and the following count elements in the array in de...
int findByRef(uint startAt, const T &in value) const
Searches for a matching address. These are especially useful for arrays of handles where specific ins...
void sort(less &in, uint startAt=0, uint count=uint(- 1))
sorts array using the passed in less function
T &[] opAssign(const T[]&in)
void sortAsc(uint startAt, uint count)
Sorts only the elements starting at index startAt and the following count elements in the array in as...
kStr & ToUpper()
Converts string to upper case characters.
bool IsEmpty() const
length of string is 0
kStr opAdd(uint16 i) const
bool ContainsNoCase(const kStr &in) const
contains the string ignoring case
kStr & ToLower()
Converts string to lower case characters.
kStr opAdd(uint64 i) const
bool opEquals(const kStr &in s) const
bool Contains(const kStr &in) const
contains the string
float Atof() const
Converts string to float.
uint64 Length() const
Returns the length of the string.
kStr opAdd(float f) const
kStr opAdd(int16 i) const
kStr opAdd(const kStr &in s) const
int8 opIndex(const int64 i)
Returns The ASCII code of the character at the strings index.
kStr & opAddAssign(bool b)
kStr opAdd(int64 i) const
int Atoi() const
Converts string to int.
uint64 IndexOf(const kStr &in) const
Reports the zero-based index of the first occurrence of a specified string within this instance....
uint Hash() const
Returns HashID from this instance.
kStr & opAddAssign(const kStr &in s)
kStr & opAssign(const kStr &in s)
kAngle & opAssign(const float f)
kAngle opSub(const float f) const
kAngle(const kAngle &in other)
kAngle & opAssign(const kAngle &in a)
float Diff(const float rads) const
kAngle & opSubAssign(const float f)
float Interpolate(const float a, const float b) const
float Diff(const kAngle &in other) const
kAngle & opAddAssign(const kAngle &in a)
kAngle & opAddAssign(const float f)
kAngle opAdd(const kAngle &in a) const
kAngle opSub(const kAngle &in a) const
kAngle & opSubAssign(kAngle &in a)
kAngle opAdd(const float f) const
Representation of 3D vectors and points.
kVec3 opAdd(const kVec3 &in v) const
kVec3 & opAssign(const kVec3 &in v)
kVec3 Cross(const kVec3 &in v) const
Cross Product of two vectors.
kVec3 opMul(const float val)
kVec3 & QuadraticCurve(const kVec3 &in pt1, const float value, const kVec3 &in pt2, const kVec3 &in pt3)
kVec3(float x, float y, float z)
float Length() const
Returns the length of this vector. Exactly the same as Unit()
float ToYaw()
Returns the Yaw direction in Rads.
void Set(const float x, const float y, const float z)
Set x, y and z components of this kVec3.
kVec3 opSub(const kVec3 &in v) const
kVec3 & CubicCurve(const kVec3 &in pt1, const float value, const kVec3 &in pt2)
kVec3 & opSubAssign(const kVec3 &in v)
kVec3 opDiv(const kVec3 &in v)
kVec3 & Normalize()
Makes this vector have a magnitude of 1.
kVec3 & Randomize(const float value)
Randomizes x, y, z, components by value.
kVec3 opDiv(const float val)
kVec3 & opAddAssign(const kVec3 &in v)
kVec3 & opDivAssign(const float f)
float Distance(const kVec3 &in other) const
Returns the distance between this instance and other vector.
kVec3 & opMulAssign(const kVec3 &in v)
kVec3 opMul(const kQuat &in rot) const
float LengthSq() const
Returns the squared length of this vector. Exactly the same as UnitSq()
kVec3 & opMulAssign(const float f)
kVec3 Lerp(const kVec3 &in other, const float t) const
Linearly interpolates between two vectors.
float UnitSq() const
Returns the squared length of this vector. Exactly the same as LengthSq()
kVec3 & Lerp(const kVec3 &in other, const float t)
Linearly interpolates between two vectors.
float ToPitch()
Returns the Pitch direction in Rads.
float opIndex(int i) const
kVec3 opAdd(const float f) const
kVec3 opSub(const float f) const
kVec3 & Project(const kVec3 &in normal, const float value)
Projects a vector onto another vector.
kVec3 & opMulAssign(const kQuat &in rot)
kVec3 & opAddAssign(const float f)
kVec3 & opDivAssign(const kVec3 &in v)
kVec3 opMul(const kVec3 &in v)
kVec3 & Reflect(const kVec3 &in normal, const float energyFactor)
Reflects a vector off the plane defined by a normal.
float DistanceSq(const kVec3 &in other) const
Returns the squared distance between this instance and other.
float Unit() const
Returns the length of this vector. Exactly the same as Length()
kQuat ToQuaternion() const
kVec3 & opSubAssign(const float f)
void Clear()
Sets x, y and z components to 0.
float Dot(const kVec3 &in v) const
Dot Product of two vectors.
Quaternions used to represent rotations.
void GetAngles(float &out yaw, float &out pitch, float &out roll)
kQuat & NormalizeNoInvSqrt()
void Set(const float x, const float y, const float z, const float w)
kQuat Diff(const kQuat &in rot) const
kQuat(float w, kVec3 &in point)
void Clear()
x,y,z = 0.0 w = 1.0
kQuat opSub(const kQuat &in rot)
kQuat & opAssign(const kQuat &in rot)
kQuat(const kQuat &in other)
kQuat & opMulAssign(const kQuat &in rot)
kQuat(float x, float y, float z)
kQuat opAdd(const kQuat &in rot)
kQuat opMul(const kQuat &in rot)
kQuat Slerp(const kQuat &in rot, float t) const
kQuat(float x, float y, float z, float w)
float ToYaw() const
Yaw of this plane.
const kVec3 & Normal() const
float Distance(const kVec3 &in point) const
0 = PSIDE_ON. > 0 is PSIDE_FRONT. < 0 PSIDE_BACK.
kPlane(const float a, const float b, const float c, const float d)
float Dot(const kVec3 &in point) const
bool IsFacing(const float yaw) const
Returns true if yaw is facing toward the plane. Usually used for climbing sectors.
kPlane(const kVec3 &in a, const kVec3 &in b, const kVec3 &in c)
float Dot(const kPlane &in plane) const
kPlane(const kAngle &in a)
const int PointOnSide(const kVec3 &in point) const
Returns EnumPlaneSide. If point is in front, behind or on the plane.
kPlane(const kVec3 &in a, const kVec3 &in b)
< Not used (included automatically from kexengine)
kColor(float r, float g, float b)
kColor opSub(const kColor &in c) const
kColor(const kColor &in rgb, uint8 a)
kColor & opAssign(const kColor &in c)
void FromVec3(const kVec3 &in v)
void HSLToRGB(float hue, float sat, float lit)
void RGBToHSV(float &out hue, float &out sat, float &out result) const
kColor & opMulAssign(const kColor &in c)
kColor opMul(float f) const
kColor opAdd(const kColor &in c) const
kColor opMul(const kColor &in c) const
void RGBToHSL(float &out hue, float &out sat, float &out lit) const
kColor(uint8 r, uint8 g, uint8 b, uint8 a)
kColor & opSubAssign(const kColor &in c)
kColor & opAddAssign(const kColor &in c)
float GetSaturation() const
kColor(const kColor &in c)
kColor(uint8 rgb, uint8 a)
bool opEquals(const kColor &in c) const
void HSVToRGB(float hue, float sat, float val)
kVec3 ToVec3Linear() const
float GetLuminance() const
kColor ToPreMultiplied() const
void FromVec3Linear(const kVec3 &in v)
kColor & opMulAssign(float f)
void SetSaturation(float)
void LerpRGB(const kColor &in c, float t)
< Not used (garbage included automatically from kexengine)
bool WriteByte(const uint8 i)
< Not used (garbage included automatically from kexengine)
kStr GetGroupString(int key, uint groupIndex, uint plat) const
plat: kexLocPlatform_e
kStr TranslateGroupString(const kStr &in key, uint groupIndex, uint plat) const
plat: kexLocPlatform_e
kStr GetString(const kStr &in key, kexLocPlatform_e plat) const
kStr TranslateStringWithArgs(const kStr &in key, const kDict &in pairs, uint plat) const
plat: kexLocPlatform_e
uint GetGroupIndex(const kStr &in groupName)
kStr GetGroupString(const kStr &in key, uint groupIndex, uint plat) const
plat: kexLocPlatform_e
kStr TranslateGroupStringWithArgs(const kStr &in key, const kDict &in pairs, uint groupIndex, uint plat) const
plat: kexLocPlatform_e
kStr TranslateString(const kStr &in key, kexLocPlatform_e plat) const
kStr GetString(int key, kexLocPlatform_e plat) const
kStr TranslateString(const kStr &in key) const
Same as Game.GetLocalizedText.
bool opEquals(const ref &in) const
ref & opHndlAssign(const ?&in)
bool opEquals(const ?&in) const
ref & opHndlAssign(const ref &in)
Editable Dictionary object that holds keys and values.
void SetValue(const kStr &in key, const kStr &in value)
Sets the value for the specified key.
void Empty()
Removes all keys/values.
bool GetBool(const kStr &in key, bool &out boolResult, const bool defaultValue=false)
Returns true if found the key as a bool type.
void Add(const kStr &in key, const kStr &in value)
Adds a new key/value.
bool GetInt(const kStr &in key, int &out intResult, const int defaultValue=0)
Returns true if found the key as a int type.
bool GetString(const kStr &in key, kStr &out stringResult)
Returns true if found the key as a kStr type.
bool GetVector(const kStr &in key, kVec3 &out vectorResult)
Returns true if found the key as a kVec3 type.
bool GetFloat(const kStr &in key, float &out floatResult, const float defaultValue=0)
Returns true if found the key as a float type.
const bool HasKey(const kStr &in key)
Returns true if key exists.
Read only Dictionary object that holds keys and values.
bool GetVector(const kStr &in key, kVec3 &out vectorResult)
Returns true if found the key as a kVec3 type.
bool GetBool(const kStr &in key, bool &out boolResult, const bool defaultValue=false)
Returns true if found the key as a bool type.
bool GetFloat(const kStr &in key, float &out floatResult, const float defaultValue=0)
Returns true if found the key as a float type.
bool GetString(const kStr &in key, kStr &out stringResult)
Returns true if found the key as a kStr type.
bool GetInt(const kStr &in key, int &out intResult, const int defaultValue=0)
Returns true if found the key as a int type.
const uint GetNumEntries() const
returns number of items in the list
kSelectionListInt & opAssign(const kSelectionListInt &in other)
void AddItem(int item, const int weight)
void Reset()
clears all items in the list
int & Select()
Returns a value based on item weights.
kSelectionListFloat & opAssign(const kSelectionListFloat &in other)
const uint GetNumEntries() const
returns number of items in the list
void AddItem(float item, const int weight)
void Reset()
clears all items in the list
float & Select()
Returns a value based on item weights.
void SetVisibility(const int nodeIndex, const bool visible)
kVec3 GetNodeScale(const int node)
kQuat GetNodeRotation(const int node)
void SetRotationOffset(const int nodeIndex, const kQuat &in rotation)
const int GetNumNodes() const
kVec3 GetNodeOrigin(const int node, const kVec3 &in offset)
void SetRotationOffset(const int nodeIndex, const float rads, const float x, const float y, const float z)
void HideSection(const int nodeIndex, const int section, const bool hide)
section is the surface index. must be 0-31 and must not be >= number of surfaces or will do nothing.
void SetMorphUpdating(const bool bUpdate)
Set Morph Updating.
void SetMorphFrame(const int frame, const int nextFrame, const float time)
void SetTexture(const int section, const int textureID)
void AddTrailEffect(const kStr &in trailName, const int nodeIndex)
const bool IsMorph() const
const int GetNumAttachedTrails()
void GetMorphFrame(int &out frame, int &out nextFrame, int &out maxFrames, float &out time) const
Get Morph frame info.
void SetModel(const kStr &in modelPath, const kStr &in modelAnimPath)
kStr GetModelFile() const
void RemoveTrailEffect()
Removes all trail effects.
const float TrackTime()
time from 0(on first frame) to 1(on last frame).
const bool CycleCompleted() const
(flags & ANF_CYCLECOMPLETED) != 0
void Blend(const int animID, float speed, float blend, int flags)
EnumAnimStateFlags.
void Set(const int animID, float speed, int flags)
EnumAnimStateFlags.
void Stop()
flags |= ANF_STOPPED; flags &= ~ANF_LOOP;
const int NumFrames()
number of frames in this animation
const int CurrentFrame()
current frame playing for the current animation. Must have an animation action keyframe for this to w...
void Resume()
flags &= ~ANF_PAUSED;
const float PlayTime()
increases by GAME_DELTA_TIME if not stopped or paused.
void Pause()
flags |= ANF_PAUSED;
const int TrackNextFrame(void) const
void SetPlayTime(const float time)
The total time in seconds this animation has been playing.
void SetLastFrame(const bool execActions=false)
if execActions is true, runs all key frame actions in the animation except Footstep(55) and PlaySound...
const bool Looping() const
(flags & ANF_LOOP) != 0
const bool Blending() const
(flags & ANF_BLEND) != 0
int flags
EnumAnimStateFlags.
const bool Stopped() const
(flags & ANF_STOPPED) != 0
bool IsPlaying(const int animID)
Returns true if current animations ID is animID and the animation is not stopped.
void SetTrackTime(const float time)
0.0(first frame) to 1.0(last frame)
bool CheckAnimID(const int animID)
checks if animID exists
void ChangeSpeed(const float speed)
Scales speed of the current animation where 1.0 = 15fps and 4.0 = 60fps.
const int PlayingID() const
the current animations ID
const int TrackFrame(void) const
Base type used by all actors.
kVec3 GetTransformedVector(const kVec3 &in vector)
kVec3 DamageOrigin(void) const
The Origin point of the attacker (Fx, Actor, or null (returns this actors origin in that case)) who d...
int & DifficultyMode()
The difficulty this actor is currently set to.
void SetSpawnFlags3(const uint flags)
EnumActorSpawnFlags3.
const int16 SpawnParams(const int paramID) const
Get a map actors param value.
const bool GetUsingCustomDeadHeight()
const int MapActorIndex() const
Returns -1 if not a map actor.
void SetModel(kStr &in modelFile, kStr &in animFile)
a way to set the model/anim for actors that had no model set previously
const int16 GetOverrideKeyTouchTID()
used only for key pickups
bool & NoKnockBack()
Will not receive knock back movement from things like the alien weapon for example.
float & Mass()
default = GAME_SCALE * 1.0f
kAI CastToAI()
Casts to kAI. returns null if isn't a kAI.
int & ImpactType()
EnumImpactType.
void SetCustomDeadHeight(const bool bUse, const float height)
Height of actor when they are dead. Only for non map actors. (actors spawned with ActorFactory)
void SpawnFx(const kStr &in fxPath, const kVec3 &in pos, const kQuat &in rot)
const float GetWaterHeight() const
kVec3 DamageVelocity(void) const
The Velocity of the attacker (Fx, Actor, or null (returns this actors velocity in that case)) who dam...
float DistanceToPoint(const float x, const float y, const float z) const
actors point is in the center
const float GetCustomDeadHeight()
kDictMem Definition()
get actors def data
bool CheckPosition(const float angle, const float distance)
calls CheckPosition(kVec3 origin) with location being: Actor.Origin() + (angle*distance*actor....
float & WaterFriction()
default = 0.5f (same as Friction)
void Remove()
Removes the actor and sets stale to true. Actor will only internally be removed when there are no ref...
void GetBoundsMinMax(kVec3 &out min, kVec3 &out max) const
actor must not be sleeping and have a model set and not be a pickup. otherwise will return default mi...
const bool InWater() const
void SetSector(const uint sectorIndex)
bool & IgnoreSectorHeightChange(void)
if true will not change position(or velocity and movement) when sector height changes.
const bool OverridingKeyTouchTID()
used only for key pickups
void OverrideOnDamageValue(const int damage, const bool bOverride=true)
call in OnPreDamage
void SetPosition(const kVec3 &in pos)
best way to set an actors position, will also set the sector and clearinterpolation
void SetSpawnParams(const int param, const int16 value)
Sets the actors param value. all params are int16.
void SetAutomapColor(const int r, const int g, const int b)
const bool CanSee(kPuppet@ puppet, const uint excludeClipFlags=0)
excludeClipFlags to ignore/disable (EnumClipFlags). Note: This function that takes in the kPuppet arg...
void MoveToPosition(const float x, const float y)
Moves the world object to a desired position at xy coordinates. Movement will use hitscan collision f...
kScriptObject ScriptObject()
uint & ClipFlags()
EnumClipFlags.
kRenderModel RenderModel()
kActor CastToActor()
Casts to a kActor. Only used for kPuppet Actor().
void InflictGenericDamage(kActor@ inflictor, const int damage)
void SetHeadTrackTarget(kActor@ actor)
void SetupSpawnParams()
call after setting your actors spawnflags for them to take effect on the kActor
bool InstanceOf(const kStr &in className) const
example: InstanceOf("kexPuppet")
void InteractActorsAtPosition(const kVec3 &in pos, const kStr &in callbackFunc, const float arg1=0, const float arg2=0, const float arg3=0, const float arg4=0)
void SetTarget(kActor@ actor)
const float BaseHeight() const
height of actor when spawned or when kAI regenerated
const bool CanSee(kActor@ actor, const uint excludeClipFlags=0)
excludeClipFlags to ignore/disable (EnumClipFlags)
bool CheckPosition(const kVec3 &in origin)
checks if the actor can move to this location
void SetSpawnFlags2(const uint flags)
EnumActorSpawnFlags2.
void AutomapToggle(const bool show)
Use with Game.AutomapCustom(true);.
const bool IsPersistentMarked()
void InflictDamage(kActor@ inflictor, const kStr &in damageDef)
const int GetSectorIndexAtLocation(const kVec3 &in pos, uint excludeClipFlags=0)
excludeClipFlags to ignore/disable (EnumClipFlags)
const uint SpawnFlags2() const
EnumActorSpawnFlags2.
const float GetFloorHeight() const
calculates the floor height from the actors sector and origin. Returns 0 if not in a sector.
const bool IsStale() const
Actor is marked as removed and is waiting to be freed from memory when it next checks if there are no...
int GetWaterLevel() const
EnumWaterLevel.
bool & ChildOfTarget(void)
if this actors Target is an actor that belongs to the owner of the Fx, explosion or melee attack then...
void RunFxEvent(const kStr &in fxEventName)
Runs an ActorFX event. Example: RunFxEvent("Enemy_Freeze");.
void MeleeObject(const kStr &in damageType, const kVec3 &in offset, const float radius)
uint & Flags()
EnumActorFlags.
const uint SpawnFlags3() const
EnumActorSpawnFlags3.
void PlaySound(const kStr &in soundPath)
float & StepHeight()
AKA Dead Height. Used for moving up steps, figuring out if in waterheight, and the height of the acto...
float DistanceToPoint(const kVec3 &in point) const
calls DistanceToPoint(x,y,z)
void SpawnFx(const kStr &in fxPath, const kVec3 &in pos)
kVec3 & Origin()
Position in world space.
const float GetSkyHeight() const
int & Type()
The actors Type ID.
const float GetCeilingHeight() const
calculates the ceiling height from the actors sector and origin. Returns 0 if not in a sector.
void RunAction(const int funcID, const float w=0.0f, const float x=0.0f, const float y=0.0f, const float z=0.0f)
run a function on the actor defined in defs/animActions.txt
void ClearInterpolation()
bool & SkipKeyTouchCinema()
used only for key pickups
void PlaySoundWithLookupID(const int soundID)
bool & TriggerInvincibility()
Can't damage if true. Gets set to true if enemy has trigger anim and false when activated.
bool RandomDecision(const int randomBit) const
randomBit should be >= 2. if a random value has the bit set and actors GameTicks also has the bit set...
const uint SpawnFlags1() const
EnumActorSpawnFlags1.
float GetTurnYaw(const kVec3 &in lookAtLocation) const
void SpawnProjectile(const kStr &in fxPath, const kVec3 &in pos, const kVec3 &in targetLocation, const float maxAngle)
void SetSpawnFlags1(const uint flags)
EnumActorSpawnFlags1.
const int GameTicks() const
void MarkPersistentBit(const bool clear)
float GetAvoidanceAngle(const kVec3 &in lookAtLocation, const float distance)
float & AirFriction()
default = 1.0f
void OverrideKeyTouchTID(const bool bOverride, const int16 tid)
used only for key pickups to tell what key it is in the hub
kActor Get()
Returns the next actor in the iterator.
void Reset()
Resets the iterator back to the first actor.
void FireProjectile(const kStr &in fxPath, const float x, const float y, const float z, const bool adjustToPerspective=false)
SpawnsFx at the players at the position passed in * players rotation, then adds the viewHeight + land...
kVec3 TransformToOwnerPosition()
returns the OffsetPosition() * the players matrix.
kVec3 TransformToOwnerPosition(const kVec3 &in vector)
returns the (OffsetPosition() + vector) * the players matrix.
int & State()
EnumWeaponStates.
bool & PreventFire()
Use in OnBeginFire to internally prevent from entering its Fire state.
kVec3 & OffsetPosition()
Offset position of weapon.
float & AttackRange()
squared
float & SightRange()
squared
int & Agitation()
0-300. 0-99=IDLE, 100-199=AGITATED, 200-300=CHASE
float & SightFOV()
in rads
float & AnimScalar()
default = 1.0f
float & QuietRange()
squared
float & BlendScalar()
default = 10.0f
int & AttackChance()
0-100
void SetupAISpawnFlags()
call after setting your actors spawnflags for them to take effect on the kAI
float & LeashRadius()
squared
uint & AIFlags()
EnumAIFlags.
float & MeleeRange()
squared
float & FlyHeight()
squared
float & LoudRange()
squared
const float GroundStrafeSpeed() const
default = 10.24f
void SetJumpClimbSpeed(const float speed)
default = GAME_SCALE * 0.2875f
const float JumpMinSpeed() const
default = GAME_SCALE * 0.855f
void SetGroundBackwardAccel(const float accel)
default = 0.05f
const float LandingViewOffset() const
LandingViewOffset changes when jumping and falling. Origin.z + ViewHeight() + LandingViewOffset() = C...
const float GroundBackwardAccel() const
default = 0.05f
float & Oxygen()
Time in seconds. 0: full oxygen. >= 55: shows air bar. >= 70: OxygenOut is set to true.
void SetSwimBackwardSpeed(const float speed)
default = -10.24f
void SetGroundBackwardSpeed(const float speed)
default = -10.24f
void SetOverrideWalkRun(const int value)
0=none(default), 1=Force Disable Walk
void SetSwimForwardAccel(const float accel)
default = 0.05f
const float GroundDeaccel() const
default = 0.5f
const int OverrideShadow() const
default = 0
void SetGroundStrafeAccel(const float accel)
default = 0.05f
const float GroundForwardSpeed() const
default = 10.24f
const float GroundForwardAccel() const
default = 0.05f
void SetJumpMaxSpeed(const float speed)
default = GAME_SCALE * 1.667f
uint & PlayerFlags()
EnumPlayerFlags.
void SetGroundForwardSpeed(const float speed)
default = 10.24f
const float GroundStrafeAccel() const
default = 0.05f
void SetGroundStrafeSpeed(const float speed)
default = 10.24f
float & RecoilPitch()
used for weapon recoil that modifies the players pitch.
const float SwimBackwardAccel() const
default = 0.05f
const float SwimForwardSpeed() const
default = 10.24f
void SetSwimBackwardAccel(const float accel)
default = 0.05f
void SetCrawl(const bool crawl)
use this to manually set if the player is crawling instead of setting PF_CRAWLING directly.
void SetGroundDeaccel(const float accel)
default = 0.5f
void SetSwimForwardSpeed(const float speed)
default = 10.24f
float & OverrideFOV()
set to 1-179. anything else will stop overriding the fov and will use the r_fov cvar.
void SetJumpMinSpeed(const float speed)
default = GAME_SCALE * 0.855f
const float SwimStrafeAccel() const
default = 0.05f
const float JumpMaxSpeed() const
default = GAME_SCALE * 1.667f
const int OverrideWalkRun() const
default = 0
void SetSwimStrafeAccel(const float accel)
default = 0.05f
const float SwimStrafeSpeed() const
default = 10.24f
void SetSwimDeaccel(const float accel)
default = 0.5f
void SetSwimStrafeSpeed(const float speed)
default = 10.24f
const float ClimbJumpAmount() const
default = GAME_SCALE * 0.2875f
void SetGroundForwardAccel(const float accel)
default = 0.05f
const float SwimBackwardSpeed() const
default = -10.24f
const float GroundBackwardSpeed() const
default = -10.24f
const float SwimDeaccel() const
default = 0.5f
const int GetState(void) const
EnumPlayerStates.
void SetOverrideShadow(const int value)
0=none(default), 1=Force Disable shadow, 2=Force Enable shadow
const float SwimForwardAccel() const
default = 0.05f
float & ViewHeight()
set from the players def "player.viewHeight". Origin.z + ViewHeight() + LandingViewOffset() = Cameras...
bool & OxygenOut()
if true will damage player if underwater
kActor Spawn(const kStr &in actorName, const float x, const float y, const float z, const float yaw, const int sector=- 1)
kActor Spawn(const int actorID, const float x, const float y, const float z, const float yaw, const int sector=- 1)
const int CinematicState() const
EnumCameraStates.
void SetLookAtActor(kActor@ actor)
void TweenRotationTrack(const int view, const kVec3 &in pos, const float time)
Lerps all variables set when SetRotationTrack was called using the time param (clamped 0....
const bool Enabled() const
CinematicState() >= CAMS_FADEOUT (Not Idle)
void ZoomEyeViewToPosition(const kVec3 &in position, const float speed)
linear lerp finalview eye position to position using speed. finalview must be set or will do nothing.
void StartCinematic(const uint flags=12)
EnumCameraFlags.
void SetEyeView(const kVec3 &in position)
position of camera (finalview). finalview must be set or will do nothing.
void ZoomFocusViewToPosition(const kVec3 &in position, const float speed)
linear lerp finalview focus position to position using speed. finalview must be set or will do nothin...
kVec3 origin
current position of camera. if a finalview is set then the origin will be set to the finalview's eye ...
kAngle pitch
if a finalview is set then the pitch will be set to the finalview's look direction.
void SetFinalView(const int view)
the view to use for the camera origin and direction. view must be in range 0-2
void ClearViewTracks()
views 0-2 all variables are set to 0
const bool Active() const
void SetFocusView(const kVec3 &in position)
position of where the camera (finalview) is looking at. (Sets look direction from eye and focus posit...
float lookZOffset
Used only if LookAtActor has been set.
void SetPositionTrack(const int view, const kVec3 &in startEye, const kVec3 &in destEye, const kVec3 &in startFocus, const kVec3 &in endFocus)
Sets eye and focus start and dest positions for use with TweenPositionTrack and AutoPlayPositionTrack...
const bool ViewingFromCamera() const
CinematicState() >= CAMS_FADEIN && CinematicState() <= CAMS_ACTIVE_TO_FADEOUT.
void SetRotationTrack(const int view, const float startAngle, const float destAngle, const float startDist, const float destDist, const float startEyeZOffset=0, const float destEyeZOffset=0, const float startFocusZOffset=0, const float destFocusZOffset=0)
Use with TweenRotationTrack and AutoPlayRotationTrack.
void StopCinematic(const bool noFade=false)
if noFade is true will stop the cinematic immediately without fading out.
void TweenPositionTrack(const int view, const float time)
Lerps eye and focus positions to the start and dest positions using the time param (clamped 0....
kVec3 & Tremor()
x = adds to yaw, y = adds to pitch, z = adds to roll. lerps to vecZero using lerpTime of GAME_FRAME_T...
void SetSector(const uint sectorIndex)
kAngle roll
if a finalview is set then the roll will be set to 0.
float fov
Camera FOV (default is 74.0)
kAngle yaw
if a finalview is set then the yaw will be set to the finalview's look direction.
kVec3 GetEyeView()
position of camera (finalview). finalview must be set or will return vecZero.
const uint Flags() const
EnumCameraFlags.
void AutoPlayPositionTrack(const int view, const float speed, const int lerpType)
EnumCameraLerpType. Calls TweenPositionTrack on the view using speed and lerpType.
kVec3 GetFocusView()
position of where the camera (finalview) is looking at. finalview must be set or will return vecZero.
const bool UserInterrupted() const
User pressed left click or escape key or any controller button. While CinematicState() == CAMS_ACTIVE...
void AutoPlayBlendTrack(const int viewA, const int viewB, const int viewC, const float speed, const int lerpType)
EnumCameraLerpType. Blends between viewB and viewC eye and focus. and sets the results to viewA.
void ClearInterpolation()
void SetRotateEyeVector(const kVec3 &in vector)
The focus position that is used when AutoPlayRotationTrack is called if there is no LookAtActor set.
void ClearFinalView()
finalview is set to null
void AutoPlayRotationTrack(const int view, const float speed, const int lerpType)
EnumCameraLerpType. Calls TweenRotationTrack on the view using speed and lerpType.
The kCModel(CModel) global stores collision results when certain actor methods are called....
kVec3 & ContactNormal()
Returns the normalized vector of the collided surface.
kActor ContactActor()
handle pointer to actor that was collided (null if none was collided)
const uint ClipResult()
specifies the type of intersection (flags)
kVec3 & InterceptVector()
Returns the vector that intersected the collided geometry.
kVec3 & MoveDirection()
Movement vector of the object.
const float & Fraction()
returns the 0.0 - 1.0 range of the point of intersection from start to end trace. (If fraction is == ...
void StartWarp(kActor@ actor, const int tagID, const int mapID)
void TagActorForBossBar(kActor@ actor)
void ClearWarpInterpolation(void)
Clearing the interpolation for kPuppet will also clear the warp interpolation.
const bool CheckWarping()
Checks if Warping or FreeWarping is in progress.
const int UnscaledTicks() const
Not effected by GameSpeed.
void HandlePlayerDeath(const bool loseLife=true)
if loseLife is true and infinite lives cheat is off then player loses a life. if player lives is < 0 ...
const bool CanOpenSaveMenu()
Checks if it's okay to be able to open the save menu.
void CheckKeys()
Prints HUD messages to tell the player how many keys they've found on the current HUBID.
void ChangeMap(const kStr &in mapName)
const int NewMapWarpTID()
Returns the warp TID the player warped to from another map. Returns -1 of didn't warp from another ma...
void StartFreeWarp(kActor@ actor, const kVec3 &in origin, const float yaw, const int sectorIndex, const int mapID)
const int Ticks() const
effected by gamespeed
const bool CanOpenPauseMenu()
Checks if it's okay to be able to open a menu.
const bool GetCvarValue(const kStr &in cvarName, kStr &out result)
void MouseToHUD(float &out x, float &out y)
Returns the HUD position of the mouse.
void Warning(const kStr &in message)
void Print(const kStr &in message)
void FloodMatchingAreaFlags(const int sectorIndex, const uint flags, const bool active)
(EnumAreaFlags) Sets flags on all adjacent sectors with matching areaID.
void ChangeAreaWallImpact(const int areaID, const int value)
value: EnumImpactType
const int GetAreaFloorImpact(const int areaID) const
EnumImpactType.
const int GetNumSectors() const
const int GetNumAreas() const
void ChangeAreaFloorImpact(const int areaID, const int value)
value: EnumImpactType
void FloodFillAreaFlags(const kVec3 &in origin, const uint flags, const bool active)
(EnumAreaFlags) Calls FloodMatchingAreaFlags with FindNextClosestSector(origin) sector.
const int GetSectorBridge(const int sectorIndex, const uint bridge) const
Get the sector of the bridge. Use GetSectorNumBridges to loop through them all.
void SetSectorFlags(const int sectorIndex, const int flags)
Keep in mind sector flags are a 16 bit unsigned integer and only the first 16 area flags (up to AAF_M...
kActor GetActorByTID(const int tagID, const int typeFilter=- 1) const
if typeFilter is -1 checks any type otherwise only returns the actor of that type
const int GetNumActors() const
number of actors that are in the current maps data
void ChangeAreaArg(const int areaID, const int arg, const int16 value)
void ChangeSectorCeilingHeight(const int sectorIndex, const float height)
Changes all sectors ceilng vertices with the same areaID to the height.
const int GetSectorAreaID(const int sectorIndex) const
const uint GetAreaFlags(const int areaID) const
EnumAreaFlags.
const int GetSectorFlags(const int sectorIndex) const
Returns a 16 bit unsigned integer. Only the first 16 area flags (up to AAF_MAPPED) are used for secto...
void ChangeSectorHeightVertices(const int sectorIndex, const float height, const int ptMask=7)
Changes only the sector floor vertices(specfied using the ptMask) to the height.
void GetSectorLinks(const int sectorIndex, int &out sectorIndex1, int &out sectorIndex2, int &out sectorIndex3) const
Get the 3 sectors links. -1 means there was no sector linked to that edge. Link 1 is pt1 to pt3 Link ...
void FloodFillAreaFlags(const int sectorIndex, const uint flags, const bool active)
(EnumAreaFlags) Sets flags on all adjacent sectors until it finds a sector that has the flags already...
void ChangeAreaFlag(const int areaID, const uint flags, const bool active)
(EnumAreaFlags) Only sets the areaID flags and not the sector flags. Should most likely prefer using ...
const int FindNextClosestSector(const kVec3 &in origin)
const int GetAreaWallImpact(const int areaID) const
EnumImpactType.
void ChangeSectorCeilingHeightVertices(const int sectorIndex, const float height, const int ptMask=7)
Changes only the sector ceiling vertices(specfied using the ptMask) to the height.
void ChangeSectorHeight(const int sectorIndex, const float height)
Changes all sectors floor vertices with the same areaID to the height.
const uint GetSectorNumBridges(const int sectorIndex) const
number of bridge sectors this sector has
const int16 GetAreaArg(const int areaID, const int arg) const
Returns an area arg value.
void ChangeAreaWaterHeight(const int areaID, const float height)
WaterHeight is stored per area, not per sector or per vertex.
bool TriggerActorsByTID(kActor@ instigator, const int tagID)
Triggers an actor (that is not the instigator) that has the same tagID. Returns true if triggered an ...
void GetSectorCorners(const int sectorIndex, kVec3 &out pt1, kVec3 &out pt2, kVec3 &out pt3, kVec3 &out heights) const
Get the Sectors vertex position and height Link 1 is pt1 to pt3 Link 2 is pt2 to pt1 Link 3 is pt3 to...
const int GetCurrentMapID()
void StopTactile(int vibHandle)
void SpawnFx(const kStr &in fxPath, kPuppet@ source, const kVec3 &in origin, const kQuat &in rotation)
void Print(const kStr &in text, const int ticks=120)
Print a message to the HUD on the next line.
kStr GetLocalizedText(const kStr &in key)
bool SphereInView(const kVec3 &in origin, const float radius)
void LifeForcePulse()
Shows the LifeForces on the HUD.
void SetWorldSunDirection(const float x, const float y, const float z)
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.
void SaveMenu()
Opens the save game menu. Should always check if(PlayLoop.CanOpenSaveMenu())
bool SetWeaponWheelPic(const int weapon, const kStr &in imagePath)
void SetPickupFlash()
Shows the pickup screen flash.
void SetModBindings(const bool show=true)
Shows custom mod bindings in menu Bindings > Actions.
void SetPreventOpenPauseMenu(const bool value)
bool SetPicColor(const int id, const int r=255, const int g=255, const int b=255, const int a=255)
void SpawnFx(const kStr &in fxPath, kPuppet@ source, const kVec3 &in origin, const float yaw, const float pitch)
void HaltMapScript(const int scriptID)
bool IsTactilePlaying(int vibHandle, const kStr &in path)
void OverrideFogType(const int value)
0=none, 1=force Radial, 2=force Plane
void OverridePerPolyCollision(const int value)
0=none, 1=force disable, 2=force enable
void PlayMovie(const kStr &in filename, const bool skippable=true)
Only .ogv files (replaces/adds .ogv extension to filename). Can not read from kpfs.
int PlayTactile(const kStr &in path, int channel, int pos)
Start controller vibration from tactile sound file. Returns a handle.
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 & HideAmmo()
Hide ammo display on the HUD.
float GetHUDOffset(const bool user=false)
if user is false will return the width to the edge of the screen (negative value)....
void ShowPauseMenu()
Should always check if(PlayLoop.CanOpenPauseMenu())
void AutomapDeactive(const bool toggle)
permanently deactivates the automap.
bool GetHubKeyInfo(const uint hubID, int &out nKeys, int &out remainingKeys, int &out keyBits)
bool IsTactilePlaying(int vibHandle)
void SetCursorHotPos(int x, int y)
change the mouses cursors click point (default is 0, 0)
bool & HideCrosshair()
Hide Crosshair display on the HUD.
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...
bool BoxInView(const kVec3 &in min, const kVec3 &in max)
bool IsJoystickActive()
if true the players last input was from a controller.
const int BossDamageScaler(const int difficulty, const int damage)
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 GetHUDOff...
bool SetPicWH(const int id, const float w, const float h)
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)
void SpawnFx(const kStr &in fxPath, kActor@ source, const kVec3 &in velocity, const kVec3 &in origin, const kQuat &in rotation)
const bool IsActorPersistentMarked(const int actorIndex, const int hubID=-1, const int mapNum=0)
an invalid hub or map uses current maps persistent data.
kStr GetInputImagePath(const kStr &in bindName)
void PrintLine(const kStr &in text, const int lineNumber, const int ticks=120)
Print a message to the HUD.
void LivesPulse()
Shows the Lives on the HUD.
void PrintHelp(const kStr &in text, const bool endGame=false)
void SetNoModSelect(const bool bToggle=true)
Disable the mod select menu when selecting new game for workshop mods only. (seta g_nomodselect "1")
bool LoadModFile(const kStr &in filename)
make sure to call GameModFileData.Empty() after you're done loading
bool SetPicAngle(const int id, const float angle)
in rads
void CallDelayedMapScript(const kStr &in funcName, kActor@ instigator, const float delay)
even with delay 0 it will be called when map scripts update
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".
bool InputImageExists(const kStr &in path)
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.
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 int GetMapIDFromName(const kStr &in mapName)
This returns the mapID from the mapName.
bool & HideBossBar()
Hide BossBar display on the HUD.
void SaveModFile(const kStr &in filename)
make sure to call GameModFileData.Empty() before adding key/values to save
void SetDifficulty(const int value)
EnumDifficulty.
void DisableLegalText()
Removes the text at the bottom of the title screen.
void AutomapToggle(const bool toggle)
show/hide the automap.
bool SetPicOrigin(const int id, const float x, const float y)
bool RemoveText(const int id)
int PurgeUnusedModels()
Returns number of models freed.
const bool AutomapDeactived()
void SetWorldSunLightColor(const float r, const float g, const float b)
void PlaySound(const kStr &in path)
void AutomapCustom(const bool toggle)
allow actors with custom automap colors to be drawn to the automap. (for mods)
void ShowMainMenu(const bool mouseCenter=true)
const float ShakeIntensity()
const float GetExtraZFar()
void SetExtraZFar(const float zfar)
affects actors, ai, particles, fog and underwater. (works normally unlike the cvar r_zfarextent)
bool & HideHealth()
Hide health display on the HUD.
bool ClearWeaponWheelPic(const int weapon)
bool IsWorkshop()
Returns true if game was run through the steam workshop (ran with command arg -workshop)
bool SetTextMsg(const int id, const kStr &in text)
void CallDelayedMapScript(const int scriptID, kActor@ instigator, const float delay)
even with delay 0 it will be called when map scripts update
bool SetTextOrigin(const int id, const float x, const float y)
bool & HideWeaponWheel()
Hide WeaponWheel display on the HUD.
void SpawnFx(const kStr &in fxPath, kActor@ source, const kVec3 &in origin, const float yaw, const float pitch)
void SetDamageFlash()
Shows the damage screen flash.
void SetWorldSunAmbientColor(const float r, const float g, const float b)
const uint ConButtons()
EnumPlayerConButtons.
kVec3 GetWorldSunAmbientColor()
const int GetDifficulty()
EnumDifficulty. Internally calls GameVariables.GetInt("g_difficulty")
kVec3 GetWorldSunLightColor()
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 OnPostBeginLeve...
const bool AutomapEnabled()
is the automap displaying on screen
void PlayMusic(const kStr &in path, const bool loop)
void SpawnFx(const kStr &in fxPath, kActor@ source, const kVec3 &in origin, const kQuat &in rotation)
bool & HideLives()
Hide Lives display on the HUD.
bool SetTextColor(const int id, const int r=255, const int g=255, const int b=255, const int a=255)
void SpawnFx(const kStr &in fxPath, kPuppet@ source, const kVec3 &in velocity, const kVec3 &in origin, const kQuat &in rotation)
void ClearDummyMenu(bool bClearAll=false)
void MusicPitch(const float pitch)
void GetTextSize(const kStr &in text, const int font, const float scale, float &out width, float &out height)
EnumGameFontType.
bool SetHubKey(const uint hubID, int key)
uint MenuButtons(void) const int64 GetTimestamp()
bool SetPicTex(const int id, const kStr &in path)
void LoadMenu()
Opens the load game menu. Should always check if(PlayLoop.CanOpenPauseMenu())
bool & HideTimers()
Hide Timers display on the HUD.
const bool GetPreventOpenPauseMenu()
void ChangeMap(const kStr &in path)
bool RemovePic(const int id)
kVec3 GetWorldSunDirection()
void CallMapScript(const int scriptID, kActor@ instigator)
Use to call map script right away.
bool & HideAirBar()
Hide AirBar display on the HUD.
void WeaponWheelPulse()
Shows the WeaponWheel on the HUD.
void SetGameSpeed(const float speed, const float blendSpeed)
Sets the current GameSpeed. kPuppet and kPlayerWeapon are not effected by GameSpeed.
void MessageBox(const kStr &in msg1, const kStr &in msg2)
void ToggleCursor(bool b=false)
bool & HideLifeForces()
Hide LifeForces display on the HUD.
void SetArmorFlash()
Shows the armor damage screen flash.
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.
void GetDateAndTime(int &out seconds, int &out minutes, int &out hours, int &out day, int &out month, int &out year, kStr &out text)
kStr PlayerName()
Returns "Player" if could not get name.
bool LoadModDataFile(const kStr &in filename)
Returns false if couldn't load file. Clears and Sets GameModFileData with the contents of the loaded ...
bool & HideHelpMessages()
Hide HelpMessages display on the HUD.
kVec3 WorldToHUDPoint(const kVec3 &in origin)
void OverrideSkyHeight(const float height)
Set to 0 to stop overriding.
bool & HideRunWalk()
Hide RunWalk display on the HUD.
void SpawnFx(const kStr &in fxPath, const kVec3 &in origin, const int sectorIndex)
void ClearPics(const bool clearImageCache=false)
void PlaySoundID(const int soundID)
bool & HideMessages()
Hide Messages display on the HUD.
void SetLivesPic(const kStr &in imagePath)
void ClearInterpolationOnGameObjects()
Clears Interpolation on all gameobjects and the camera if it's active.
void ConfirmMenu(const kStr &in msg1, const kStr &in msg2)
void RunWalkPulse()
Shows the RunWalk graphic on the HUD.
void SetLifeForcePic(const kStr &in imagePath)
void ShowDummyMenu(void)
Actors OnMenuTick fucntion will now be processed. Call ClearDummyMenu to close the dummy menu.
void CyclePrevWeapon(const bool bCheckAmmo=false)
const bool HasAltAmmo(const int weaponID) const
const bool HasAltAmmo() const
const int GetAltAmmo(const int weaponID) const
void SetCheckPoint(const int warpTID, const int map)
kWeapon GetWeaponActor(const int weapon)
int16 & ExtraHealth()
should be <= MaxExtraHealth
bool GiveAmmo(const int weapon, const int amount, const bool altAmmo)
set amount to negative values to take ammo
void Victory(const int warpActorID=- 1, const int mapID=- 1)
const int CurrentCheckPoint()
returns warpTID
const int GetWeaponGroup(const int weapon)
const uint16 Buttons() const
returns EnumPlayerButtons
void SetLives(const int amount)
const float GetSpiritualTime() const
void CancelSpiritualTime(float blendTime=1.0f)
if in spirit mode then will set gamespeed back to 1.0f using the passed in blendTime
bool GiveHealth(const int amount, const bool bMortalWound)
Takes into account extra health, and max health values. 0 is full health, negative amounts gives extr...
const int CurrentCheckPointMap()
void CycleNextWeapon(const bool bCheckAmmo=false)
const int PendingWeapon() const
void SetLifeForces(const int amount)
const bool SetWeaponUseAltAmmo(const int weapon, const bool bToggle)
void SetSpiritualTime(const float time, const float blend)
time = time until cancels the effect. Should SetGameSpeed after calling this.
const bool WeaponUsingAltAmmo(const int weapon) const
void ConsumeAmmo(const int ammo, const bool preferredAmmo=true)
int16 & MaxExtraHealth()
should be <= MaxHealth
const int CurrentWeapon() const
const bool Locked() const
uint ButtonHeldTime(const int btn)
btn type is EnumInputActions
bool & SilentCheckPoints(void)
if true won't show checkpoint message or play sound when on a checkpoint area. Gets set back to false...
const kVec3 GetButtonMovement() const
bool & NoLandClearVel()
if true, when doing a hard landing you will not lose your velocity
bool RemoveWeapon(const int weapon)
const kVec3 GetButtonAngles() const
int16 & MaxHealth()
should be >= MaxExtraHealth and ExtraHealth
void SetWeaponGroup(const int weapon, const int group)
Binds this weapon to another weapons index. Example: you made a new pistol weapon at index 14 and wan...
void ChangeWeapon(const int weapon)
const bool HasAmmo(const int weaponID, const bool checkAlt=true) const
if checkAlt is false only checks primary ammo
const bool HasWeapon(const int weaponID) const
bool GiveWeapon(const int weaponID, const int ammo, const bool switchNewWeapon=true)
returns true if gave ammo else returns false because already has full primary ammo....
const bool WeaponAllowUnderwater(const int weapon) const
const int GetAmmo(const int weaponID) const
void ConsumeAltAmmo(const int ammo)