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
Is this possible?
P44RTHURN4X Offline
Junior Member

Posts: 35
Threads: 16
Joined: Apr 2012
Reputation: 0
#1
Is this possible?

Hey guys,

I wanna ask you all, is it possible, that when I add a timer with the "if-function", that I... No wait, I want to make it like this:

AddTimer("game_timer", 1.0f, "la_mes");

...

void la_mes(string &in asTimer)
{
if(alState == 1) [When player look on the item, a message come on the screen]
{
SetMessage("Messages", "la_message", 8);
}
}

.lang

<CATEGORY Name="Messages">
<Entry Name="la_message">...message...</Entry>
</CATEGORY>

Is this so right or how have I have to do it that it works like I want?

PS: Sry, I'm german, not pretty good in english Wink



GReeZe' P44
05-26-2012, 09:31 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#2
RE: Is this possible?

The script is incomplete and the snippet you provided us would error anyway.

What are you trying to do?

05-26-2012, 09:35 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#3
RE: Is this possible?

If it's possible for a message to come up if the player looks at something? Frictional Games did it with signs. Look at how they did it in the Archives map.

Noob scripting tutorial: From Noob to Pro

05-27-2012, 01:04 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#4
RE: Is this possible?

Sign Areas work just like that. You place the area where you want the message to appear and point it toward an entry in your lang file. They only work from a certain distance though.

(This post was last modified: 05-27-2012, 06:14 AM by Damascus.)
05-27-2012, 06:13 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#5
RE: Is this possible?

If you want an infinite distance, see if the SetEntityPlayerLookAtCallback() function works.

Noob scripting tutorial: From Noob to Pro

05-27-2012, 06:22 AM
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#6
RE: Is this possible?

(05-27-2012, 06:22 AM)Cranky Old Man Wrote: If you want an infinite distance, see if the SetEntityPlayerLookAtCallback() function works.
This is also useful if you want the message to appear only once Smile
05-27-2012, 03:24 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Is this possible?

Otherwise i recommend using area_sign

Trying is the first step to success.
05-27-2012, 05:48 PM
Find




Users browsing this thread: 1 Guest(s)