Frictional Games Forum (read-only)
How to block a door until..... - 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: How to block a door until..... (/thread-16176.html)



How to block a door until..... - iFondue - 06-15-2012

Hi everyone, I am still working on my custom story. I already have two maps, and I'm totally happy with them.

What I want to create is, that the player can't leave the room through the door until he picked up the lantern. And If he wants to leave the room, before he picked up the lantern I would like to set a message like. "Maybe I should search for the lantern..." or something like that.
I'm not a newcomer at scripting, but I would be glad if someone could tell me which functions I have to use Smile


Greets, and Thanks!


-iFondue


RE: How to block a door until..... - MaZiCUT - 06-15-2012

I belive it's something like, player pick up entity: Set the door you want locked : ??? : profit!


I'm sorry i don't have time to script this but i just gave you an example, or more of how it should be.


make sure you make AddEntityPlayerCollidecallback under Void OnStart()


RE: How to block a door until..... - iFondue - 06-15-2012

Ok, I think now i know how!

I'm gonna try it...


RE: How to block a door until..... - MaZiCUT - 06-15-2012

You can always check for functions at the Frictional games wiki,


RE: How to block a door until..... - iFondue - 06-15-2012

Yes I know, I was on Frictional Games Wiki, but didn't think that it is possible to sxript it so easy...

Thanks, it worked absolutely perfect.

If other people have the same problem as me, here is how you should script it:

1. First lock the door in the level editor.


void OnStart()
{
SetEntityCallbackFunc("lantern", "OnPickup");
}

void OnEnter()

void OnPickup(string &in asEntity, string &in type)
{
SetSwingDoorLocked("door", false, true);
}



Thats all! If you want to know how to do the message part watch here!


Hope It was helpful...

Greets, and thank you CrazyArts!

-iFondue



RE: How to block a door until..... - MaZiCUT - 06-15-2012

(06-15-2012, 08:20 PM)iFondue Wrote: Yes I know, I was on Frictional Games Wiki, but didn't think that it is possible to sxript it so easy...

Thanks, it worked absolutely perfect.

If other people have the same problem as me, here is how you should script it:

1. First lock the door in the level editor.


void OnStart()
{
SetEntityCallbackFunc("lantern", "OnPickup");
}

void OnEnter()

void OnPickup(string &in asEntity, string &in type)
{
SetSwingDoorLocked("door", false, true);
}



Thats all! If you want to know how to do the message part watch here!


Hope It was helpful...

Greets, and thank you CrazyArts!

-iFondue
No problem, that's why i love anglescript, it's easy and even a noob like me can teach it out.


RE: How to block a door until..... - iFondue - 06-16-2012

Absolutely true... I love it too! =D