Class "EntityNPC"

Functions

AnimWalkFrame () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void AnimWalkFrame ( string HorizontalAnim, string VerticalAnim, float SpeedThreshold ) {: .copyable aria-label='Functions' }

CalcTargetPosition () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Vector CalcTargetPosition ( float DistanceLimit ) {: .copyable aria-label='Functions' }

CanBeDamagedFromVelocity () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean CanBeDamagedFromVelocity ( Vector Velocity ) {: .copyable aria-label='Functions' }

CanReroll () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean CanReroll ( ) {: .copyable aria-label='Functions' }

FireBossProjectiles () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityProjectile FireBossProjectiles ( int NumProjectiles, Vector TargetPos, float TrajectoryModifier, ProjectileParams Params ) {: .copyable aria-label='Functions' }

fire a number of projectiles, optionally targeting the player direction is randomized, or slightly randomized when targeting the player FallingAccelModifier can be used to make projectiles fall faster to the ground returns a pointer to the projectile spawned last (useful e.g. when NumProjectiles=1)

FireProjectiles () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void FireProjectiles ( Vector Pos, Vector Velocity, ProjectilesMode Mode, ProjectileParams Params ) {: .copyable aria-label='Functions' }

GetAliveEnemyCount () {: aria-label='Functions' }

{: .abp .tooltip .badge }

int GetAliveEnemyCount ( ) {: .copyable aria-label='Functions' }

Used to redirect close door enemies to any enemies for friendly npcs.

GetBossColorIdx () {: aria-label='Functions' }

{: .abp .tooltip .badge }

int GetBossColorIdx ( ) {: .copyable aria-label='Functions' }

???- note "Notes" This will return the boss color idx reduced by 1. To get the actual color as set in bosscolors.xml, add +1 to the result.

GetChampionColorIdx () {: aria-label='Functions' }

{: .abp .tooltip .badge }

int GetChampionColorIdx ( ) {: .copyable aria-label='Functions' }

???- note "Notes" A list of Champion colors can be found here : ChampionColorIdx

GetPlayerTarget () {: aria-label='Functions' }

{: .abp .tooltip .badge }

Entity GetPlayerTarget ( ) {: .copyable aria-label='Functions' }

if there are no modifiers (best friend) this will return the player

IsBoss () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean IsBoss ( ) {: .copyable aria-label='Functions' }

IsChampion () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean IsChampion ( ) {: .copyable aria-label='Functions' }

KillUnique () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void KillUnique ( ) {: .copyable aria-label='Functions' }

For entities with unique death animation, like Flush! vs poop enemies.

MakeChampion () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void MakeChampion ( int Seed ) {: .copyable aria-label='Functions' }

Forces a non champion to become a champion, resets hp to max hp.

???- note "Notes" Hard to use because there are millions of possible seeds to input here.Use Morph() to change the champion Color instead!

MakeSplat () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityEffect MakeSplat ( float Size ) {: .copyable aria-label='Functions' }

Morph () {: aria-label='Functions' }

{: .abp .tooltip .badge }

boolean Morph ( EntityType , int Variant, int SubType, int ChampionColorIdx ) {: .copyable aria-label='Functions' }

Morph the current entity into another one. ChampionColorIdx can be used to turn the entity into a champion. Use :::lua -1 to turn it into a regular entity. A list of Champion colors can be found here : ChampionColorIdx

???- example "Example Code" This code turns an entity into a gaper.

    entity:ToNPC():Morph(EntityType.ENTITY_GAPER , 0, 0,-1)

PlaySound () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void PlaySound ( SoundEffect ID, float Volume, int FrameDelay, boolean Loop, float Pitch ) {: .copyable aria-label='Functions' }

QueryNPCsGroup () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityList QueryNPCsGroup ( int GroupIdx ) {: .copyable aria-label='Functions' }

QueryNPCsSpawnerType () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityList QueryNPCsSpawnerType ( EntityType SpawnerType, EntityType Type, boolean OnlyEnemies ) {: .copyable aria-label='Functions' }

QueryNPCsType () {: aria-label='Functions' }

{: .abp .tooltip .badge }

EntityList QueryNPCsType ( EntityType Type, int Variant ) {: .copyable aria-label='Functions' }

ResetPathFinderTarget () {: aria-label='Functions' }

{: .abp .tooltip .badge }

void ResetPathFinderTarget ( ) {: .copyable aria-label='Functions' }

ThrowSpider () {: aria-label='Functions' }

{: .static .tooltip .badge } {: .abp .tooltip .badge }

static ThrowSpider ( Vector Position, Entity Spawner, Vector TargetPos, boolean Big, float YOffset ) {: .copyable aria-label='Functions' }

Variables

CanShutDoors {: aria-label='Variables' }

{: .abp .tooltip .badge }

boolean CanShutDoors {: .copyable aria-label='Variables' }

ChildNPC {: aria-label='Variables' }

{: .abp .tooltip .badge }

EntityNPC ChildNPC {: .copyable aria-label='Variables' }

EntityRef {: aria-label='Variables' }

{: .abp .tooltip .badge }

Entity EntityRef {: .copyable aria-label='Variables' }

GroupIdx {: aria-label='Variables' }

{: .abp .tooltip .badge }

int GroupIdx {: .copyable aria-label='Variables' }

Used to identify multichunks groups.

I1 {: aria-label='Variables' }

{: .abp .tooltip .badge }

int I1 {: .copyable aria-label='Variables' }

general usage ints for ai_

I2 {: aria-label='Variables' }

{: .abp .tooltip .badge }

int I2 {: .copyable aria-label='Variables' }

same as m_I1

ParentNPC {: aria-label='Variables' }

{: .abp .tooltip .badge }

EntityNPC ParentNPC {: .copyable aria-label='Variables' }

parent entity, for multi-entity NPCs like Larry Jr.

Pathfinder {: aria-label='Variables' }

{: .abp .tooltip .badge }

PathFinder Pathfinder {: .copyable aria-label='Variables' }

ProjectileCooldown {: aria-label='Variables' }

{: .abp .tooltip .badge }

int ProjectileCooldown {: .copyable aria-label='Variables' }

projectiles can fire again when it reaches 0

ProjectileDelay {: aria-label='Variables' }

{: .abp .tooltip .badge }

int ProjectileDelay {: .copyable aria-label='Variables' }

>0: projectile will be fired in n frames

Scale {: aria-label='Variables' }

{: .abp .tooltip .badge }

float Scale {: .copyable aria-label='Variables' }

State {: aria-label='Variables' }

{: .abp .tooltip .badge }

int State {: .copyable aria-label='Variables' }

StateFrame {: aria-label='Variables' }

{: .abp .tooltip .badge }

int StateFrame {: .copyable aria-label='Variables' }

V1 {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vector V1 {: .copyable aria-label='Variables' }

general usage for ai_* functions, initialized to (0,0)

V2 {: aria-label='Variables' }

{: .abp .tooltip .badge }

Vector V2 {: .copyable aria-label='Variables' }

like m_V1, in case we need two of those

Last updated