Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to block a door until.....
iFondue Offline
Junior Member

Posts: 28
Threads: 6
Joined: Apr 2012
Reputation: 0
#1
How to block a door until.....

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
06-15-2012, 06:56 PM
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#2
RE: How to block a door until.....

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()

Hi.
06-15-2012, 07:16 PM
Website Find
iFondue Offline
Junior Member

Posts: 28
Threads: 6
Joined: Apr 2012
Reputation: 0
#3
RE: How to block a door until.....

Ok, I think now i know how!

I'm gonna try it...
06-15-2012, 07:22 PM
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#4
RE: How to block a door until.....

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

Hi.
06-15-2012, 07:42 PM
Website Find
iFondue Offline
Junior Member

Posts: 28
Threads: 6
Joined: Apr 2012
Reputation: 0
#5
RE: How to block a door until.....

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
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#6
RE: How to block a door until.....

(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.

Hi.
06-15-2012, 10:35 PM
Website Find
iFondue Offline
Junior Member

Posts: 28
Threads: 6
Joined: Apr 2012
Reputation: 0
#7
RE: How to block a door until.....

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

Working on a Custom Story: "Untold Mysteries"
30% Complete!


06-16-2012, 03:54 PM
Find




Users browsing this thread: 1 Guest(s)