Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help SetMessage not working?
Author Message
Capt Crit Offline
Junior Member

Posts: 46
Joined: Oct 2016
Reputation: 1
Post: #1
Question SetMessage not working?

I made a simple script so far for my custom story where, after picking up a note, it (should) show a message. Though the message doesn't show up! Everything else works good so far, the .lang file is also working. Can someone help me? :/

Map Script:
void OnStart()
{  
    AddUseItemCallback("", "keyStart", "doorStart", "startUnlock", true); //Working
    SetEntityCallbackFunc("note-1!room-start", "aftern1rs"); //Not working :(
}

void aftern1rs(string &in asEntity, string &in OnPickup)
{
    SetMessage("Message", "msg-note-1!room-start", 0);
}

.lang Script:
    <CATEGORY Name="Message">
        <Entry Name="msg-note-1!room-start">I should be careful with the given items, looks like this man wants to challenge me.</Entry>
    </CATEGORY>

Okay, to point out, I fixed the dash and exclamation mark glitch. The message is still not showing though... (replaced with "_")
(This post was last modified: 07-14-2017 03:44 PM by Capt Crit.)
07-14-2017 03:10 PM
Find all posts by this user Quote this message in a reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,982
Joined: Mar 2012
Reputation: 171
Post: #2
RE: SetMessage not working?

Could you update your previous script to show how it looks with the updated "_"?
(Not that I cannot imagine it myself, but I want you to show that you did it correctly)

Things to look out for when strings in the .lang file doesn't show up:
  • Category and Entry names are correct
  • If all entries from the file don't show up there is a syntax error somewhere in the file. You have to find it and fix it.

Being happy is the first step to success.
(This post was last modified: 07-14-2017 06:02 PM by FlawlessHappiness.)
07-14-2017 06:01 PM
Find all posts by this user Quote this message in a reply
Capt Crit Offline
Junior Member

Posts: 46
Joined: Oct 2016
Reputation: 1
Post: #3
RE: SetMessage not working?

(07-14-2017 06:01 PM)FlawlessHappiness Wrote:  Could you update your previous script to show how it looks with the updated "_"?
(Not that I cannot imagine it myself, but I want you to show that you did it correctly)

Things to look out for when strings in the .lang file doesn't show up:
  • Category and Entry names are correct
  • If all entries from the file don't show up there is a syntax error somewhere in the file. You have to find it and fix it.

Okay, I'll post here the updated version.

Map Code
void OnStart()
{  
    AddUseItemCallback("", "keyStart", "doorStart", "startUnlock", true);
    SetEntityCallbackFunc("note_1_room_start", "aftern1rs");
}

void aftern1rs(string &in asEntity, string &in OnPickup)
{
    SetMessage("Message", "msg_note_1_room_start", 0);
}

.lang Code
    <CATEGORY Name="Message">
        <Entry Name="msg_note_1_room_start">I should be careful with the given items, looks like this man wants to challenge me.</Entry>
    </CATEGORY>
07-14-2017 06:18 PM
Find all posts by this user Quote this message in a reply
Capt Crit Offline
Junior Member

Posts: 46
Joined: Oct 2016
Reputation: 1
Post: #4
RE: SetMessage not working?

I just wanted to excuse myself, I found it. The names didn't match from the note in the map and in the script. I was for a long time not editing, so I need to get back to the basics.
07-14-2017 07:48 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)