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
Key to a level door
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#9
RE: Key to a level door

I have thought a workaround:

Make a script area that has the shape of the level door, and name it "AreaLevel". Now, go to the Area panel and search for Player Interact Callback. There, put "Touch" (without quotation marks)
You know you can use items (like keys) in ScriptAreas, right?

Put this in your script:

void OnStart()
{
SetLocalVarInt("Area_locked_level", 1);
SetEntityCallbackFunc("Key", "WhenPicked"); //Key must be the name of your key
}

void WhenPicked (string &in asEntity, string &in asType)
{
SetLocalVarInt("Area_locked_level", 0);
}

void Touch (string &in asEntity)
{
if (GetLocalVarInt("Area_locked_level") == 1)
{
SetMessage("Messages", "Msgname1", 0);
}
if (GetLocalVarInt("Area_locked_level") == 0)
{
SetLevelDoorLocked("Door_1", false);
SetEntityActive("AreaLevel", false);
}
}

The player won't have to use the key by itself, but I think it's a good workaround.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-09-2013, 11:20 AM
Find


Messages In This Thread
Key to a level door - by MaTPlays - 08-08-2013, 09:32 PM
RE: Key to a level door - by DeAngelo - 08-08-2013, 09:38 PM
RE: Key to a level door - by MaTPlays - 08-08-2013, 09:49 PM
RE: Key to a level door - by The chaser - 08-08-2013, 10:25 PM
RE: Key to a level door - by MaTPlays - 08-08-2013, 10:36 PM
RE: Key to a level door - by The chaser - 08-08-2013, 11:07 PM
RE: Key to a level door - by Tomato Cat - 08-09-2013, 12:08 AM
RE: Key to a level door - by MaTPlays - 08-08-2013, 11:10 PM
RE: Key to a level door - by The chaser - 08-09-2013, 11:20 AM
RE: Key to a level door - by MaTPlays - 08-09-2013, 07:18 PM



Users browsing this thread: 1 Guest(s)