Frictional Games Forum (read-only)

Full Version: lock door help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a locked level door, but i cant use my key on it to unlock it, here is my script for it..
PHP Code:
void OnStart()
{
    
AddUseItemCallback("""key_tower_1""door_2""UsedKeyUpstairs"true);
}

void UsedKeyUpstairs(string &in asItemstring &in asEntity)
{
    
SetLevelDoorLocked("door_2",false);
    
PlaySoundAtEntity("""unlock_door""door_2"0false);
    
RemoveItem("key_tower_1");
    
SetLevelDoorLockedText("door_2""Levels""Upstairs");

Is something wrong here?
(04-06-2011, 06:27 AM)Itskody Wrote: [ -> ]I have a locked level door, but i cant use my key on it to unlock it, here is my script for it..
PHP Code:
void OnStart()
{
    
AddUseItemCallback("""key_tower_1""door_2""UsedKeyUpstairs"true);
}

void UsedKeyUpstairs(string &in asItemstring &in asEntity)
{
    
SetLevelDoorLocked("door_2",false);
    
PlaySoundAtEntity("""unlock_door""door_2"0false);
    
RemoveItem("key_tower_1");
    
SetLevelDoorLockedText("door_2""Levels""Upstairs");

Is something wrong here?

The doors you're trying to unlock are level doors? Not swing doors?
(04-06-2011, 06:37 AM)Russ Money Wrote: [ -> ]
(04-06-2011, 06:27 AM)Itskody Wrote: [ -> ]I have a locked level door, but i cant use my key on it to unlock it, here is my script for it..
PHP Code:
void OnStart()
{
    
AddUseItemCallback("""key_tower_1""door_2""UsedKeyUpstairs"true);
}

void UsedKeyUpstairs(string &in asItemstring &in asEntity)
{
    
SetLevelDoorLocked("door_2",false);
    
PlaySoundAtEntity("""unlock_door""door_2"0false);
    
RemoveItem("key_tower_1");
    
SetLevelDoorLockedText("door_2""Levels""Upstairs");

Is something wrong here?

The doors you're trying to unlock are level doors? Not swing doors?

Yes i have it set so i need to get a key to unlock a level door to a different area. This is the only locked level door i will be using and for some reason i cant get it working
Just to verify, is the problem, not being able to use the key on the door or the key isn't unlocking the door?
(04-06-2011, 06:40 AM)Russ Money Wrote: [ -> ]Just to verify, is the problem, not being able to use the key on the door or the key isn't unlocking the door?

not being able to use the key on the door, the names atr all right, and i have done this like 10 times before unlocking other stuff, but for some reason the door doesnt wantto unlock... ill tell you what my map is..


My guy goes through the first map and at the end, there are 2 doors, one is the study and one is upstairs, (both level doors), the upstairs door is locked but the study door isnt,. so you have to go through the study door to the second map to get the key for the upstairs door. but when i get the key and come back to the first map, the key doesnt unlock the upstairs door to the third map... lol get it?

soo

Map 1 > Map 2 > Map 1 > Map 3.

iuno how to explain it any other way
Yeah, I understand what you mean. Are you sure the doors are named correctly and match in your script? Because I notice that in your script, after you unlock door_2, it triggers a: SetLevelDoorLockedText("door_2", "Levels", "Upstairs");
(04-06-2011, 06:48 AM)Russ Money Wrote: [ -> ]Yeah, I understand what you mean. Are you sure the doors are named correctly and match in your script? Because I notice that in your script, after you unlock door_2, it triggers a: SetLevelDoorLockedText("door_2", "Levels", "Upstairs");

yes im sure, and that doesnt matter the order, all 4 of those happens at the same time, and only when the door is locked it will show that text. butt. ill delete that part and try it without it
Nope it doesnt matter, still says its lock. lol
wait would it work if i put the

AddUseItemCallback("", "key_tower_1", "door_2", "UsedKeyUpstairs", true);

to void OnEnter? ill try that
yep that fixed itt
Strange that fixed it, but okay! Good deal.