Frictional Games Forum (read-only)

Full Version: Adding messages to a locked door?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I followed the instructions for adding messages to a locked door and it's just not working.


What I did:


Added: <CATEGORY Name=“Messages”>


<Entry Name =“msgname1”>The door seems to be locked. Maybe I should look around a little bit.</Entry>


</CATEGORY>

To my .lang file


Also added:


void DoorLockedPlayer1(string &in entity)


{
if(GetSwingDoorLocked("castle_1") == true)
{
SetMessage("Messages", "msgname1", 0);
}
}



To my .hps file
I clicked on my door in hpl2 and went to the Entity's tab
(The door was already locked) and typed in
DoorLockedPlayer1 for the player interact call back.


I am thinking it is a scripting error.
Please help me?
Instead of getswingdoorlocked, try this:

SetSwingDoorLocked("castle_1", false, true);

and take off the extra } at the end.

Im no expert at scripting but I am trying to help.
(06-25-2012, 06:46 AM)Demondays1 Wrote: [ -> ]Instead of getswingdoorlocked, try this:

SetSwingDoorLocked("castle_1", false, true);

and take off the extra } at the end.

Im no expert at scripting but I am trying to help.
Crashed...
(06-25-2012, 06:50 AM)Jagsrs28 Wrote: [ -> ]
(06-25-2012, 06:46 AM)Demondays1 Wrote: [ -> ]Instead of getswingdoorlocked, try this:

SetSwingDoorLocked("castle_1", false, true);

and take off the extra } at the end.

Im no expert at scripting but I am trying to help.
Crashed...
Ok add your original back and see what happens if you take off "if" also leave the } at the end deleted so you only have 1.
If those special quotation marks were used in the LANG file, then that's one explanation why the message didn't work.
Instead of: if(GetSwingDoorLocked("castle_1") == true)

Use: if(GetSwingDoorLocked("castle_1"))

It comes back as "true," and that's what triggers the if statement. Operations like == are only used for numbers.