Frictional Games Forum (read-only)
is there any reason why 'SetMessage' isn't working? - 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: is there any reason why 'SetMessage' isn't working? (/thread-14209.html)

Pages: 1 2


is there any reason why 'SetMessage' isn't working? - 7thProductions - 03-24-2012

I've tried (almost) everything to get 'SetMessage' to work but no matter what I do; everytime I lanuch my map said message does not show up and I don't know what to do...

I recall someone saying that there doesn't have to be something with the HPS file for this to happen, but that there could be something with the LANG file, but I don't see anything wrong with either...

script:

////////////////////////////
// Run first time starting map
void OnStart()
{
SetPlayerCrouching(true);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
SetSanityDrainDisabled(true);
SetPlayerHealth(10.0);
AddPlayerBodyForce(0, 0, -10000, true);
FadeOut(0.0f);
FadeIn(5.0f);
SetPlayerSanity(1);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
AddEntityCollideCallback("Player", "violetedwardsspeak1_blood", "Collidevioletedwardsspeak1blood", false, 1);
}
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("ScriptArea_1", 2, 2, "");
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetPlayerMoveSpeedMul(0.3);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0.0);
AddTimer("startplayerlookat", 3, "Collidevioletedwardsspeak1blood");
AddTimer("setmessage", 3, "Collidevioletedwardsspeak1blood");
}
}
void Collidevioletedwardsspeak1blood(string &in asTimer)
{
string x = asTimer;
if (x == "startplayerlookat")
{
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
StartPlayerLookAt("blood_spatter01_1", 1, 10, "");
PlaySoundAtEntity("", "react_scare.ent", "Player", 0, false);
}
else if (x == "setmessage")
{
SetMessage("Messages", "blood", 0);
}

}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

extra_english.lang:

<LANGUAGE>

<RESOURCES />

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">YOUR DESCRIPTION HERE</Entry>

</CATEGORY>

<CATEGORY Name="Inventory" />

<CATEGORY Name="Messages" />
<Entry Name="blood">Violet:[br]Is...is that my blood...?[br]What the fuck happened to me!?!</Entry>
</CATEGORY>

<CATEGORY Name="Descriptions" />

<CATEGORY Name="Levels" />
</LANGUAGE>




RE: is there any reason why 'SetMessage' isn't working? - TheKataKombs - 03-24-2012

SetMessage("Messages", "blood", 0);


u have to take away the 0 and put in seconds how long you want it to stay on the screen..
Like: SetMessage("Messages, "blood", 2.5);
Hope this helps Smile



RE: is there any reason why 'SetMessage' isn't working? - ClayPigeon - 03-24-2012

TeKataKombs - Actually, 0 will force a calculation of the number of the characters and according to it will set a matching amount of time to read the message.

Thread opener:

The problem's within your language file.
Firstly, you did not end your Inventory category, make it like this:

<CATEGORY Name="Inventory">
</CATEGORY>

And then:
<CATEGORY Name="Messages">
</CATEGORY>

Your syntax was: <CATEGORY/>, which is false.


RE: is there any reason why 'SetMessage' isn't working? - 7thProductions - 03-24-2012

(03-24-2012, 05:12 PM)TheKataKombs Wrote: SetMessage("Messages", "blood", 0);


u have to take away the 0 and put in seconds how long you want it to stay on the screen..
Like: SetMessage("Messages, "blood", 2.5);
Hope this helps Smile
it didn't do anything... :[




RE: is there any reason why 'SetMessage' isn't working? - ClayPigeon - 03-24-2012

(03-24-2012, 05:19 PM)7thProductions Wrote:
(03-24-2012, 05:12 PM)TheKataKombs Wrote: SetMessage("Messages", "blood", 0);


u have to take away the 0 and put in seconds how long you want it to stay on the screen..
Like: SetMessage("Messages, "blood", 2.5);
Hope this helps Smile
it didn't do anything... :[
Please, try my solution.


RE: is there any reason why 'SetMessage' isn't working? - Unearthlybrutal - 03-24-2012

The problem is what ClayPigeon said.
Smile You can use this in your .lang file:

Spoiler below!


<LANGUAGE>

<RESOURCES>
</RESOURCES>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">YOUR DESCRIPTION HERE</Entry>
</CATEGORY>

<CATEGORY Name="Inventory" />
</CATEGORY>

<CATEGORY Name="Messages" />
<Entry Name="blood">Violet:[br]Is...is that my blood...?[br]What the fuck happened to me!?!</Entry>
</CATEGORY>

<CATEGORY Name="Descriptions" />
</CATEGORY>

<CATEGORY Name="Levels" />
</CATEGORY>

</LANGUAGE>






RE: is there any reason why 'SetMessage' isn't working? - 7thProductions - 03-24-2012

(03-24-2012, 05:18 PM)ClayPigeon Wrote: TeKataKombs - Actually, 0 will force a calculation of the number of the characters and according to it will set a matching amount of time to read the message.

Thread opener:

The problem's within your language file.
Firstly, you did not end your Inventory category, make it like this:

<CATEGORY Name="Inventory">
</CATEGORY>

And then:
<CATEGORY Name="Messages">
</CATEGORY>

Your syntax was: <CATEGORY/>, which is false.

okay, I did what you told me to do, but the message still won't show up on the screen





RE: is there any reason why 'SetMessage' isn't working? - ClayPigeon - 03-24-2012

(03-24-2012, 05:30 PM)7thProductions Wrote:
(03-24-2012, 05:18 PM)ClayPigeon Wrote: TeKataKombs - Actually, 0 will force a calculation of the number of the characters and according to it will set a matching amount of time to read the message.

Thread opener:

The problem's within your language file.
Firstly, you did not end your Inventory category, make it like this:




And then:



Your syntax was: , which is false.

okay, I did what you told me to do, but the message still won't show up on the screen


Try using Unreathlybrutal's syntax, it seems correct.


RE: is there any reason why 'SetMessage' isn't working? - Unearthlybrutal - 03-24-2012

...just copy the code from my previous post...


RE: is there any reason why 'SetMessage' isn't working? - 7thProductions - 03-24-2012

(03-24-2012, 05:33 PM)Unearthlybrutal Wrote: ...just copy the code from my previous post...

still nothing...