Frictional Games Forum (read-only)
[SCRIPT] Memento won't show up - 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: [SCRIPT] Memento won't show up (/thread-18693.html)

Pages: 1 2


Memento won't show up - elbichopt - 10-08-2012

When I walk to the area, it shows that a memento has been wrote but when I go check it it only says: "-" lol

Screenshots:

Spoiler below!
[Image: amnesia2012100822481582.png]

Spoiler below!
[Image: amnesia2012100822481985.png]

Spoiler below!
[Image: 66824296.jpg]


The codes:

Lang file:
Spoiler below!
Code:
<LANGUAGE>
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">This is where I test my maps.</Entry>
    </CATEGORY>
    
    <CATEGORY Name ="Inventory">
            <Entry Name="ItemDesc_stone_hammer_1">This might just break the padlock!</Entry>
            <Entry Name="ItemName_stone_hammer_1">Stone hammer</Entry>
    </CATEGORY>
    
    <CATEGORY Name ="Journal">
            <Entry Name="Quest_RockPadlock_Text">The padlock looks rusty enough to be easily broken.</Entry>
    </CATEGORY>


.HPS file:
Spoiler below!
Code:
void OnStart()
{
SetPlayerLampOil(0);
AddEntityCollideCallback("Player", "rockpadlock", "GetRockPadlockQuest", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
AddUseItemCallback("OpenDoor","stone_hammer_1", "padlock_1", "unlock_prison_section_1", true);
}

void GetRockPadlockQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest ("rockpadlock", "RockPadlock");
}

void unlock_prison_section_1(string &in asItem, string &in asEntity)
{
SetPropHealth("padlock_1", 0.0f);
SetEntityActive("padlock_broken_1", true);
RemoveItem("stone_hammer_1");
SetEntityActive("padlock_1", false);
PlaySoundAtEntity("", "break_wood_metal.snt", "ScriptArea_1", 0, false);
CompleteQuest("rockpadlock", "rockpadlock");
}

void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("tochalol", false, true);
SetLampLit("tochalol2", false, true);
AddTimer("", 2, "Out2");
PlaySoundAtEntity("", "00_faint.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(9.0f, true);
}


Help? Huh


RE: Memento won't show up - 4WalledKid - 10-08-2012

Try removing capital letters on the Quest_RockPadlock_Text in the .lang file. Why? because you didn't use capital letters in the .hps! Tell me if it worked Smile


RE: Memento won't show up - Statyk - 10-08-2012

Code:
<LANGUAGE>

    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">This is where I test my maps.</Entry>
    </CATEGORY>

    <CATEGORY Name="Inventory">
            <Entry Name="ItemDesc_stone_hammer_1">This might just break the padlock!</Entry>
            <Entry Name="ItemName_stone_hammer_1">Stone hammer</Entry>
    </CATEGORY>

    <CATEGORY Name="Journal">
<Entry Name="Quest_RockPadlock_Name">padlock quest</Entry>
            <Entry Name="Quest_RockPadlock_Text">The padlock looks rusty enough to be easily broken.</Entry>
    </CATEGORY>

I removed the spaces in "<CATEGORY Name = "blah">". Try replacing yours with mine. Also added a quest name.


RE: Memento won't show up - The chaser - 10-09-2012

It must be a .lang problem, the script adds a memento correctly. THere should be something from there that escapes from my sight.

Ok: You have it wrong. Here's the structure of the script:
AddQuest(string& asName, string& asNameAndTextEntry);


And here is what you have:

("rockpadlock", "RockPadlock");

So, you should change it to this:
void GetRockPadlockQuest(string &in asParent, string &in asChild, int alState)

{

AddQuest ("RockPadlock", "Journal");

}

<Entry Name="Quest_RockPadlock_Text">The padlock looks rusty enough to be easily broken.</Entry>

This may work.


RE: Memento won't show up - Ongka - 10-09-2012

If you're starting your map in dev_mode, the .lang file won't load. You can't read notes, mementos etc..
Try to start it the classic way, via main menu.


RE: Memento won't show up - Adny - 10-09-2012

One thing I feel is being overlooked is that there is no /Language at the end of the file; if that truly is the case and not just an error copy/pasting it into the page, then try this:

Spoiler below!


<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">This is where I test my maps.</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemName_stone_hammer_1">Stone Hammer</Entry>
<Entry Name="ItemDesc_stone_hammer_1">This might just break the padlock!</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Quest_RockPadlock_Text">The padlock looks rusty enough to be easily broken.</Entry>
</CATEGORY>

</LANGUAGE>

The lang file is fine aside from that; any further error can be attributed to mismatched names in the .hps file.

Hope that helped...


RE: Memento won't show up - Your Computer - 10-09-2012

The only thing wrong with the LANG file is that it lacks a closing tag for LANGUAGE. As for the script, the use of AddQuest is correct. If the user was playing in developer mode, they should consider testing the story with a non-developer profile.

Meh? Ninja'd twice?


RE: Memento won't show up - Dutton - 10-09-2012

You should definitely use this to edit your language file with
http://www.frictionalgames.com/forum/thread-12213.html

It saved me constantly from spelling errors and will make your more comfortable making notes Smile


RE: Memento won't show up - elbichopt - 10-09-2012

(10-09-2012, 06:52 AM)andyrockin123 Wrote: One thing I feel is being overlooked is that there is no /Language at the end of the file; if that truly is the case and not just an error copy/pasting it into the page, then try this:

Spoiler below!


<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">This is where I test my maps.</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemName_stone_hammer_1">Stone Hammer</Entry>
<Entry Name="ItemDesc_stone_hammer_1">This might just break the padlock!</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Quest_RockPadlock_Text">The padlock looks rusty enough to be easily broken.</Entry>
</CATEGORY>

</LANGUAGE>

The lang file is fine aside from that; any further error can be attributed to mismatched names in the .hps file.

Hope that helped...
That worked just perfectly! Thank you!
Spoiler below!
[Image: amnesia2012100912585412.png]
And thank you all for donating your time to help my problem! Blush Big Grin


RE: Memento won't show up - Adny - 10-09-2012

(10-09-2012, 06:53 AM)Your Computer Wrote: Meh? Ninja'd twice?
Did you install the latest Human Patch? Big Grin