Frictional Games Forum (read-only)

Full Version: How to block a door until.....
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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()
Ok, I think now i know how!

I'm gonna try it...
You can always check for functions at the Frictional games wiki,
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
(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.
Absolutely true... I love it too! =D