Frictional Games Forum (read-only)
Text code - 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: Text code (/thread-8860.html)



Text code - TheDavenia - 06-28-2011

How do i make it so if i run into a certain area a text pops up on my screen? Huh
Please help

Thanks,
TheDavenia


RE: Text code - xtron - 06-28-2011

in your script file

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "AREA", "FUNCTION", true, 1);
}

void FUNCTION(string &in asEntity)
{
SetMessage("LANG", "ENTITY", 5.0f);
}

extra_lang
Code:
<CATEGORY Name="LANG">
<Entry Name="ENTITY">Type the text here you want to be shown</Entry>
</CATEGORY>

change it to your benefit ;D


RE: Text code - TheDavenia - 06-28-2011

(06-28-2011, 09:23 PM)xtron Wrote: in your script file

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "AREA", "FUNCTION", true, 1);
}

void FUNCTION(string &in asEntity)
{
SetMessage("LANG", "ENTITY", 5.0f);
}

extra_lang
Code:
<CATEGORY Name="LANG">
<Entry Name="ENTITY">Type the text here you want to be shown</Entry>
</CATEGORY>

change it to your benefit ;D

Thx


RE: Text code - SLAMnesia - 06-29-2011

I'm having problems with a similar issue,
how do I make it so when I look at an entity it displays a message? and I want it to always work when looking at the entity and not only once.
here's my script:
my .hps file
Code:
void OnStart ()
{
SetEntityPlayerLookAtCallback("shirt1", "LookingShirtFunc1", false);
}

void LookingShirtFunc1(string &in entity, int alState)
{
SetMessage("Messages", "Message01", 3);
}

my .lang file
Code:
<LANGUAGE>
    <CATEGORY Name="Messages">
        <Entry Name="Message01">Hello world!</Entry>
    </CATEGORY>
</LANGUAGE>



RE: Text code - TheDavenia - 06-30-2011

(06-29-2011, 09:27 PM)SLAMnesia Wrote: I'm having problems with a similar issue,
how do I make it so when I look at an entity it displays a message? and I want it to always work when looking at the entity and not only once.
here's my script:
my .hps file
Code:
void OnStart ()
{
SetEntityPlayerLookAtCallback("shirt1", "LookingShirtFunc1", false);
}

void LookingShirtFunc1(string &in entity, int alState)
{
SetMessage("Messages", "Message01", 3);
}

my .lang file
Code:
<LANGUAGE>
    <CATEGORY Name="Messages">
        <Entry Name="Message01">Hello world!</Entry>
    </CATEGORY>
</LANGUAGE>

I don't know sorry just post a new thread and someone will help you Big Grin