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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Messages on the screen?
rallelol Offline
Member

Posts: 53
Threads: 11
Joined: Dec 2011
Reputation: 1
#1
Messages on the screen?

Hello, i'm working on a new customstory (already) Smile

For those who missed my first one it's right here: http://www.frictionalgames.com/forum/thr...#pid110091

Anyway, how do you make a message appear on the screen when you touch a door or step into an area or something?

Example: When you touch a door and it's locked, i want a message on the screen like: Why is the door locked.

Thank you for helping! Smile
01-08-2012, 05:56 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Messages on the screen?

Go to the locked door in the LevelEditor and go into its "Entity" tab. Find "PlayerInteractCallback" and fill in the entry box with "lockeddoor1". Then fill this in in the .hps anywhere but OnStart, OnEnter, or OnLeave:

void lockeddoor1(string &in asEntity)
{
SetMessage("ScreenMessages", "door1", 3);
}


Then go into the .lang and put this somewhere:

<CATEGORY Name="ScreenMessages">
<Entry Name="door1">Why is the door locked?</Entry>
</CATEGORY>
(This post was last modified: 01-08-2012, 06:03 PM by Statyk.)
01-08-2012, 06:03 PM
Find
rallelol Offline
Member

Posts: 53
Threads: 11
Joined: Dec 2011
Reputation: 1
#3
RE: Messages on the screen?

(01-08-2012, 06:03 PM)Statyk Wrote: Go to the locked door in the LevelEditor and go into its "Entity" tab. Find "PlayerInteractCallback" and fill in the entry box with "lockeddoor1". Then fill this in in the .hps anywhere but OnStart, OnEnter, or OnLeave:

void lockeddoor1(string &in asEntity)
{
SetMessage("ScreenMessages", "door1", 3);
}


Then go into the .lang and put this somewhere:

<CATEGORY Name="ScreenMessages">
<Entry Name="door1">Why is the door locked?</Entry>
</CATEGORY>
Thank You very much!


01-08-2012, 06:22 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Messages on the screen?

Also, If you only want it to come up once, make sure "PlayerInteractCallbackAutoRemove" is CHECKED on the door's Entity tab. This will only allow the function to run once.
01-08-2012, 06:26 PM
Find




Users browsing this thread: 2 Guest(s)