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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Message
Sudden Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2011
Reputation: 0
#1
Message

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?
01-31-2011, 10:03 PM
Find
Som1Lse Offline
Member

Posts: 183
Threads: 9
Joined: Sep 2010
Reputation: 0
#2
RE: Message

Try this: (untested)
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()
{

}
(This post was last modified: 01-31-2011, 10:53 PM by Som1Lse.)
01-31-2011, 10:44 PM
Website Find
Sudden Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2011
Reputation: 0
#3
RE: Message

Nope.. it didn't work :/
01-31-2011, 10:59 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#4
RE: Message

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.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-31-2011, 11:11 PM
Find
Sudden Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2011
Reputation: 0
#5
RE: Message

i am but it still doesn't work :/
01-31-2011, 11:44 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#6
RE: Message

Looks like you're screwed.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-31-2011, 11:56 PM
Find
Vradcly Offline
Member

Posts: 100
Threads: 6
Joined: Jan 2011
Reputation: 0
#7
RE: Message

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]
02-01-2011, 12:18 AM
Find
Som1Lse Offline
Member

Posts: 183
Threads: 9
Joined: Sep 2010
Reputation: 0
#8
RE: Message

I think the function parameters are fine.
No he is missing his callback:
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*
(This post was last modified: 02-01-2011, 10:00 PM by Som1Lse.)
02-01-2011, 08:01 AM
Website Find
Sudden Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2011
Reputation: 0
#9
RE: Message

Still not working :S
02-01-2011, 06:41 PM
Find
Oscar House Offline
Senior Member

Posts: 302
Threads: 3
Joined: Nov 2010
Reputation: 9
#10
RE: Message

Remember to check for typos, Someone else:
SetEntityPlayerInteractCallback("mainsion_3", "Interactmansion_3", true);

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

[Image: 2exldzm.png]
02-01-2011, 06:58 PM
Find




Users browsing this thread: 1 Guest(s)