Frictional Games Forum

Full Version: message help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Solved.
You need to use your extra_english.lang to do messages.
Put this into your extra_english.lang:


<CATEGORY Name="Messages">
<Entry Name="Hint1">text</Entry>
</CATEGORY>

You can add more hint's by adding more entries. For the script. It would be like this:

SetMessage("Messages", "Hint1", 0);
I figured that out before you posted, please read the first post again. The category name doesn't have to be "Messages" does it?
Help?
The "CustomStoryMain" is reserved for text in the description of a custom story. Put it in another category like this...

<CATEGORY Name="MiscMessages">
<Entry Name="Barrier">I should investigate my father's room before heading downstairs</Entry>
</CATEGORY>



Thanks, I didn't know it worked like that, but the message still isn't showing.

Lang:
Code:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are awoken by the chimes of a grandfather clock.</Entry>
</CATEGORY>

<CATEGORY Name="CustomStory">
<Entry Name="Barrier">I should investigate my father's room before heading downstairs</Entry>
</CATEGORY>

<CATEGORY Name="Death">
<Entry Name="StairScare">Wardrobes make good hiding places.</Entry>
</CATEGORY>
</LANGUAGE>

Script:
Code:
void OnStart() {
    if(ScriptDebugOn()) {
        GiveItemFromFile("lantern", "lantern.ent");
        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
    }
    AddEntityCollideCallback("Player", "EnemyTriggerArea", "EnteredEnemyTriggerArea", true, 1);
    AddEntityCollideCallback("Player", "BlockArea", "EnteredBlockArea", true, 1);
    PlaySoundAtEntity("", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
    SetDeathHint("Death", "StairScare");
    SetEntityCallbackFunc("key_1", "OnPickup");
}

void OnEnter() {
}

void OnLeave() {
}

void EnteredEnemyTriggerArea(string &in asParent, string &in asChild, int alState) {
    SetEntityActive("servant_grunt", true);
    ShowEnemyPlayerPosition("servant_grunt");
}

void EnteredBlockArea(string &in asParent, string &in asChild, int alState) {
    SetMessage("CustomStory", "Barrier", 6);
}

void OnPickup(string &in asEntity, string &in type) {
    SetEntityActive("invisWall", false);
    SetEntityActive("blockArea", false);
}

Make sure there isn't a typo on the script area of the collide. or any typos concerning the function.
I found a problem, the name of the area had a lowercase b, but even after I changed it, the issue is still occurring. I've looked over the script, the editor, and the lang file, but the message still does not display when I enter the area.


Code:
AddEntityCollideCallback("Player", "BlockArea", "EnteredBlockArea", true, 1);
Code:
void EnteredBlockArea(string &in asParent, string &in asChild, int alState) {
    SetMessage("CustomStory", "Barrier", 6);
}
Code:
<CATEGORY Name="CustomStory">
    <Entry Name="Barrier">I should investigate my father's room before heading downstairs.</Entry>
</CATEGORY>
My only guess is to make sure there is no typo in the level editor, such as the "BlockArea"... Also make sure it is ACTIVE.
(01-01-2012, 09:07 PM)Statyk Wrote: [ -> ]My only guess is to make sure there is no typo in the level editor, such as the "BlockArea"... Also make sure it is ACTIVE.
It is active, and I've gone over the names countless times and can't see any typos.

As of now, everything looks like:

Code:
AddEntityCollideCallback("Player", "BlockArea", "EnteredBlockArea", true, 1);

Code:
void EnteredBlockArea(string &in asParent, string &in asChild, int alState) {
    if (HasItem("key_1") == true)
        SetMessage("CustomStory", "Barrier", 6);
    }
}

Code:
<CATEGORY Name="CustomStory">
    <Entry Name="Barrier">I should investigate my father's room before heading downstairs.</Entry>
    </CATEGORY>
Pages: 1 2 3 4