Frictional Games Forum (read-only)

Full Version: level doors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ok so I start the game in my first map, the door to the second map says locked when you try to open it, then I get the key and use it on the door. I can hear the unlock sound and the key dissapears but when i click on the door it still says locked. In the entity tab the door is checked as locked and the map it goes to is my second map and player start area 1 for the next map but it won't let me go to it.
We won't know what the problem is if you don't post your script. Anyway.

You should use

SetLevelDoorLocked(string& asName, bool abLocked);

NOT

SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);
(02-15-2013, 10:04 PM)i3670 Wrote: [ -> ]We won't know what the problem is if you don't post your script. Anyway.

You should use

SetLevelDoorLocked(string& asName, bool abLocked);

NOT

SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);

void OnStart()
{
AddUseItemCallback("", "Key_1", "level_wood_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood_1", 0, false);
RemoveItem("Key_1");
}

void OnEnter()
{

}

void OnLeave()
{

}
that is my map script I tried changing it to SetLevelDoorLocked and it said fatal error
Change:
PHP Code:
SetSwingDoorLocked("level_wood_1"falsetrue); 


To:
PHP Code:
SetLevelDoorLocked("level_wood_1"false); 
(02-15-2013, 10:14 PM)megsb927 Wrote: [ -> ]
(02-15-2013, 10:04 PM)i3670 Wrote: [ -> ]We won't know what the problem is if you don't post your script. Anyway.

You should use

SetLevelDoorLocked(string& asName, bool abLocked);

NOT

SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);

void OnStart()
{
AddUseItemCallback("", "Key_1", "level_wood_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood_1", 0, false);
RemoveItem("Key_1");
}

void OnEnter()
{

}

void OnLeave()
{

}
that is my map script I tried changing it to SetLevelDoorLocked and it said fatal error

void OnStart()
{
AddUseItemCallback("", "Key_1", "level_wood_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_wood_1", false);
PlaySoundAtEntity("", "unlock_door", "level_wood_1", 0, false);
RemoveItem("Key_1");
}

void OnEnter()
{

}

void OnLeave()
{

}
(02-15-2013, 10:16 PM)NaxEla Wrote: [ -> ]Change:
PHP Code:
SetSwingDoorLocked("level_wood_1"falsetrue); 


To:
PHP Code:
SetLevelDoorLocked("level_wood_1"false); 

this worked thank you!