Frictional Games Forum (read-only)

Full Version: Message popup on area wont work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wrote a script so when i collide with an area a message will pop up on the screen, But it doesn't.

The Part From The Script:

AddEntityCollideCallback("Player", "Blowdoor_1", "Messagepopup", true, 1);



void Messagepopup(string &in asChild, string &in asParent, int alState)
{
SetMessage("Popupmessage_1", "Popup_1", 3);
}


And the .Lang:

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">What The Hell?</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
</CATEGORY>
<CATEGORY Name="Popupmessage_1">
<Entry Name="Popup_1">What The?</Entry>
</CATEGORY>
<CATEGORY Name="Descriptions">
</CATEGORY>
<CATEGORY Name="Levels">


What the hell idi i do wrong? :O
How about putting this:

AddEntityCollideCallback("Player", "Blowdoor_1", "Messagepopup", true, 1);



into void OnStart()
{


}


Like this:


void OnStart()
{
AddEntityCollideCallback("Player", "Blowdoor_1", "Messagepopup", true, 1);

}
It's simple: The messages go to the "Messages" category. So, the lang file should be something like:

<CATEGORY Name="CustomStoryMain">

<Entry Name="Description">What The Hell?</Entry>

</CATEGORY>

<CATEGORY Name="Inventory">

</CATEGORY>

<CATEGORY Name="Messages">

<Entry Name="Popup_1">What The?</Entry>

</CATEGORY>

<CATEGORY Name="Descriptions">

</CATEGORY>

<CATEGORY Name="Levels">

And the script:

Code:
AddEntityCollideCallback("Player", "Blowdoor_1", "Messagepopup", true, 1);







void Messagepopup(string &in asChild, string &in asParent, int alState)

{

SetMessage("Messages", "Popup_1", 3);

}

Also, get sure that notes work. If something in the .lang file is wrong, everything "dies".
Forgot to write that the Blowdoor_1 is the name of the area, it triggers a door also, but i think it is possible to use 1 script area for 2 different Funcs