Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HowTo] If player walks into area a text pops up.
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#1
Question  [HowTo] If player walks into area a text pops up.

So i really dont know where to post these but if anyone wants to make a thread about this they dont have to do it :U

So lets get started.
at first we need the function that we can find at http://wiki.frictionalgames.com/hpl2/amn...#inventory
this is a great webside where all of the functions are.
just use CTRL + F and search for a function.
so for now on we are going to use the
SetMessage(string& asTextCategory, string& asTextEntry, float afTime);
asTextCategory - the category in the .lang file
asTextEntry - the entry in the .lang file
afTime - determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.
so there we have it.
now go to your extra_english.lang file and create a new category called MessageOnEntry.
You can call it whatever you want i really dont care.
and add a new entry to the category MessageOnEntry.
example.
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">Blargh is eating u</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
    <Entry Name="ItemDesc_MansionKey_1">"Key to open the door"</Entry>
    <Entry Name="ItemName_MansionKey_1">"Key for a door"</Entry>
</CATEGORY>
<CATEGORY Name="MessageOnEntry">
    <Entry Name="EntryOnMessage">"Blargh is going to eate verone hide."</Entry>
</CATEGORY>
</LANGUAGE>
so as you can see EntryOnMessage is the entry for the category MessageOnEntry.
So what do we add to the function?
Well thats really simple just do it like this.
SetMessage(string& asTextCategory, string& asTextEntry, float afTime);
SetMessage("asTextCategory", "asTextEntry", 3.0f);
so as you can see i deleted string& and added two "" around asTextEntry
and on float i added a f behind the value.
now you only have to add a area and a timer.
just go search on some threads around this helpful forum im sure theres someone that already typed how to use a timer and a area that activateds a function.
Note:for the love of god i chanced it, so everone can read it.
And i agree it's hard to read it when its aligned to the center
(This post was last modified: 08-23-2011, 07:25 PM by BubbleTroll.)
08-23-2011, 06:27 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: [HowTo] If player walks into area a text pops up.

Why centered everything to make it harder for us to read?

08-23-2011, 06:34 PM
Website Find
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#3
RE: [HowTo] If player walks into area a text pops up.

cause i kinda like it :U
should i chance it?
08-23-2011, 06:39 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: [HowTo] If player walks into area a text pops up.

You kinda like it, I kinda can't read it :/
Can you read it?

(This post was last modified: 08-23-2011, 07:17 PM by Tanshaydar.)
08-23-2011, 07:13 PM
Website Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#5
RE: [HowTo] If player walks into area a text pops up.

You should change it for the sake of the people you're trying to help. :/

08-23-2011, 07:21 PM
Find
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#6
RE: [HowTo] If player walks into area a text pops up.

Best to left-justify it so that the indentations line up the way they should in proper code, IMO.

Of course, real coders use Notepad, and code in Wingdings. :3

[Image: at_9365860.png]

Follow Harvest.
(This post was last modified: 08-23-2011, 07:23 PM by Phoroneus.)
08-23-2011, 07:22 PM
Find
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#7
RE: [HowTo] If player walks into area a text pops up.

fixed it ^-^
hope that helps you.
08-23-2011, 07:26 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#8
RE: [HowTo] If player walks into area a text pops up.

Just this:
SetMessage("MessageOnEntry", "EntryOnMessage", 3.0f);

08-23-2011, 07:36 PM
Website Find




Users browsing this thread: 1 Guest(s)