Frictional Games Forum (read-only)

Full Version: is there any reason why 'SetMessage' isn't working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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>

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
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.
(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... :[

(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.
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>



(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


(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.
...just copy the code from my previous post...
(03-24-2012, 05:33 PM)Unearthlybrutal Wrote: [ -> ]...just copy the code from my previous post...

still nothing...


Pages: 1 2