Part 1: Sending messages
SendGameMessage(uint inCategory, uint inDisplay, ref string inTitle, ref string inText, ref string inSoundFilename)
This issues a message to the player, which is recorded in the message log, and may also be displayed on the screen.
Possible categories to specify are:
(uint)MessageCategory.kEpidemicsMessage (uint)MessageCategory.kFireCollapseMessage (uint)MessageCategory.kGodEventsMessage (uint)MessageCategory.kInvasionsMessage (uint)MessageCategory.kLocalEventMessage (uint)MessageCategory.kOrderRequestMessage
Usually the 'Local Event Message' will be used (on testing the others, there was no observable difference in the message display).
Possible Display values are:
(uint)MessageDisplay.kMessageDisplayNone (uint)MessageDisplay.kMessageDisplaySignificant (uint)MessageDisplay.kMessageDisplayStandard (uint)MessageDisplay.kMessageDisplayTutorial
'None' results in the message not being displayed on the screen, although it will be recorded in the message log. This can be handy for longer messages that don't need to be read immediately.
'Significant' is the 'normal' method - the message is displayed, and recorded in the message log. Example usage (triggered wage change message):
string msgTitle = "EVENT_Wage_Change_Title";
string msgText = "EVENT_Wage_Change_Message;
msgSound = "message1.mp3";
game.SendGameMessage((uint)MessageCategory.kLocalEventMessage,
(uint)MessageDisplay.kMessageDisplaySignificant,
ref msgTitle, ref msgText, ref msgSound);
This uses the default message sound file. The default location it will look in is the "Caesar IV\Data\Audio\Voice\Tutorials" folder. However, other locations can be used. For example:
msgSound = "/../figures/praefect_15.mp3";
will play the praefect saying his "I hate arsonists..." piece.
The message itself is defined in the XML file, for example:
<String id="EVENT_Wage_Change_Title">Change in Wage Expectations</String>
<String id="EVENT_Wage_Change_Message">The increasing wealth of your
city has led to demands for higher wages amongst plebs and equites alike.
Check with your Labor Advisor for more information.</String>
The messages therefore are fixed: there is no way to insert variables into the message.
'Standard' does not appear to have any use. The message is logged in the message log, but all that is displayed to the user is a blank 'warning' message.
'Tutorial' uses the display method as seen (as its name suggests) in the tutorials. This requires a different way of specifying the message text in the XML file. Such messages are not recorded in the Message Log, but are retained via an Instructions display. This can allow for quick and easy reference to essential information, rather than trawling through the message log. The following example can be seen in the Arretium tutorial XML file. The variable msgText is set to "TUTORIAL_011", and msgTitle to "TITLE_011". This illustrates some other notable features: "\n" is used for "new line", whilst the Image tag displays the 'build insula' button. (Note that any other 'tutorial' type messages should also be included between the <Layouts> tags.)
<Layouts>
...
<Layout id="TUTORIAL_011">
<Header>Get To Work</Header>
<Text>Let's get right to work. To start, you'll need some plebs to
move into the city. As the labor class, plebs are the backbone of
your city's economy.\n\nBuild some Insulae\n</Text>
<Image value="help_build_insula_button" />
<Text>to attract plebs to your city. You will need four occupied
insulae to move on in this assignment.</Text>
</Layout>
...
</Layouts>
SendWarningMessage(ref string inMessage, ref string inSoundFilename)
This issues a one line 'warning' message to the player, which appears at the top of the screen. Such messages are not recorded in the message log. Example use:
string msgWarn = "Patrician_Tip"; string msgSound = "message1.mp3"; game.SendWarningMessage(ref msgWarn, ref msgSound);
The string variable msgWarn identifies the message text in the XML file, as below. The string msgSound identifies the sound file to be played when the message is sent (see above).
<String id="Patrician_Tip">Patricians demand security, culture and
a variety of luxury goods in store.</String>
DebugOut(ref string inMessage)
Not tested this one, most likely doesn't do anything