Frictional Games Forum (read-only)

Full Version: Should be an easy fix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Firstly I would like to say hello first time post and new to forums. Big Grin

However I got the basics down for map making(its similar to java coding lol).

Regardless lets move on with the problem, so I have a door that I just added a message to and it says "This door needs a key to open it." Which is exactly what I wanted it to do, but the problem is it keeps saying it over and over again when I click on it.(If it helps this is a level door not a normal door).

I can show you my code if you would like thanks.
Use an if statement to determine if the door is locked upon interaction.
(03-29-2012, 02:38 AM)Obliviator27 Wrote: [ -> ]Use an if statement to determine if the door is locked upon interaction.

How can I use an if statement if the message is being played through extra_english.lang?

My .lang

<CATEGORY Name="Messages">
<Entry Name="MansionDoor">This door needs a key to open.</Entry>
</CATEGORY>

My .hps

void MansionDoor(string &in asEntity)
{
SetMessage("Messages", "MansionDoor", 0);
}
The if statement would be used in your .hps.
void MansionDoor(string &in asEntity)
{
if(GetSwingDoorLocked("DOORNAME"))
{
SetMessage"Messages", "MansionDoor", 0);
}
}
What this will do is check if the door is locked. If it is locked, it will set the message. If the door is unlocked, nothing will be displayed on-screen.
Yea okay thanks a lot...just wasn't sure how to add it haha working perfectly. =]