07-25-2014, 03:15 PM
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:
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);
}
}
<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?
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?