Frictional Games Forum (read-only)
level doors - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: level doors (/thread-20344.html)



level doors - megsb927 - 02-15-2013

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.


RE: level doors - i3670 - 02-15-2013

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);


RE: level doors - megsb927 - 02-15-2013

(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


RE: level doors - NaxEla - 02-15-2013

Change:
PHP Code:
SetSwingDoorLocked("level_wood_1"falsetrue); 


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



RE: level doors - The chaser - 02-15-2013

(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()
{

}


RE: level doors - megsb927 - 02-15-2013

(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!