Frictional Games Forum (read-only)

Full Version: Message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't get a message to show up.
this is in my .hps file

void OnEnter()
{
}

void Interactmansion_3(string &in asEntity)
{
SetMessage("message", "mansion_3", 0);

AddTimer(asEntity, 1.0f, "TimerDoorMessageOnAgain");
}

void OnLeave()
{

}



And this is in my .lang file


<LANGUAGE>
<RESOURCES />
<CATEGORY Name="message">
<Entry Name="mansion_3">It's locked. Where is that key?</Entry>
</CATEGORY>
</LANGUAGE>


What have i done wrong?
Try this: (untested)
Code:
void OnStart()
{
}

void OnEnter()
{
}

void Interactmansion_3(string &in asEntity)
{
    AddTimer("", 1.0f, "TimerDoorMessageOnAgain");
}

void TimerDoorMessageOnAgain(string &in asTimer)
{
    SetMessage("message", "mansion_3", 0);
}

void OnLeave()
{

}
Nope.. it didn't work :/
The .lang files aren't loaded when in debug mode. You have to launch the custom story through the menu for notes, diaries etc to work.
i am but it still doesn't work :/
Looks like you're screwed.
I have noticed that the things in () after a function is different in different interactions, collide callbacks have for example:
void Collide_ScareArea_2(string &in asParent, string &in asChild, int alState)

and timers only have TimerStopLook(string &in asTimer)

In your code I see you have only Interactmansion_3(string &in asEntity), maby changeing too (string &in asEntity, int alState) or something like that could help. I think you do best to look that up in the Script functions page (http://wiki.frictionalgames.com/hpl2/amn..._functions). Im not sure witch one to use since I don't know what kind of function Interactmansion_3 is, just saw that its only one parameter inside your (), and I cant recall ever using only one...[/align]
I think the function parameters are fine.
No he is missing his callback:
Code:
void OnStart()
{
    SetEntityPlayerInteractCallback("mansion_3", "Interactmansion_3", true);
}

void OnEnter()
{
}

void Interactmansion_3(string &in asEntity)
{
    AddTimer("", 1.0f, "TimerDoorMessageOnAgain");
}

void TimerDoorMessageOnAgain(string &in asTimer)
{
    SetMessage("message", "mansion_3", 0);
}

void OnLeave()
{

}
If the above code doesn't work then try changing the message name from "mansion_3" to something else and try again. (and don't forget to update your script file)

@2below:
Whoops, I failed.
*fixed*
Still not working :S
Remember to check for typos, Someone else:
SetEntityPlayerInteractCallback("mainsion_3", "Interactmansion_3", true);

Sudden, try taking the excess i away and try again.