Frictional Games Forum (read-only)
Spawn a monster - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Spawn a monster (/thread-8620.html)



Spawn a monster - Funman - 06-15-2011

Here is my code to spawn a monster:

void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt" , true);
}


What do I need to fill in the void MonsterFunc1 line to make it work?


RE: Spawn a monster - Nye - 06-15-2011

Leave it as it is, it should work Smile


RE: Spawn a monster - Roenlond - 06-15-2011

Spawn an enemy in the editor, uncheck the active box and name him "servant_grunt" (crucial that it's exactly the same as in the code), spawn a script area named ScriptArea_1 and save the .hps as the same mapname+.hps and it should work.


RE: Spawn a monster - Funman - 06-15-2011

Oh, I didn't know to uncheck the active box. Thanks!