Frictional Games Forum (read-only)
[LVL ED] 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: [LVL ED] Level Doors (/thread-24938.html)



Level Doors - ZIEGMEBALLEN - 03-28-2014

I just can't seem to unlock go to other levels but the map file for the next level is correct and the start position is correct look:
Text Entry :
LevelDoor1
StartPosition :
PlayerStartArea_1
Map File:
02_Hall.map
Locked :
Checked
LockedTextCat:
Levels
LockedTextEntry:
LevelDoor1

I created a key at my Cs but when i unlock it, and click my level door, nothing happens...
Extra lang file
<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name = "CustomStoryMain">
<Entry Name = "Description">You Are a guy who's working as a Janitor in A Mansion Where you woke up alone at 6:30 AM. You discovered that there are monster inside and they don't want you to leave the Mansion. Find A Way to Leave the House without dying.</Entry>

</CATEGORY>
<CATEGORY Name = "Inventory">
<Entry Name = "ItemName_SecondRoomKey_1">Key</Entry>
<Entry Name = "ItemDesc_SecondRoomKey_1">Key</Entry>
<Entry Name = "ItemName_HallKey_1">Hall Key</Entry>
<Entry Name = "ItemDesc_HallKey_1">Key to the Hall</Entry>

</CATEGORY>

<CATEGORY Name = "Levels">
<Entry Name = "LevelName_LevelDoor1">To Hall</Entry>
<Entry Name = "LevelText_LevelDoor1">To the Main Hall</Entry>

</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_A1_Name">Discovering</Entry>
<Entry Name="Note_A1_Text">I Woke up at 6:30 where i discovered that i'm alone.[br][br]I Need to Get out of the house, but... [br][br] I Also discovered something...There...Are....Monsters inside. I Need To Leave now and Get help as i am going to die in this house.. [br][br]Is this my last momment ?</Entry>

</CATEGORY>
</LANGUAGE>

My map hps:

void OnStart()
{
AddEntityCollideCallback("Player", "Script_1", "Teleport1", true, 1);
AddUseItemCallback("", "SecondRoomKey_1", "SecondRoom_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "HallKey_1", "LevelDoor1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("SecondRoom_1", false, true);
SetSwingDoorLocked("LevelDoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "SecondRoom_1", 0, false);
PlaySoundAtEntity("", "unlock_door", "LevelDoor1", 0, false);
RemoveItem("SecondRoomKey_1");
RemoveItem("HallKey_1");
}

void Teleport1(string &in asParent, string &in asChild, int alStates)
{
SetEntityActive("TeleportingNG_1", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportingNG_1", 0, false);
AddPropForce("TeleportingNG_1", -10000, 0, 0, "Player");
}
Please help and i will +rep on anyone who can help me


RE: Level Doors - Mudbill - 03-28-2014

When unlocking level doors, you must use the script SetLevelDoorLocked instead of SetSwingDoorLocked. They work a bit differently.
PHP Code:
SetLevelDoorLocked(stringasNamebool abLocked); 



RE: Level Doors - ZIEGMEBALLEN - 03-28-2014

(03-28-2014, 09:54 AM)Mudbill Wrote: When unlocking level doors, you must use the script SetLevelDoorLocked instead of SetSwingDoorLocked. They work a bit differently.
PHP Code:
SetLevelDoorLocked(stringasNamebool abLocked); 

It didn't work it got errored, it says could not load script file..


RE: Level Doors - Mudbill - 03-28-2014

That's probably because you just renamed it, and didn't remove the last boolean parameter. This one only has 2 parameters, whereas the swing door has 3.

Remove the last true part.


RE: Level Doors - ZIEGMEBALLEN - 03-28-2014

(03-28-2014, 10:00 AM)Mudbill Wrote: That's probably because you just renamed it, and didn't remove the last boolean parameter. This one only has 2 parameters, whereas the swing door has 3.

Remove the last true part.

Okay i removed the true part now, now it looks like this:
SetLevelDoorLocked("LevelDoor1", false,);
But it didn't worked


RE: Level Doors - Mudbill - 03-28-2014

You must also remove the comma. That's part of the syntax.


RE: Level Doors - ZIEGMEBALLEN - 03-28-2014

(03-28-2014, 10:05 AM)Mudbill Wrote: You must also remove the comma. That's part of the syntax.

Thanks, it worked but the key is no longer usefull it is unlocked automatically why is that?