Frictional Games Forum (read-only)
Spawn Monster upon entering Area - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Spawn Monster upon entering Area (/thread-20626.html)



Spawn Monster upon entering Area - Hailfiretank - 03-05-2013

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!


RE: Spawn Monster upon entering Area - PutraenusAlivius - 03-05-2013

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

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




RE: Spawn Monster upon entering Area - Nice - 03-05-2013

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);


RE: Spawn Monster upon entering Area - PutraenusAlivius - 03-05-2013

(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.


RE: Spawn Monster upon entering Area - Hailfiretank - 03-05-2013

Thanks so much guys! Big Grin Big Grin

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


RE: Spawn Monster upon entering Area - darksky - 03-05-2013

serious question?

SetEntityActive("Brute", false);

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions