Frictional Games Forum (read-only)
Using the PlayerInteractCallBack func - 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: Using the PlayerInteractCallBack func (/thread-20356.html)



Using the PlayerInteractCallBack func - Rickvs - 02-16-2013

Hello guys, my name is Rick and I'm a complete noob when it comes to scripting, therefore help would be highly appreciated.

Situation I have in mind:
The player walks to a (locked) door, interacts with it, and suddenly a hallucinated monster appears behind him.

What I've got so far:
The player can interact with the door, the locked sound plays and obviously the door doesn't open, but nothing else happens...

Problem:
In the level editor, I clicked on the door and set the PlayerInteractCallBack tag to MonsterAppears.
In (mapname).hps I have this, copied from the wiki:

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


And of course the enter, leave, and startup fuctions.

This doesn't work. You might me thinking I'm seriously stupid if you see the problem, but I honestly can't find it. Do I need to add more code?


RE: Using the PlayerInteractCallBack func - NaxEla - 02-16-2013

Change:
PHP Code:
void MonsterAppears(string &in asParentstring &in asChildint alState

To:
PHP Code:
void MonsterAppears(string &in asEntity



RE: Using the PlayerInteractCallBack func - Rickvs - 02-16-2013

(02-16-2013, 06:55 PM)NaxEla Wrote: Change:
PHP Code:
void MonsterAppears(string &in asParentstring &in asChildint alState

To:
PHP Code:
void MonsterAppears(string &in asEntity
THANK YOU! Ooh, I can't believe it was that small... You made my day!