Base type used by all actors. More...
Public Member Functions | |
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 more references to this actor. | |
kAngle & | Yaw () |
kAngle & | Pitch () |
kAngle & | Roll () |
kVec3 & | Origin () |
Position in world space. | |
kVec3 & | Scale () |
kVec3 & | PrevOrigin () |
void | SetTarget (kActor@ actor) |
kActor | GetTarget () |
void | SetSector (const uint sectorIndex) |
void | Remove () |
Removes the actor and sets stale to true. Actor will only internally be removed when there are no references to this actor. | |
kVec3 & | Velocity () |
kVec3 & | Movement () |
kQuat & | Rotation () |
int16 & | Health () |
int & | Type () |
The actors Type ID. | |
int & | ImpactType () |
EnumImpactType. | |
bool & | IgnoreSectorHeightChange (void) |
if true will not change position(or velocity and movement) when sector height changes. | |
int & | ModelVariation () |
int & | SpeciesMask () |
uint & | Flags () |
EnumActorFlags. | |
const uint | SpawnFlags1 () const |
EnumActorSpawnFlags1. | |
const uint | SpawnFlags2 () const |
EnumActorSpawnFlags2. | |
const uint | SpawnFlags3 () const |
EnumActorSpawnFlags3. | |
const int | TID () const |
float & | Radius () |
float & | Height () |
float & | StepHeight () |
AKA Dead Height. Used for moving up steps, figuring out if in waterheight, and the height of the actor when they are dead so you can still shoot them. | |
float & | WallRadius () |
float & | Gravity () |
float & | Friction () |
float & | AnimSpeed () |
float & | BounceDamp () |
float & | FloorHeight () |
float & | CeilingHeight () |
const int | SectorIndex () |
const int | AreaID () const |
bool | InstanceOf (const kStr &in className) const |
example: InstanceOf("kexPuppet") | |
void | PlaySound (const kStr &in soundPath) |
void | PlaySoundWithLookupID (const int soundID) |
void | StopSound () |
void | StopLoopingSounds () |
const int | GameTicks () const |
kAnimState & | AnimState () |
kRenderModel | RenderModel () |
const bool | InWater () const |
bool | CheckPosition (const kVec3 &in origin) |
checks if the actor can move to this location | |
bool | CheckPosition (const float angle, const float distance) |
calls CheckPosition(kVec3 origin) with location being: Actor.Origin() + (angle*distance*actor.Radius()) | |
float | GetTurnYaw (const kVec3 &in lookAtLocation) const |
float | GetAvoidanceAngle (const kVec3 &in lookAtLocation, const float distance) |
const float | GetWaterHeight () const |
const bool | CanSee (kActor@ actor, const uint excludeClipFlags=0) |
excludeClipFlags to ignore/disable (EnumClipFlags) | |
uint & | ClipFlags () |
EnumClipFlags. | |
kDictMem | Definition () |
get actors def data | |
bool | OnGround () const |
int | GetWaterLevel () const |
EnumWaterLevel. | |
kActor | CastToActor () |
Casts to a kActor. Only used for kPuppet Actor(). | |
kAI | CastToAI () |
Casts to kAI. returns null if isn't a kAI. | |
void | SpawnProjectile (const kStr &in fxPath, const kVec3 &in pos, const kVec3 &in targetLocation, const float maxAngle) |
void | MeleeObject (const kStr &in damageType, const kVec3 &in offset, const float radius) |
void | SpawnFx (const kStr &in fxPath, const kVec3 &in pos) |
void | SpawnFx (const kStr &in fxPath, const kVec3 &in pos, const kQuat &in rot) |
kVec3 | GetTransformedVector (const kVec3 &in vector) |
float | DistanceToPoint (const kVec3 &in point) const |
calls DistanceToPoint(x,y,z) | |
float | DistanceToPoint (const float x, const float y, const float z) const |
actors point is in the center | |
void | InflictGenericDamage (kActor@ inflictor, const int damage) |
void | InflictDamage (kActor@ inflictor, const kStr &in damageDef) |
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) |
kScriptObject | ScriptObject () |
void | MoveToPosition (const float x, const float y) |
Moves the world object to a desired position at xy coordinates. Movement will use hitscan collision for quick collision tests. | |
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 then returns true. | |
void | SetPosition (const kVec3 &in pos) |
best way to set an actors position, will also set the sector and clearinterpolation | |
const int16 | SpawnParams (const int paramID) const |
Get a map actors param value. | |
const float | GetCeilingHeight () const |
calculates the ceiling height from the actors sector and origin. Returns 0 if not in a sector. | |
const float | GetFloorHeight () const |
calculates the floor height from the actors sector and origin. Returns 0 if not in a sector. | |
void | RunFxEvent (const kStr &in fxEventName) |
Runs an ActorFX event. Example: RunFxEvent("Enemy_Freeze");. | |
const int | GetSectorIndexAtLocation (const kVec3 &in pos, uint excludeClipFlags=0) |
excludeClipFlags to ignore/disable (EnumClipFlags) | |
void | MarkPersistentBit (const bool clear) |
const bool | IsPersistentMarked () |
void | SetHeadTrackTarget (kActor@ actor) |
void | ClearInterpolation () |
void | AutomapToggle (const bool show) |
Use with Game.AutomapCustom(true);. | |
void | SetAutomapColor (const int r, const int g, const int b) |
void | SetSpawnParams (const int param, const int16 value) |
Sets the actors param value. all params are int16. | |
void | SetSpawnFlags1 (const uint flags) |
EnumActorSpawnFlags1. | |
void | SetSpawnFlags2 (const uint flags) |
EnumActorSpawnFlags2. | |
void | SetSpawnFlags3 (const uint flags) |
EnumActorSpawnFlags3. | |
void | SetupSpawnParams () |
call after setting your actors spawnflags for them to take effect on the kActor | |
void | SetCustomDeadHeight (const bool bUse, const float height) |
Height of actor when they are dead. Only for non map actors. (actors spawned with ActorFactory) | |
const float | GetCustomDeadHeight () |
const bool | GetUsingCustomDeadHeight () |
const bool | OverridingKeyTouchTID () |
used only for key pickups | |
const int16 | GetOverrideKeyTouchTID () |
used only for key pickups | |
void | OverrideKeyTouchTID (const bool bOverride, const int16 tid) |
used only for key pickups to tell what key it is in the hub | |
bool & | SkipKeyTouchCinema () |
used only for key pickups | |
void | SetModel (kStr &in modelFile, kStr &in animFile) |
a way to set the model/anim for actors that had no model set previously | |
bool & | TriggerInvincibility () |
Can't damage if true. Gets set to true if enemy has trigger anim and false when activated. | |
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 min/max values of (-128, -128, -128) (128, 128, 128) | |
const int | MapActorIndex () const |
Returns -1 if not a map actor. | |
int & | DifficultyMode () |
The difficulty this actor is currently set to. | |
void | OverrideOnDamageValue (const int damage, const bool bOverride=true) |
call in OnPreDamage | |
bool & | NoKnockBack () |
Will not receive knock back movement from things like the alien weapon for example. | |
const float | BaseHeight () const |
height of actor when spawned or when kAI regenerated | |
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 | |
float & | AirFriction () |
default = 1.0f | |
float & | WaterFriction () |
default = 0.5f (same as Friction) | |
float & | Mass () |
default = GAME_SCALE * 1.0f | |
const float | GetSkyHeight () const |
bool & | ChildOfTarget (void) |
if this actors Target is an actor that belongs to the owner of the Fx, explosion or melee attack then won't collide/get damaged. | |
kVec3 | DamageOrigin (void) const |
The Origin point of the attacker (Fx, Actor, or null (returns this actors origin in that case)) who damaged this actor last. Gets set before OnPreDamage. | |
kVec3 | DamageVelocity (void) const |
The Velocity of the attacker (Fx, Actor, or null (returns this actors velocity in that case)) who damaged this actor last. Gets set before OnPreDamage. | |
const bool | CanSee (kPuppet@ puppet, const uint excludeClipFlags=0) |
excludeClipFlags to ignore/disable (EnumClipFlags). Note: This function that takes in the kPuppet arg is only available for kActor, not for kPuppet or kAI or kWeapon. | |
Base type used by all actors.
Definition at line 1029 of file t1_scriptAPI.cpp.
float & kActor::AirFriction | ( | ) |
default = 1.0f
float & kActor::AnimSpeed | ( | ) |
kAnimState & kActor::AnimState | ( | ) |
const int kActor::AreaID | ( | ) | const |
void kActor::AutomapToggle | ( | const bool | show | ) |
Use with Game.AutomapCustom(true);.
const float kActor::BaseHeight | ( | ) | const |
height of actor when spawned or when kAI regenerated
float & kActor::BounceDamp | ( | ) |
const bool kActor::CanSee | ( | kActor@ | actor, |
const uint | excludeClipFlags = 0 ) |
excludeClipFlags to ignore/disable (EnumClipFlags)
const bool kActor::CanSee | ( | kPuppet@ | puppet, |
const uint | excludeClipFlags = 0 ) |
float & kActor::CeilingHeight | ( | ) |
bool kActor::CheckPosition | ( | const float | angle, |
const float | distance ) |
calls CheckPosition(kVec3 origin) with location being: Actor.Origin() + (angle*distance*actor.Radius())
bool kActor::CheckPosition | ( | const kVec3 &in | origin | ) |
checks if the actor can move to this location
bool & kActor::ChildOfTarget | ( | void | ) |
if this actors Target is an actor that belongs to the owner of the Fx, explosion or melee attack then won't collide/get damaged.
void kActor::ClearInterpolation | ( | ) |
uint & kActor::ClipFlags | ( | ) |
kVec3 kActor::DamageOrigin | ( | void | ) | const |
The Origin point of the attacker (Fx, Actor, or null (returns this actors origin in that case)) who damaged this actor last. Gets set before OnPreDamage.
kVec3 kActor::DamageVelocity | ( | void | ) | const |
The Velocity of the attacker (Fx, Actor, or null (returns this actors velocity in that case)) who damaged this actor last. Gets set before OnPreDamage.
kDictMem kActor::Definition | ( | ) |
get actors def data
int & kActor::DifficultyMode | ( | ) |
The difficulty this actor is currently set to.
float kActor::DistanceToPoint | ( | const float | x, |
const float | y, | ||
const float | z ) const |
actors point is in the center
float kActor::DistanceToPoint | ( | const kVec3 &in | point | ) | const |
calls DistanceToPoint(x,y,z)
uint & kActor::Flags | ( | ) |
float & kActor::FloorHeight | ( | ) |
float & kActor::Friction | ( | ) |
const int kActor::GameTicks | ( | ) | const |
float kActor::GetAvoidanceAngle | ( | const kVec3 &in | lookAtLocation, |
const float | distance ) |
actor must not be sleeping and have a model set and not be a pickup. otherwise will return default min/max values of (-128, -128, -128) (128, 128, 128)
const float kActor::GetCeilingHeight | ( | ) | const |
calculates the ceiling height from the actors sector and origin. Returns 0 if not in a sector.
const float kActor::GetCustomDeadHeight | ( | ) |
const float kActor::GetFloorHeight | ( | ) | const |
calculates the floor height from the actors sector and origin. Returns 0 if not in a sector.
const int16 kActor::GetOverrideKeyTouchTID | ( | ) |
used only for key pickups
const int kActor::GetSectorIndexAtLocation | ( | const kVec3 &in | pos, |
uint | excludeClipFlags = 0 ) |
excludeClipFlags to ignore/disable (EnumClipFlags)
const float kActor::GetSkyHeight | ( | ) | const |
kActor kActor::GetTarget | ( | ) |
float kActor::GetTurnYaw | ( | const kVec3 &in | lookAtLocation | ) | const |
const bool kActor::GetUsingCustomDeadHeight | ( | ) |
const float kActor::GetWaterHeight | ( | ) | const |
int kActor::GetWaterLevel | ( | ) | const |
float & kActor::Gravity | ( | ) |
int16 & kActor::Health | ( | ) |
float & kActor::Height | ( | ) |
bool & kActor::IgnoreSectorHeightChange | ( | void | ) |
if true will not change position(or velocity and movement) when sector height changes.
int & kActor::ImpactType | ( | ) |
void kActor::InflictGenericDamage | ( | kActor@ | inflictor, |
const int | damage ) |
bool kActor::InstanceOf | ( | const kStr &in | className | ) | const |
example: InstanceOf("kexPuppet")
void kActor::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 ) |
const bool kActor::InWater | ( | ) | const |
const bool kActor::IsPersistentMarked | ( | ) |
const bool kActor::IsStale | ( | ) | const |
Actor is marked as removed and is waiting to be freed from memory when it next checks if there are no more references to this actor.
const int kActor::MapActorIndex | ( | ) | const |
Returns -1 if not a map actor.
void kActor::MarkPersistentBit | ( | const bool | clear | ) |
float & kActor::Mass | ( | ) |
default = GAME_SCALE * 1.0f
int & kActor::ModelVariation | ( | ) |
kVec3 & kActor::Movement | ( | ) |
void kActor::MoveToPosition | ( | const float | x, |
const float | y ) |
Moves the world object to a desired position at xy coordinates. Movement will use hitscan collision for quick collision tests.
bool & kActor::NoKnockBack | ( | ) |
Will not receive knock back movement from things like the alien weapon for example.
bool kActor::OnGround | ( | ) | const |
kVec3 & kActor::Origin | ( | ) |
Position in world space.
void kActor::OverrideKeyTouchTID | ( | const bool | bOverride, |
const int16 | tid ) |
used only for key pickups to tell what key it is in the hub
void kActor::OverrideOnDamageValue | ( | const int | damage, |
const bool | bOverride = true ) |
call in OnPreDamage
const bool kActor::OverridingKeyTouchTID | ( | ) |
used only for key pickups
kAngle & kActor::Pitch | ( | ) |
void kActor::PlaySound | ( | const kStr &in | soundPath | ) |
void kActor::PlaySoundWithLookupID | ( | const int | soundID | ) |
kVec3 & kActor::PrevOrigin | ( | ) |
float & kActor::Radius | ( | ) |
bool kActor::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 then returns true.
void kActor::Remove | ( | ) |
Removes the actor and sets stale to true. Actor will only internally be removed when there are no references to this actor.
kRenderModel kActor::RenderModel | ( | ) |
kAngle & kActor::Roll | ( | ) |
kQuat & kActor::Rotation | ( | ) |
void kActor::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 kActor::RunFxEvent | ( | const kStr &in | fxEventName | ) |
Runs an ActorFX event. Example: RunFxEvent("Enemy_Freeze");.
kVec3 & kActor::Scale | ( | ) |
kScriptObject kActor::ScriptObject | ( | ) |
const int kActor::SectorIndex | ( | ) |
void kActor::SetAutomapColor | ( | const int | r, |
const int | g, | ||
const int | b ) |
void kActor::SetCustomDeadHeight | ( | const bool | bUse, |
const float | height ) |
Height of actor when they are dead. Only for non map actors. (actors spawned with ActorFactory)
void kActor::SetHeadTrackTarget | ( | kActor@ | actor | ) |
a way to set the model/anim for actors that had no model set previously
void kActor::SetPosition | ( | const kVec3 &in | pos | ) |
best way to set an actors position, will also set the sector and clearinterpolation
void kActor::SetSector | ( | const uint | sectorIndex | ) |
void kActor::SetSpawnFlags1 | ( | const uint | flags | ) |
void kActor::SetSpawnFlags2 | ( | const uint | flags | ) |
void kActor::SetSpawnFlags3 | ( | const uint | flags | ) |
void kActor::SetSpawnParams | ( | const int | param, |
const int16 | value ) |
Sets the actors param value. all params are int16.
param | (0) Target ID -32768..32767 (1) Trigger Anim 0..255 (2) Health -32768..32767 (3) Max Regenerations -32768..32767 (4) Attach Chance 0..255 (5) Texture -128..127 (6) Params 2 -128..127 (7) Params 1 -128..127 |
value |
void kActor::SetTarget | ( | kActor@ | actor | ) |
void kActor::SetupSpawnParams | ( | ) |
call after setting your actors spawnflags for them to take effect on the kActor
bool & kActor::SkipKeyTouchCinema | ( | ) |
used only for key pickups
const uint kActor::SpawnFlags1 | ( | ) | const |
const uint kActor::SpawnFlags2 | ( | ) | const |
const uint kActor::SpawnFlags3 | ( | ) | const |
const int16 kActor::SpawnParams | ( | const int | paramID | ) | const |
Get a map actors param value.
paramID | (0) Target ID -32768..32767 (1) Trigger Anim 0..255 (2) Health -32768..32767 (3) Max Regenerations -32768..32767 (4) Attach Chance 0..255 (5) Texture -128..127 (6) Params 2 -128..127 (7) Params 1 -128..127 |
void kActor::SpawnProjectile | ( | const kStr &in | fxPath, |
const kVec3 &in | pos, | ||
const kVec3 &in | targetLocation, | ||
const float | maxAngle ) |
int & kActor::SpeciesMask | ( | ) |
float & kActor::StepHeight | ( | ) |
AKA Dead Height. Used for moving up steps, figuring out if in waterheight, and the height of the actor when they are dead so you can still shoot them.
void kActor::StopLoopingSounds | ( | ) |
void kActor::StopSound | ( | ) |
const int kActor::TID | ( | ) | const |
bool & kActor::TriggerInvincibility | ( | ) |
Can't damage if true. Gets set to true if enemy has trigger anim and false when activated.
int & kActor::Type | ( | ) |
The actors Type ID.
kVec3 & kActor::Velocity | ( | ) |
float & kActor::WallRadius | ( | ) |
float & kActor::WaterFriction | ( | ) |
default = 0.5f (same as Friction)
kAngle & kActor::Yaw | ( | ) |