Frictional Games Forum (read-only)

Full Version: Spawn a monster
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
Leave it as it is, it should work Smile
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.
Oh, I didn't know to uncheck the active box. Thanks!