The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
SetMessage won't show a message
burge4150 Offline
Member

Posts: 56
Threads: 15
Joined: Feb 2014
Reputation: 0
#1
SetMessage won't show a message

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


Messages In This Thread
SetMessage won't show a message - by burge4150 - 07-25-2014, 03:15 PM
RE: SetMessage won't show a message - by i3670 - 07-25-2014, 03:26 PM



Users browsing this thread: 1 Guest(s)