Frictional Games Forum (read-only)
SCRIPT PROBLEM - 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 PROBLEM (/thread-16623.html)



SCRIPT PROBLEM - stinset2 - 06-30-2012

Hey, I can't get the messages to show... please help
here's the script
////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("old", "DoorLockedPlayer", true);
PlaySoundAtEntity("", "break_glass_bottle.snt", "Player", 0, false);
SetPlayerActive(false);
SetPlayerCrouching(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
}
void DoorLockedPlayer(string &in entity)
{
SetMessage("Messages", "oldlibrary", 4);
}

void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
FadeOut(3);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("thing", 2, 2, "");
SetMessage("Messages", "line", 4);
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("thing2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
SetMessage("Messages", "line1", 4);
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
and here's the lang file
<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You play as a man whom's obbession with books has forced him to live alone in his massive mansion. One night when he heard a noise, he went to investigate. He gets beaten down by a creature and transported into an unknown place. </Entry>
<CATEGORY Name=“Messages”>
<Entry Name =“oldlibrary”>That's the old library. I don't want to go in there.</Entry>
<Entry Name =“line”>What was that?</Entry>
<Entry Name =“line1”>I better check it out.</Entry>
</CATEGORY>
</LANGUAGE>


RE: SCRIPT PROBLEM - EXAWOLT - 06-30-2012

can´t find any problems with the messages, but im not familiar to your way of using timers, maybe something struggling with them?


RE: SCRIPT PROBLEM - stinset2 - 06-30-2012

(06-30-2012, 04:56 PM)EXAWOLT Wrote: can´t find any problems with the messages, but im not familiar to your way of using timers, maybe something struggling with them?

no, the timers worked fine...


RE: SCRIPT PROBLEM - Shambles - 06-30-2012

The way you name your entries in lang files look odd to me....But I'm really new too so I cann not say much! Does the rest of lang file work?


RE: SCRIPT PROBLEM - Cruzore - 06-30-2012

<Entry Name =“line1”>I better check it out.</Entry> and every other thing in the lang file:
” and “ can not be recognized, you have to use ".


RE: SCRIPT PROBLEM - Your Computer - 06-30-2012

The messages don't work because he's using special quotation marks for them. Those aren't considered valid quotation marks.

Edit: Ninja'd.