Frictional Games Forum (read-only)

Full Version: Enemy hallucinate event
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I'm trying to check wheter an enemy disappears by hallucination.
GetEntityExists doesn't seems to work, the entity might be still active after the vanish.
I did something like this:
PHP Code:
void enemy(string &in asTimer)
{
stuff
if (GetEntityExists("enemy") == false)
{
stuff
 
}
  } 
Nothing happens.
I don't know how GetEnemyStateName should work.
Anyone?
The function only appears to be meant to check if the entity is active. Not the other way around, strangely.

EDIT: If you want something to happen if the enemy disables, use the "OnAutoDisable" function. That's the furthest thing I can come up with.
You could mathematically count the distance between the Player and the monster by using looping timers, GetEntityPosition and GetPlayerPosition (and Pythagorean Theorem), I guess you could skip the Y dimension for simplicity.

Then call SetEnemyIsHallucination or FadeEnemyToSmoke when it gets too close, and at the same time change a GlobalVariable, which would serve as an indicator of the fact whether the enemy is faded to smoke.

It's kind of an overshot for the effect you need, but I'm 99% sure it would work.