Frictional Games Forum (read-only)
How to make Subtitles? - 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: How to make Subtitles? (/thread-10771.html)



How to make Subtitles? - FreshKorruption - 10-15-2011

Does anybody know the exact scripting so that when you get to an area in your custom map, it says Press F to use your lantern.

Huh



RE: How to make Subtitles? - schmupper - 10-15-2011

I could Give you a hint, but nah...



RE: How to make Subtitles? - Statyk - 10-15-2011

(10-15-2011, 06:57 PM)schmupper Wrote: I could Give you a hint, but nah...


That reply was a win. =P If you don't understand it, the comment is:

void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);
Displays a hint on the player's screen.
asName - the internal name
asMessageCat - the category in the .lang file
asMessageEntry - the entry in the .lang file
afTimeShown - time in seconds until the message disappears. If time is ⇐ 0 then the life time is calculated based on string length.




RE: How to make Subtitles? - FreshKorruption - 10-15-2011

I don't understand some of this. In my hps file do i just put it anywhere and do i include void. And I don't know the category name of it or the entry. And where is the spot where i put in the name of my area.


RE: How to make Subtitles? - GreyFox - 10-15-2011

So you want it where you walk into a certain area and says Press F for Latern, Something like this
{
AddEntityCollideCallback("Player" "ScriptAreaName", "MyFunc", true, 1);
}

void MyFunc(string &in asParent, string &in asChild, int alState)
{
GiveHint ("LanternHint", "Hint", "LanternHint", 5);
}

*Note that you will need to change some names because your extra english.lang file maybe different.




RE: How to make Subtitles? - FreshKorruption - 10-15-2011

I can't get it working. Please tell me what im doing wrong. Here is my extra_english.lang and .hps file.


RE: How to make Subtitles? - GreyFox - 10-15-2011

try using these (just copy and paste them and replace them, I just removed the unneeded spaces and such)

Code:
<LANGUAGE>
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">Survive the mansion, while revealing your fogotten past...</Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">
        <Entry Name="Note_LetterOne_Name">Uncle's First Note</Entry>
        <Entry Name="Note_LetterOne_Text">Dustin,[br] You must hurry! A secret cult called "The Dark Descent" have sent out grunts to kill you off. I hadn't expected them to come for a few more months! They know you are alive! This probably all sounds confusing but just trust me. Do this for your parents. I will leave you more notes, but for now you have to get out of their. Grab what you can and go, and don't come back to this room!    [br]    -Uncle Daniel</Entry>
        <Entry Name="Note_LetterTwo_Name">Uncle's Second Note</Entry>
        <Entry Name="Note_LetterTwo_Text">Dustin,[br] I should tell you about your parents. First, they aren't dead. They are merely hiding, changed their names, their looks. They needed to hide from the evil that was overcoming our heritage. The "Dark Descent" mistook them for dead. They were part of a.....I hear them coming for me! If i survive i will tell you further more, but for now I have to go!    [br]    -Uncle Daniel</Entry>
    </CATEGORY>
    <CATEGORY Name="Inventory">
        <Entry Name="ItemName_GuestRoomKey">Guest Room Key</Entry>
        <Entry Name="ItemDesc_GuestRoomKey">Key to open the nearby door.</Entry>
        <Entry Name="ItemName_shinykey">Shiny Key</Entry>
        <Entry Name="ItemDesc_shinykey">A Shiny Key. Must go to the nearby door.</Entry>
    </CATEGORY>
    <CATEGORY Name="Levels">
        <Entry Name="leveldoor_1">Hallway</Entry>
    </CATEGORY>
    <CATEGORY Name="Hint">
        <Entry Name="LanternHint">Press F for Lantern</Entry>
    </CATEGORY>
</LANGUAGE>


Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "doorslam_1", "Collidedoorslam", true, 1);
AddUseItemCallback("", "shinykey", "mansion_3", "KeyOnDoor", true);
AddEntityCollideCallback("Player" "lanternhint", "Collidelanternhint", true, 1);
}

void Collidedoorslam(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("mansion_2", true, true);
    PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
    PlaySoundAtEntity("", "react_scare", "Player", 0, false);  PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
    GiveSanityDamage(5.0f, true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("mansion_3", false, true);
    PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
    RemoveItem("shinykey");
}

void Collidelanternhint(string &in asParent, string &in asChild, int alState)
{
    GiveHint ("LanternHint", "Hint", "LanternHint", 5);
}

-Grey Fox