Quick Question about level doors. - A Tricky Carnie - 09-06-2011
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
RE: Quick Question about level doors. - Tanshaydar - 09-06-2011
Code: ////////////////////////////
// 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.
RE: Quick Question about level doors. - A Tricky Carnie - 09-06-2011
(09-06-2011, 01:48 AM)Tanshaydar Wrote: Code: ////////////////////////////
// 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.
|