Frictional Games Forum (read-only)
Problem with scripting monsters - 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: Problem with scripting monsters (/thread-16666.html)



Problem with scripting monsters - The chaser - 07-01-2012

Hello everyone:
I'm making a very simple map, "The chasing", with only one monster. The objective is that when the player collides with the script area, a monsters appears. It must be very simple, but i've made the script and it doesn't work.
Here is the script:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);

}

void OnEnter ()
{

}

void OnLeave

{

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

I don't know what's wrong, so i would like a lot a bit of help.


RE: Problem with scripting monsters - Cruzore - 07-01-2012

OnLeave is missing (), and you should set the () at OnEnter right after it, just in case...


RE: Problem with scripting monsters - EXAWOLT - 07-01-2012

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}
i dont think you want the monster to appear when leaving the map?Wink


RE: Problem with scripting monsters - Demondays1 - 07-01-2012

Copy and paste this:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

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

void OnEnter ()
{

}

void OnLeave()

{

}


RE: Problem with scripting monsters - LulleBulle - 07-02-2012

(07-01-2012, 10:44 PM)EXAWOLT Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}
i dont think you want the monster to appear when leaving the map?Wink
That wasn't his error, he just had typos, he forgot the closing bracket in the monster function and also the () at OnLeave.


RE: Problem with scripting monsters - EXAWOLT - 07-02-2012

doesn´t writing in OnLeave() means it happens when leaving map?


RE: Problem with scripting monsters - The chaser - 07-02-2012

I've tried the script:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

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

void OnEnter ()
{

}

void OnLeave()

{

}

It doesn't work. I think it's ok, what could be wrong?


RE: Problem with scripting monsters - Cruzore - 07-02-2012

Just in case since I don't know if it is needed, but put the () right after OnEnter, not a space between. Just in case.


RE: Problem with scripting monsters - Your Computer - 07-02-2012

Are the MAP and HPS files named to match each other? Are you sure it is servant_grunt_2 that you're trying to activate?


RE: Problem with scripting monsters - The chaser - 07-02-2012

Thanks everyone, i solved the problem. The HPS and MAP files didn't have the same name. But thanks everyone, really, this forum is awesome.