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
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: SetMessage won't show a message

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

You used the wrong quotes at your lang.

"Veni, vidi, vici."
"I came, I saw, I conquered."
07-25-2014, 03:25 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#3
RE: SetMessage won't show a message

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.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
07-25-2014, 03:26 PM
Find
burge4150 Offline
Member

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

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




Users browsing this thread: 2 Guest(s)