Frictional Games Forum (read-only)
[SCRIPT] Error with memento - 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] Error with memento (/thread-27307.html)



Error with memento - MaksoPL - 11-18-2014

I created the memento.
1.Memento is writed on start level, not when i go to the script area.
2.When i click "M" to see memento's there isn't a memento. One text: "Memento isn't avaiable."

What i must do?
This is hps file:

void OnStart()
{
AddQuest("memento1", "Quest_Castle1_Text");
CompleteQuest("memento1", "Quest_Castle1_Text");
AddEntityCollideCallback("Player", "MessageScript1", "Message1", true, 1);
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "DanielSay1", 10);
}


This is a journal lines from .lang file:

<CATEGORY Name="Journal">

<Entry Name="Note_note1_Name">
Info dla sluzby
</Entry>

<Entry Name="Note_note1_Text">
Droga Sluzbo, [br][br] Przepraszam za rozbicie okna, ale pojawil sie jakis stwor. Zaczal mnie atakowac, i rozbijajac okno, wypadl z niego. Mysle ze bladzi gdzies po lesie, ale nie wiem gdzie. Jestem ciekaw, do kogo nalezal zamek. Znalazlem w bibliotece ksiazke, i pisze tam ze zostal wybudowany w 1482r. Mamy teraz 1622r. wiec mozemy sie tylko domyslac. Znalezlismy jakiegos czlowieka w zrujnowanym sanktuarium. Byl bardzo slaby. Powiedzial tylko: [br][br] "Nazywam sie Alexander" i "Zabijcie Daniela" [br][br] O co mu chodzilo? Nie wiem. Jeszcze raz przepraszam za rozbicie okna.
</Entry>

<Entry Name="Note_note2_Name">
Ogloszenie
</Entry>

<Entry Name="Note_note2_Text">
Dnia 3.09.1986r.-5.09.1986r. Elektrownia zamknieta.
</Entry>

<Entry Name="Note_note_Name">
The End...
</Entry>

<Entry Name="Note_note_Text">

<Entry Name="Quest_Castle1_Text">Dostan sie do zamku</Entry>

</Entry>

</CATEGORY>

What i must do? Please help me.


RE: Error with memento - FlawlessHappiness - 11-18-2014

Remove this line:
CompleteQuest("memento1", "Quest_Castle1_Text");


When you use "AddQuest" you add the memento to the mementos.
When you use "CompleteQuest" you remove it.

In your OnStart you used both AddQuest and CompleteQuest, which means you both added and removed the memento again


RE: Error with memento - Romulator - 11-18-2014

Quote:<Entry Name="Note_note_Text">

Be sure to put an </Entry> after that somewhere before the next <Entry Name...> as well. Otherwise, your text will be blank.


RE: Error with memento - Mudbill - 11-18-2014

You want the memento to be added when you activate the collide callback? To do that, you must move the AddQuest line inside the callback block, like so:

PHP Code:
void OnStart()
{
    
//CompleteQuest("memento1", "Quest_Castle1_Text");//Remove this line.
    
AddEntityCollideCallback("Player""MessageScript1""Message1"true1);
}

void Message1(string &in asChildstring &in asParentint alState)
{
    
AddQuest("memento1""Castle1");//Move this here. Also, don't include the Quest_ and _Text parts.
    
SetMessage("Messages""DanielSay1"10); 


That will add the quest once you hit the area. The CompleteQuest script will remove the quest, so only use that when you've finished the task it's hinting to. As I also said, don't use the prefix and suffix for the memento in the script. Only use that in the .lang file.


RE: Error with memento - MaksoPL - 11-18-2014

I do everything what you say. And i click "M" for mementos and isn't name of memento or mementos isn't avaiable. In mementos only is "-". What i must do? I know, this error in .lang file. This is my .lang file:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Testing</Entry>
</CATEGORY>
</LANGUAGE>

</CATEGORY>

<CATEGORY Name="Journal">

<Entry Name="Note_note1_Name">
Info dla sluzby
</Entry>

<Entry Name="Note_note1_Text">
Droga Sluzbo, [br][br] Przepraszam za rozbicie okna, ale pojawil sie jakis stwor. Zaczal mnie atakowac, i rozbijajac okno, wypadl z niego. Mysle ze bladzi gdzies po lesie, ale nie wiem gdzie. Jestem ciekaw, do kogo nalezal zamek. Znalazlem w bibliotece ksiazke, i pisze tam ze zostal wybudowany w 1482r. Mamy teraz 1622r. wiec mozemy sie tylko domyslac. Znalezlismy jakiegos czlowieka w zrujnowanym sanktuarium. Byl bardzo slaby. Powiedzial tylko: [br][br] "Nazywam sie Alexander" i "Zabijcie Daniela" [br][br] O co mu chodzilo? Nie wiem. Jeszcze raz przepraszam za rozbicie okna.
</Entry>

<Entry Name="Note_note2_Name">
Ogloszenie
</Entry>

<Entry Name="Note_note2_Text">
Dnia 3.09.1986r.-5.09.1986r. Elektrownia zamknieta.
</Entry>

<Entry Name="Note_note_Name">
The End...
</Entry>

<Entry Name="Note_note_Text">

<Entry Name="Quest_Castle1_Text">Dostan sie do zamku</Entry>

</Entry>

</CATEGORY>

<CATEGORY Name="Messages">
<Entry Name="DanielSay1">Gdzie ja jestem?</Entry>

</CATEGORY>

</LANGUAGE>


RE: Error with memento - Mudbill - 11-18-2014

(11-18-2014, 03:46 PM)MaksoPL Wrote: I do everything what you say.

You forgot this:

(11-18-2014, 02:13 PM)Romulator Wrote:
Quote:<Entry Name="Note_note_Text">

Be sure to put an </Entry> after that somewhere before the next <Entry Name...> as well. Otherwise, your text will be blank.



RE: Error with memento - MaksoPL - 11-18-2014

(11-18-2014, 04:39 PM)Mudbill Wrote:
(11-18-2014, 03:46 PM)MaksoPL Wrote: I do everything what you say.

You forgot this:

(11-18-2014, 02:13 PM)Romulator Wrote:
Quote:<Entry Name="Note_note_Text">

Be sure to put an </Entry> after that somewhere before the next <Entry Name...> as well. Otherwise, your text will be blank.

Now isn't a notes, descriptions and mementos.


RE: Error with memento - Mudbill - 11-18-2014

I don't really know what you mean by that.

You see the part right here?
PHP Code:
<Entry Name="Note_note_Text">

<
Entry Name="Quest_Castle1_Text">Dostan sie do zamku</Entry>

</
Entry

The issue here is that the </Entry> tag is too far down. You must close an entry before opening another. Since the entry is empty anyway, you might as well just remove it.

Get rid of the Note_note_text line and the bottom </Entry> tag.