Hey everyone,
I'm completely new to scripting, which makes me a total noob.
However, currently I'm stuck on a idea and I hope you can help me out.
Here's what I wanna do:
The player enters a room in which he can find the lantern. Once he has picked up the lantern and comes near the door, he walks into a script area which makes the door slam closed.
The lantern item is called "lantern", the area is called "lanternarea", the door is called "lanternarea_door".
Here's what I worked out so far:
void OnEnter()
{
AddEntityCollideCallback("Player", "lanternarea", "func_lanternarea", true, 1);
}
void func_lanternarea(string &in asParent, string &in asChild, int alState)
{
if(HasItem("lantern")==true)
{
SetSwingDoorClosed("lanternarea_door", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
}
The map starts without any error messages, but when I walk into the area nothing happens.
Where exactly did I go wrong?
I hope someone can help me out.
Cheers