Frictional Games Forum (read-only)
Display messages - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Display messages (/thread-20243.html)

Pages: 1 2


RE: Display messages - MulleDK19 - 02-08-2013

(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.


RE: Display messages - FlawlessHappiness - 02-08-2013

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


RE: Display messages - MulleDK19 - 02-08-2013

(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)


RE: Display messages - FlawlessHappiness - 02-08-2013

Ah that's how. ok thanks Wink

Then there should be no problem


RE: Display messages - MulleDK19 - 02-08-2013

(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.


RE: Display messages - Tiger - 02-08-2013

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>


RE: Display messages - MulleDK19 - 02-08-2013

(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.


RE: Display messages - FlawlessHappiness - 02-08-2013

Me too Smile
Must be a LANG problem


RE: Display messages - tonitoni1998 - 02-08-2013

my lang looks like this in complete.
Code:
<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:
Code:
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.