Frictional Games Forum (read-only)
[SCRIPT] Message popup on area wont work - 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] Message popup on area wont work (/thread-19215.html)



Message popup on area wont work - Rowzter - 11-13-2012

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


RE: Message popup on area wont work - FlawlessHappiness - 11-13-2012

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);

}


RE: Message popup on area wont work - The chaser - 11-13-2012

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


RE: Message popup on area wont work - Rowzter - 11-13-2012

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