Frictional Games Forum (read-only)
Spawning 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Spawning a monster (/thread-8760.html)



Spawning a monster - Lontasm - 06-23-2011

Yes I know.. there is a lot of threads on the forums telling how to spawn a monster when enterin a ScriptArea... but I just dont get it.. been trying for hours and still dont get it...

this is 2 random scripts which I've been trying to get working.... but the quiestion is.. what do I have to do in the editor... unchecked the "Active" box on the monster, but should I write something in the CallbackFunc on the grunt, or anything in the PlayerInterractCallback etc.??

I know the bottom one is not complete... just wanted to see if there is something wrnog here?


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



void CollideTest1(string &in asParent, string &in asChild, int alState)
{

SetEntityActive ("test1_grunt" true)
}

void test1_spawn(string &in asParent , string &in asChild , int alState)



RE: Spawning a monster - rojkish - 06-23-2011

Yes there is. In the beginning of the script there should be one;

Spoiler below!

////////////////////////////
// Run first time starting map
void OnStart()
{

}

And one;

////////////////////////////
// Run when entering map
void OnEnter()
{

}

And finally;

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


When you've got these three, you write all your callbacks into the;

////////////////////////////
// Run first time starting map
void OnStart()
{

}

if you now wanna make so the monster activates just copy this right here:

Spoiler below!

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "SpawnGrunt", "MonsterFunc1", true, 1);
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt", true);
}





RE: Spawning a monster - Lontasm - 06-23-2011

Thank you! Got it working Wink