Frictional Games Forum (read-only)

Full Version: Quest_Parents_Text is not declared? [SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...
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.
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>
You forgot quotation marks :V
...? 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.
Did you put the right category for the entry?
Yeah,

Code:
<CATEGORY Name="Journal">

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

</CATEGORY>
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");
}
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.
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!