LUA - Special Messages (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


killjoy73au -> LUA - Special Messages (1/21/2018 11:31:58 AM)

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.




michaelm75au -> RE: LUA - Special Messages (1/22/2018 4:45:25 AM)

Not sure that Lua method supports HTML?




killjoy73au -> RE: LUA - Special Messages (1/22/2018 6:15:32 AM)

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.




michaelm75au -> RE: LUA - Special Messages (1/22/2018 6:46:35 AM)

Was looking at the wrong command[:o].
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[:D]




killjoy73au -> RE: LUA - Special Messages (1/22/2018 6:59:24 AM)

Well look at that, saved me a whole lot of stuffing around.

Thanks mate.




Rory Noonan -> RE: LUA - Special Messages (1/22/2018 9:37:27 PM)

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.




TheOttoman -> RE: LUA - Special Messages (1/24/2018 2:11:00 AM)

<deleted as the answer was already provided>




kevinkins -> RE: LUA - Special Messages (3/5/2018 3:36:00 PM)

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




Rory Noonan -> RE: LUA - Special Messages (3/5/2018 5:20:51 PM)

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.




kevinkins -> RE: LUA - Special Messages (3/5/2018 11:46:48 PM)

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




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
3.453125