Frictional Games Forum (read-only)
[SCRIPT] SetMessage not working? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] SetMessage not working? (/thread-53809.html)



SetMessage not working? - Verkehr - 07-14-2017

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:
Code:
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:
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>

Okay, to point out, I fixed the dash and exclamation mark glitch. The message is still not showing though... (replaced with "_")


RE: SetMessage not working? - FlawlessHappiness - 07-14-2017

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.



RE: SetMessage not working? - Verkehr - 07-14-2017

(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
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
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>



RE: SetMessage not working? - Verkehr - 07-14-2017

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.