Frictional Games Forum (read-only)

Full Version: SetMessage won't show a message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trying to do a generic message on a locked door. I've followed the tutorial to the 'T' and no message is displayed when the player interacts with it.

I know the .hps file is set up correctly, because the action to use the key on the door to unlock it DOES work.

I know the .lang file is set up properly because the description for the key and the game info also works.

Here is the .hps and the .lang file, respectively:

Spoiler below!

void OnStart()
{


AddUseItemCallback("", "DoorKey", "LockedDoor", "KeyOnDoor", true);

}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor", 0.0f, true);
SetLocalVarInt("StudyDoorLocked", 0);
}

void StudyIsLocked(string &in asEntity)
{

{
SetMessage("Messages", "LockedStudy", 0);
}
}


Spoiler below!

<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description"> MAH GAME THOUGH</Entry>
</CATEGORY>

<CATEGORY Name=“Messages”>
<Entry Name=“LockedStudy”>The door to the Study is locked.</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_DoorKey1">A Key to an upstairs Study</Entry>
<Entry Name="ItemName_DoorKey1">Study Key</Entry>
</CATEGORY>



</LANGUAGE>



The PlayerInteractCallBack on the door field is populated with "StudyIsLocked". The door is named LockedDoor, but that doesn't pertain to this since I have no check to see if the door is actually locked.

To troubleshoot, I put the line "SetMessage("Messages", "LockedStudy", 0);
" right in the OnStart() function, and still the message didn't display. My issue seems to be with calling the message.

Anyone know what's up?
Code:
<CATEGORY Name=“Messages”>
<Entry Name=“LockedStudy”>The door to the Study is locked.</Entry>
</CATEGORY>

You used the wrong quotes at your lang.
You have some odd quoation marks “Messages” /// "CustomStoryMain". Try using the ones you've used in CustomStoryMain i.e. "

Also dubble-check the names of everything involved in that script.
Whoa holy crap that's weird. I copy pasted that script right from the tutorial, this fixed it but man it's been driving me nuts for over a day.

Thanks dudes