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
Level Doors and Text?
SiderealStop Offline
Junior Member

Posts: 32
Threads: 3
Joined: Jun 2012
Reputation: 0
#1
Level Doors and Text?

I'm back with more noobish questions~
Before anyone accuses me of not looking, I have. Anything I've come across, I've either tried to understand and tested myself, or just plainly didn't understand. I've tried tutorials as well, just...really not good at following those and have ended up in errors and stuff. Hehe.

Anyway, here's my problem...or rather question:

I have a key and a level door. I need to have the level door be locked, and the key unlock it and disappear. SO simple, right? I already know how to do that with a normal swing door. That's easy enough. But I can't seem to figure out level doors.

My script so far:


void OnStart()
{
}
void OnEnter()
{
PlayMusic("WarOfTheFools.ogg", true, 2, 0, 10, true);
}



Really not sure where to put stuff, and yes I know...this is a reaaaally noobish question! O_O

One other thing is that I have two doors in that same map. One is the level door I need to unlock with a key, the other is a different level door that I want to be...sorta...locked, but only because the player can't go through without the lantern. How would I set a message to appear for both doors before they're 'unlocked' and how would I 'unlock' the one door when the person picks up the lantern?

Sorry for all the random questions! o-o Thanks in advance!
07-16-2012, 06:52 AM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#2
RE: Level Doors and Text?

I don't fully understand but what I think you want is this.
you want to have two doors one you open when you use a key on it and one to open when you pick up the lantern.
If I'm wrong my bad. but to do what I think you want to do you can use this:
FOR THE LEVEL DOOR
void OnStart()
{
AddUseItemCallback("", "Name_of_Key", "Name_of_Leveldoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Name_of_Leveldoor", false);
PlaySoundAtEntity("", "unlock_door", "Name_of_Leveldoor", 0, false);
RemoveItem("Name_of_Key");
}
||||||Also make sure you have the leveldoorlocked!!!||||||
And use this for the lantern:
void OnStart()
{
SetEntityPlayerInteractCallback("Name_Of_Lantern", "OnLanternPickUp", true);
}
void OnLanternPickUp(string &in item)
{
SetLevelDoorLocked("Name_of_Leveldoor", false);
}
But if you want to make the door open/unlocked but you can't open it you could use:
SetEntityInteractionDisabled(string& asName, bool abDisabled);

on the door. so you can't click on it I hope this helped Big Grin

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
07-16-2012, 09:41 AM
Find




Users browsing this thread: 2 Guest(s)