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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Display messages
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#11
RE: Display messages

(02-08-2013, 05:47 PM)BeeKayK Wrote: I see the mistake!

Your parameters are wrong.

it's (string &in asTimer)


Not (string &in timer_name)

That's not a mistake. The name of the parameters does not matter.

[Image: 16455.png]
02-08-2013, 05:48 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#12
RE: Display messages

It does Wink

Those parameters specify what kind of function you want to use, and if you have them wrong, no function will be called.

(string &in asEntity) = Interaction function
(string &in asParent, string &in asChild, int alState) = Collide function

For more information check this: http://www.frictionalgames.com/forum/thread-18368.html

Trying is the first step to success.
02-08-2013, 05:58 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#13
RE: Display messages

(02-08-2013, 05:58 PM)BeeKayK Wrote: It does Wink

Those parameters specify what kind of function you want to use, and if you have them wrong, no function will be called.

(string &in asEntity) = Interaction function
(string &in asParent, string &in asChild, int alState) = Collide function

For more information check this: http://www.frictionalgames.com/forum/thread-18368.html

I'm not asking you. I'm telling you. I've been programming for a very long time. Only the types matter. The names of the parameters on the wiki is only to help you know what they're for.

When the wiki states a callback signature like:
void MyFunc(string &in asParent, string &in asChild, int alState)

It's just stating that it's looking for a function returning void, and accepting 3 parameters: string, string, int.

What you name them in your script does not matter whatsoever.

This will work just as well:
void MyFunc(string &in entity1, string &in entity2, int state)

Or for that matter:
void MyFunc(string &in x1, string &in x2, int x3)

[Image: 16455.png]
(This post was last modified: 02-08-2013, 06:04 PM by MulleDK19.)
02-08-2013, 06:02 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#14
RE: Display messages

Ah that's how. ok thanks Wink

Then there should be no problem

Trying is the first step to success.
02-08-2013, 06:05 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#15
RE: Display messages

(02-08-2013, 06:05 PM)BeeKayK Wrote: Ah that's how. ok thanks Wink

Then there should be no problem

Right. And I already tried his code, and it worked for me no problem.

[Image: 16455.png]
02-08-2013, 06:05 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#16
RE: Display messages

Maybe the reason is that it says 'DisplayMessages' instead of 'Messages'. I'm not sure if this matters but you might want to try.

<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>
02-08-2013, 06:09 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#17
RE: Display messages

(02-08-2013, 06:09 PM)Tigerwaw Wrote: Maybe the reason is that it says 'DisplayMessages' instead of 'Messages'. I'm not sure if this matters but you might want to try.

<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">whatever</Entry>
</CATEGORY>

It does not matter. SetMessage accepts both a category and entry parameter. And like mentioned previously, I already tried his exact code and it worked fine for me.

[Image: 16455.png]
02-08-2013, 06:10 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#18
RE: Display messages

Me too Smile
Must be a LANG problem

Trying is the first step to success.
02-08-2013, 06:11 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#19
RE: Display messages

my lang looks like this in complete.
<LANGUAGE>
<RESOURCES/>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">For the best experience enjoy this customstory with Headphones in a dark room. [br] [br]You could also just be a pussy and play it with your friends with some random speakers and light and shit.</Entry>
</CATEGORY>
<CATEGORY Name="DisplayMessages">
<Entry Name="IntroMessage">Eww.... Man... My head...</Entry>
</CATEGORY>
</LANGUAGE>

and in my hps looks like this:
void OnStart()
{
   SetPlayerLampOil (0);
   SetPlayerCrouching (true);
   SetPlayerActive (false);
   FadePlayerRollTo(20, 10, 100);
   FadeOut (0);
   AddTimer("fade_in", 2, "FadeIn");
   AddTimer("head_roll", 2, "FadePlayerRollTo");
   PlaySoundAtEntity("", "react_pant.snt", "Player", 1, true);
   AddTimer("player_standup", 3, "SetPlayerCrouching");
   AddEntityCollideCallback("Player", "DamageArea_1", "DamageArea_1", false, 1);
   PlaySoundAtEntity("", "00_loop.snt", "Player", 10, true);
   PlaySoundAtEntity("", "amb_eerie_dunk.snt", "Player", 10, true);
   PlaySoundAtEntity("", "ambience_voice_3d.snt", "Player", 10, true);
   PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 10, true);
   AddTimer("intro_message", 5, "ShowIntroMessage");
   ///PlaySoundAtEntity("", "03_orb_loop.snt", "Player", 10, true);  
}

void ShowIntroMessage(string &in timer_name)
{
    SetMessage("DisplayMessages", "IntroMessage", 0);
}

void DamageArea_1(string &in asParent, string &in asChild, int alState)
{
    GivePlayerDamage(10, "Bloodsplat", false, false);
    PlaySoundAtEntity("", "19_inject.snt", "Player", 0, true);
    PlaySoundAtEntity("", "react_breath_no3d.snt", "Player", 0, true);
}

void FadeIn(string &in timer_name)
{
    FadeIn(3);
    SetPlayerActive (true);
}

void FadePlayerRollTo(string &in timer_name)
{
    FadePlayerRollTo(0, 20, 10);
}

void SetPlayerCrouching(string &in timer_name)
{
    SetPlayerCrouching(false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

as you might notice, im very new to coding.

oh man guys i think i know what is the misake ._. i where using the dev_user. i tried it out without the oolbar and it worked Big Grin thanks with your time and help.

When you are looking for someone, to do the scripting for your Custom Story, ask me!
(This post was last modified: 02-08-2013, 11:22 PM by tonitoni1998.)
02-08-2013, 11:06 PM
Find




Users browsing this thread: 1 Guest(s)