Frictional Games Forum (read-only)

Full Version: Spawn Monster upon entering Area
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Me again...

Basically, I want to spawn a monster when the player enters a certain area.
eg. Upon entering area Monster_Spawn, I want a brute (named 'Brute') to spawn.

What is the script to do this?

Thanks!
PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""Monster_Spawn""MyFunc"true1);
}

void MyFunc(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("Brute"true);

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

^ when player enters area


SetEntityActive(string& asName, bool abActive);

^ to spawn the monster.. for example
SetEntityActive("Brute", true);
(03-05-2013, 02:29 PM)DogFood Wrote: [ -> ]void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

^ when player enters area


SetEntityActive(string& asName, bool abActive);

^ to spawn the monster.. for example
SetEntityActive("Brute", true);

Ninja'd you, DogFood. I was here first.
Thanks so much guys! Big Grin Big Grin

Edit: What's the script for despawning a monster? Tongue
serious question?

SetEntityActive("Brute", false);

http://wiki.frictionalgames.com/hpl2/amn..._functions