MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
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.
|
|
02-08-2013, 05:48 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Display messages
It does
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 |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
RE: Display messages
(02-08-2013, 05:58 PM)BeeKayK Wrote: It does ![Wink Wink](https://www.frictionalgames.com/forum/images/smilies/wink.gif)
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]](http://internetometer.com/image/16455.png)
(This post was last modified: 02-08-2013, 06:04 PM by MulleDK19.)
|
|
02-08-2013, 06:02 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Display messages
Ah that's how. ok thanks
Then there should be no problem
Trying is the first step to success.
|
|
02-08-2013, 06:05 PM |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
RE: Display messages
(02-08-2013, 06:05 PM)BeeKayK Wrote: Ah that's how. ok thanks ![Wink Wink](https://www.frictionalgames.com/forum/images/smilies/wink.gif)
Then there should be no problem
Right. And I already tried his code, and it worked for me no problem.
|
|
02-08-2013, 06:05 PM |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
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 |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
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.
|
|
02-08-2013, 06:10 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Display messages
Me too ![Smile Smile](https://www.frictionalgames.com/forum/images/smilies/smile.gif)
Must be a LANG problem
Trying is the first step to success.
|
|
02-08-2013, 06:11 PM |
|
tonitoni1998
Member
Posts: 163
Threads: 54
Joined: Oct 2012
Reputation:
1
|
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 Big Grin](https://www.frictionalgames.com/forum/images/smilies/biggrin.gif) 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 |
|
|