Frictional Games Forum (read-only)
Some Questions - scripting - 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: Some Questions - scripting (/thread-6288.html)



Some Questions - scripting - KonKaizo - 01-19-2011

Hey Guys,

I have some dumb questions. But, you know, people are dumb.
I have BAAAASIC JavaScript knowledge btw.
Here we go:

1. I dont get it. How do i create Journal entries? I followed the guide on the wiki but if i pick up the notice it just displays an empty letter.

My extra_english.lang looks like this:

Code:
<LANGUAGE>
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">Yuck!</Entry>
    </CATEGORY>
    
    <CATEGORY Name="Journal">
        <Entry Name="Note_Beginning_Name">BLA BLA</Entry>
        <Entry Name="Note_Beginning_Text">Bla Blah Blah Blah!</Entry>
</LANGUAGE>

and in the HPL editor i created a note_generic entity, and wrote "Beginning" into the NoteText field of the entity.
(also, i get no ingame Description, but that doesnt matter)

2. How can i display a text on the screen when the player looks on a specific point (like in the cistern)? I already messed around with the Sign Area, but i didnt manage it to work.

3. How do i create Mementos? ^^

There will be more questions soon^^ (i think)
KonKaizo


RE: Some Questions - scripting - Tanshaydar - 01-19-2011

1. You didn't close </CATEGORY> thing in the language file.
2. Every time player looks a place, you want to see same message, just place a "sign area" there, and open a category and write the entry.
3. You mean flashbacks?


RE: Some Questions - scripting - KonKaizo - 01-19-2011

(01-19-2011, 06:45 PM)Tanshaydar Wrote: 1. You didn't close </CATEGORY> thing in the language file.
2. Every time player looks a place, you want to see same message, just place a "sign area" there, and open a category and write the entry.
3. You mean flashbacks?

1. oh. :/ i must have been drunk when scripting this
2. Will test it.
3. No, i mean Mementos. Like: "The Key is locked. Go find a key.". Maybe its called otherwise in englsih, in german its "memento". (You can access to them with "M") Tongue


RE: Some Questions - scripting - Tanshaydar - 01-19-2011

Oh, sorry, it's me didn't understand.
I'm not good with objectives. I'm just a new noob for the tools.

I guess those are related to quest things, but better to check main game's files (map and/or hps files).


RE: Some Questions - scripting - Equil - 01-20-2011

2. An alternative to using a sign area would be to set a LookAt callback in the script, then have the called function use the SetMessage function.

3. For momentos, you'll need to use the AddQuest function for a trigger in your script, which will add a momento to the journal. Momentos in the .lang file go under the "Journal" category and will go off whatever entry you put in the script file.

Syntax: AddQuest(string& asName, string& asNameAndTextEntry);

asName - Name of the quest

asNameAndTextEntry - The Entry that will be used in the .lang file

e.g

In the script -
Code:
void AddCrowBarQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("crowbarquest", "CrowBarQuest");
}

In the .lang file -
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>



RE: Some Questions - scripting - Tanshaydar - 01-20-2011

Thanks for the explanation!


RE: Some Questions - scripting - KonKaizo - 01-22-2011

Thank you!

Yet another Question.

I want that, if the player lits one of 2 specific lamps, he is forced too look somewhere and an entity (not a monster) activates. Additionally, a shocking sound should play, like in the storage room when the altar lamps get suddenly lit. Is this even possible? Thanks in advance^^


RE: Some Questions - scripting - Tanshaydar - 01-23-2011

Possible, you can call back functions when player interacted with an entity. You can play sanity sounds in those functions. You can lit a lamp when a player looks somewhere. Many things are possible, but requires some trail & error.