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
Quick Question about level doors.
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#1
Quick Question about level doors.

Hi, I'm working on a Custom Story (Suprise!) and I have a locked Level door and I want to make sure my script is correct, so the door can be unlocked, so here it is:
Quote:////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_2", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_3", "level_celler_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_2");

}
void SetLevelDoorLocked(string& asName, bool abLocked)
{
SetLevelDoorLocked("level_celler_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_celler_1", 0, false);
RemoveItem("Key_3");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

And on a somewhat related note, how do I name a level door, and how do I set text for when any kind of door is locked?

Thanks in advance

09-06-2011, 01:43 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Quick Question about level doors.

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_2", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_3", "level_celler_1", "KeyOnLevelDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_2");

}
void KeyOnLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_celler_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_celler_1", 0, false);
RemoveItem("key_3");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}


You can set texts in level editor, level door entity settings. You need to specify category and entry from your language file.

(This post was last modified: 09-06-2011, 01:49 AM by Tanshaydar.)
09-06-2011, 01:48 AM
Website Find
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#3
RE: Quick Question about level doors.

(09-06-2011, 01:48 AM)Tanshaydar Wrote:
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_2", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_3", "level_celler_1", "KeyOnLevelDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_2");

}
void KeyOnLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_celler_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_celler_1", 0, false);
RemoveItem("key_3");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}


You can set texts in level editor, level door entity settings. You need to specify category and entry from your language file.
thanks for the help.

09-06-2011, 01:57 AM
Find




Users browsing this thread: 1 Guest(s)