Frictional Games Forum (read-only)
Help ;) solved! - 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: Help ;) solved! (/thread-21165.html)

Pages: 1 2


RE: Help ;) solved! - VeNoMzTeamHysterical - 04-15-2013

I was not home and i trough it would work but it doesn't

Here is current script.

Spoiler below!

////////////////////////////
// Run first time starting map
void OnStart()
{




    SetLocalVarInt("CellarDoorOpen", 0);
    SetLocalVarInt("FirstTimeCellar", 1);
    
    AddUseItemCallback("", "Cellar_Key", "ScriptArea_2", "OpenCellarDoor1", true);
    SetEntityPlayerInteractCallback("ScriptArea_2", "EnterCellar", false);
    SetEntityPlayerInteractCallback("ScriptArea_3", "LeaveCellar", false);
SetEntityPlayerInteractCallback("Teleport_Intro_Cave", "EnterCave", true);










void OpenCellarDoor1(string &in asItem, string &in asEntity)
{
    SetLocalVarInt("CellarDoorOpen", 1);
    PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
}




void EnterCellar(string &in asEntity)
{
    if(GetLocalVarInt("CellarDoorOpen") != 1) {
        SetMessage("Messages", "DoorLocked", 0);
        return;
    }
    
    TeleportPlayer("InsideCellar");
    
    if(GetLocalVarInt("FirstTimeCellar") == 1) {
        SetMessage("Messages", "EnteringTheCellar", 0);
        SetLocalVarInt("FirstTimeCellar", 0);
    }
}




void LeaveCellar(string &in asEntity)
{
    TeleportPlayer("OutsideCellar");
}




void EnterCave (string &in asParent, string &in asChild, int alState)
{
if(HasItem("lantern")) {
    TeleportPlayer("InsideCave");
}
else {
    SetMessage("Messages", "NeedLantern", 4);
}




}
////////////////////////////
// Run when entering map
void OnEnter()
{    
    AutoSave();
}




////////////////////////////
// Run when leaving map
void OnLeave()
{






LANG

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">[br][br][br][br][br][br][br][br][br][br][br][br][br][br][br]</Entry>
</CATEGORY>

<CATEGORY Name="Messages">
<Entry Name="EnteringTheCellar">This seems like a storage, Maybe i can find something useful!</Entry>
<Entry Name="DoorLocked">It's locked i need a key to enter!</Entry>
<Entry Name="NeedLantern">It is to dark, I need some sort of lightning source!</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_Cellar_Key">It's a Rusty Key, There is marked something on it, It is very rusty and hard to read[br]F*r Ent*r*ng Th*e C*ll*r.</Entry>
<Entry Name="ItemName_Cellar_Key">Rusty Key!</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_DiaryJane_Name">Diary Jane 1/1</Entry>
<Entry Name="Note_DiaryJane_Text">My husband Jake is a miner.[br]He works in the mine here nearby already for 15 years.[br]Still im really scared that the mine is gonna colapsed,[br]The mine has been here for centuries![br]There is still a myth going around that there are some kind of monsters in there.[br]Me and Jake dont believe in myths,[br]But...What if they are really there.[br][br]Former.[br]Jane.</Entry>
</CATEGORY>

<CATEGORY Name="Levels">
</CATEGORY>

</LANGUAGE>


Hope anyone of you guys can help me.

Never mind Fixed Wink

I'm smart Big Grin