Frictional Games Forum (read-only)
Quest_Parents_Text is not declared? [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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Quest_Parents_Text is not declared? [SOLVED] (/thread-7178.html)



Quest_Parents_Text is not declared? [SOLVED] - Austums - 04-03-2011

So, I'm trying to make it so when a player moves into a Script Area, the memento appears.

Code:
void OnStart()
{
   AddTimer("CreepyMusic", 0, "CreepyMusic");
   AddUseItemCallback("CellarDoorKey1Func", "CellarDoorKey1", "CellarDoor1", "CellarDoorKey1Func", true);
   AddEntityCollideCallback("Player", "Quest1", "Quest1Func", true, 1);
}
void CreepyMusic(string &in asTimer)
{
   PlayMusic("06_amb.ogg", true, 7, 3, 0, true);
}
void CellarDoorKey1Func(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("CellarDoor1", false);
    RemoveItem("CellarDoorKey1");
    PlaySoundAtEntity("unlocking", "unlock_door.snt", "Player", 0, true);
}
void Quest1Func(string &in asParent, string &in asChild, int alState)
{
    AddQuest(Quest_Parents_Text, Quest_Parents_Text);
}

Instead, when I enter the map, it gives me an error saying "main (19, 34) : ERR : 'Quest_Parents_Text' is not declared"

D: It all LOOKS right...


RE: Quest_Parents_Text is not declared? - palistov - 04-03-2011

Your AddQuest function is incorrect.

It should be:

AddQuest("name", "Parents");

Parents I assume is what the description is in your quest's entry in the extra_english.lang file, right? If so, it should appear like this in your lang file

<Entry Name="Quest_Parents_Text">Quest memento here!</Entry>

"name" is the name of the quest which is used by the engine for when you want to, say, complete the quest, or check if said quest is actually in the mementos page.


RE: Quest_Parents_Text is not declared? - Austums - 04-03-2011

Parents is the name of my Memento, like so:

Code:
<CATEGORY Name="Journal">

      <Entry Name="Quest_Parents_Text">I have to see if my parents are okay.</Entry>

</CATEGORY>



RE: Quest_Parents_Text is not declared? - MrBigzy - 04-03-2011

You forgot quotation marks :V


RE: Quest_Parents_Text is not declared? - Austums - 04-03-2011

...? Where?


DAHHH. Never mind. I'm dumb. Tongue Silly syntax.
Uh oh, now the map runs fine, and the memento is added, but when I look at it, it's just a

-

And nothing else.


RE: Quest_Parents_Text is not declared? - MrBigzy - 04-03-2011

Did you put the right category for the entry?


RE: Quest_Parents_Text is not declared? - Austums - 04-03-2011

Yeah,

Code:
<CATEGORY Name="Journal">

      <Entry Name="Quest_Parents_Text">I have to see if my parents are okay.</Entry>

</CATEGORY>



RE: Quest_Parents_Text is not declared? - Russ Money - 04-03-2011

Here's what mine looks like, it works, use it as a reference if it helps:

extra_english.lang
Code:
<CATEGORY Name="Journal">

<Entry Name="Quest_CrowBarQuest_Text">The door's blocked by weak planks of wood. Maybe I can find something to pry them off?</Entry>

</CATEGORY>

script (map.hps)

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "AreaCrowBarQuest_1", "AddCrowBarQuest", true, 1);
}

void AddCrowBarQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("crowbarquest", "CrowBarQuest");
}



RE: Quest_Parents_Text is not declared? - palistov - 04-03-2011

Quests are mementos, which don't have an Entry for their "title". As such you don't need two entires in the lang file, just one (the actual memento text)

If I'm incorrect in this, I while give myself a thousand lashings, dealt with the fiery passion of two hundred suns. AKA I'm not entirely sure but the scripts I've looked at and the lang files don't point to quests having a name entry.


RE: Quest_Parents_Text is not declared? - Austums - 04-03-2011

Solved. I just had to change it from

Code:
void Quest1Func(string &in asParent, string &in asChild, int alState)
{
    AddQuest(Quest_Parents_Text, Quest_Parents_Text);
}

to

Code:
void AddQuest1(string &in asParent, string &in asChild, int alState)
{
    AddQuest("Parents", "Parents");
}

Thanks for the help everybody!