Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LUA - Special Messages

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA - Special Messages Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA - Special Messages - 1/21/2018 11:31:58 AM   
killjoy73au


Posts: 26
Joined: 7/10/2017
Status: offline
Okay so another problem i'm having... making a special message with the following function:
ScenEdit_SpecialMessage('SideNameOrID','Text')

How do I incorporate the following message with HTML into the text?


Tactical Update Message Received.


Confirmation received that a Chinese surface action group has been sunk.

With HTML it looks like:
<P align=center><STRONG>Tactical Update Message Received.</STRONG></P>
<P>Confirmation received that a Chinese surface action group has been sunk.</P>


Cheers.

< Message edited by killjoy73au -- 1/21/2018 11:32:47 AM >
Post #: 1
RE: LUA - Special Messages - 1/22/2018 4:45:25 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Not sure that Lua method supports HTML?

_____________________________

Michael

(in reply to killjoy73au)
Post #: 2
RE: LUA - Special Messages - 1/22/2018 6:15:32 AM   
killjoy73au


Posts: 26
Joined: 7/10/2017
Status: offline
I've no idea either, I was just going by the functions description...

ScenEdit_SpecialMessage (side, message)
Displays a special message consisting of the HTML text message to side `side.
Parameters:
side string The side name/guid to display the message on
message string The HTML text to display to the player


Not sure if there is any way to format a special message via LUA.

(in reply to michaelm75au)
Post #: 3
RE: LUA - Special Messages - 1/22/2018 6:46:35 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Was looking at the wrong command.
Just tried it and what you posted works.
Do this in the Lua Editor.
local message = '<P align=center><STRONG>Tactical Update Message Received.</STRONG></P><P>Confirmation received that a Chinese surface action group has been sunk.</P>'
ScenEdit_SpecialMessage ('germany', message)
-- use whatever the side name is

< Message edited by michaelm75au -- 1/22/2018 6:47:58 AM >


_____________________________

Michael

(in reply to killjoy73au)
Post #: 4
RE: LUA - Special Messages - 1/22/2018 6:59:24 AM   
killjoy73au


Posts: 26
Joined: 7/10/2017
Status: offline
Well look at that, saved me a whole lot of stuffing around.

Thanks mate.

(in reply to michaelm75au)
Post #: 5
RE: LUA - Special Messages - 1/22/2018 9:37:27 PM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
Also a nice shortcut is using 'playerside' instead of 'Whatever the side is called', automatically sends it to player. Really handy for scenarios intended to be played by one side only.

(in reply to killjoy73au)
Post #: 6
RE: LUA - Special Messages - 1/24/2018 2:11:00 AM   
TheOttoman

 

Posts: 139
Joined: 12/14/2017
Status: offline
<deleted as the answer was already provided>

< Message edited by TheOttoman -- 1/24/2018 2:12:07 AM >

(in reply to Rory Noonan)
Post #: 7
RE: LUA - Special Messages - 3/5/2018 3:36:00 PM   
kevinkins


Posts: 2257
Joined: 3/8/2006
Status: offline
Thanks for the code snippet. Using the HTML only makes sense if the player has special messages in a pop up checked in game options. So I wonder if there is a way to temporary force the pop-up when the player does not have the box checked? A work around is to perhaps alert the player in the briefing that it would be prudent to check the box.

Kevin

_____________________________

“The study of history lies at the foundation of all sound military conclusions and practice.”
― Alfred Thayer Mahan


(in reply to TheOttoman)
Post #: 8
RE: LUA - Special Messages - 3/5/2018 5:20:51 PM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
The ScenEdit_MsgBox() function displays a message regardless of player settings; doesn’t have the formatting flexibility of the SpecialMessage function though. I think a Lua command to be able to force special messages is a great idea.

_____________________________


(in reply to kevinkins)
Post #: 9
RE: LUA - Special Messages - 3/5/2018 11:46:48 PM   
kevinkins


Posts: 2257
Joined: 3/8/2006
Status: offline
I use ScenEdit_MsgBox() as a default so the player does not miss important messages that could be buried in the tiny font of message log. In fact, I never rely on the player seeing an important message embedded the message log. The MsgBox is the way to go. It's in the player's face. Formatted special messages would be far much better as an Alert to the player.

Kevin

(in reply to Rory Noonan)
Post #: 10
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA - Special Messages Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.031