I'm trying to use the Request_ConsoleCommand game request as part of a simple notifications mod, and one of my notifications should look like, "Remember, safety in numbers. Always make sure you're allied with your main faction." My mod pulls a line from a .txt file, that being one of 'em, and sticks it in a chat message function. The resulting function looks like, gameAPI.Game_Request(CmdId.Request_ConsoleCommand, (ushort)CmdId.Request_InGameMessage_AllPlayers, new Eleon.Modding.PString(SAY 'Remember, safety in numbers. Always make sure you're allied with your main faction.')); Note the single quotes. This result ends up not doing the chat at all, and I'm thinking the string is escaping after "you're". I've tried using double quotes on the outside, and all messages fail using that, even strings without single quotes. I think it needs single quotes. But for aesthetic reasons, I'd like to try to keep the apostrophes in the notifications. EAH seems to have figured it out with their UI chat messages and the timetable messages. I've also attempted to escape them on the .txt file with the backslashes, but those had the same result. TL;DR: My string is escaping itself attempting to use an apostrophe. Double quotes surrounding the string doesn't work, neither does escaping them with back slashes in the .txt file. Apologies with the formatting, I can't seem to find any sort of code tags. Any help is appreciated, thank you.
are you trying to do Code: GameAPI.Game_Request(CmdId.Request_ConsoleCommand, (ushort)CmdId.Request_ConsoleCommand, new Eleon.Modding.PString("SAY '" + msg + "'")); Note: it writes a Telnet command you need to start the line with Say or Code: GameAPI.Game_Request(CmdId.Request_InGameMessage_AllPlayers, (ushort)CmdId.Request_InGameMessage_AllPlayers, new IdMsgPrio(Player, msg, Convert.ToByte(Priority), Duration)); with Player = PlayerID or 0 for All players msg = 'Remember, safety in numbers. Always make sure you're allied with your main faction.' Priority = a number 0-2 Duration = Duration in Seconds
I'm doing the telnet say command. I do have the "say" part in there, I forgot to add it in this thread. It's edited now.
say 'Remember, safety in numbers. Always make sure you''re allied with your main faction.' that isn't a double quote btw. it's 2 Apostrophes. tested in a telnet session, it works.
Huh- it works. Thank you. How'd you figure it out? I've noticed that in EAH when doing a scheduled chat, in the alert in the top right, it'd have two single quotes, but I've always thought it was a double quote, until now.
Did you eventually get this working, I can't get Request_ConsoleCommand to do anything but fire an error event