XML: invasions and events
By now we have an almost complete XML file. The only things missing are the invasion messages and the messages used for special events, such as wage changes, natural disasters, and any extra messages caused by scripting.
For invasions, there are multiple messages to be specified. Each invasion can have up to four messages, depending on how much time you want the player to have in advance. Since there can be multiple invasions, the same principle as with requests and cities is used:
- INVASION_X_TITLE: shown as the title of the invasion announcement messages
- INVASION_X_YEAR: warning shown a year before the invasion. If you leave this empty, the warning won’t be shown.
- INVASION_X_THREE_MONTH: warning shown three months before the invasion. If you leave this empty, the warning won’t be shown.
- INVASION_X_ONE_MONTH: warning shown one month before the invasion. If you leave this empty, the warning won’t be shown.
- INVASION_X_ARRIVAL: message shown when the invaders arrive on the map.
A small example with one raid that is announced only three months in advance, and an invasion with the full one year warning:
<?xml version="1.0" encoding="utf-8"?> <ScenarioName> <StringTable> ... <String id="INVASION_0_TITLE">Invasion from Some city</String> <String id="INVASION_0_YEAR"></String> <String id="INVASION_0_THREE_MONTH">Raids have been intensifying and the raiders appear to be headed towards our city.</String> <String id="INVASION_0_ONE_MONTH">The raiders are just outside our city, just waiting for the moment to strike.</String> <String id="INVASION_0_ARRIVAL">The time to fight is at hand, or else our city will be pillaged!</String> <String id="INVASION_1_TITLE">Invasion from Other city</String> <String id="INVASION_1_YEAR">Enemy forces are gathering outside our province.</String> <String id="INVASION_1_THREE_MONTH">Invaders have crossed our borders and make their way to our city.</String> <String id="INVASION_1_ONE_MONTH">The invading forces lie just outside our city, making their preparations to attack.</String> <String id="INVASION_1_ARRIVAL">The enemies are here! We must defend our city or we will surely be lost.</String> ... </StringTable> </ScenarioName>
The default message ID for wage changes is determined by the “wage manager” used in scripting. The game doesn’t make a difference between pleb and equite wage changes. The two messages that you need to specify are as follows:
- EVENT_Wage_Change_Title: The title of the wage change message shown to the user.
- EVENT_Wage_Change_Message: The message body of the wage change message.
The following example shows the wage change messages with their default text:
<?xml version="1.0" encoding="utf-8"?> <ScenarioName> <StringTable> ... <String id="EVENT_Wage_Change_Title">Change in Standard Wages</String> <String id="EVENT_Wage_Change_Message">Rome has made an adjustment to the standard wages for workers. Please check with your Labor Advisor for more information.</String> ... </StringTable> </ScenarioName>
When scripting an earthquake, you can add two parameters for specifying the title and body of the message shown when the earthquake occurs. The two tags you add in the XML message must correspond to the two strings in the script. Logical choices for the earthquake text IDs are:
- EVENT_Earthquake_Title: title of the message
- EVENT_Earthquake_Message: body of the message
Advanced: scripted messages
Using scripting, you can make additional messages pop up. Regular messages can be added in the same way as the example for the earthquake above. To get tutorial-style messages, you have to add “Layouts” to your XML file. This is beyond the scope of this article, you can view examples of this in the XML files of the Kingdom (tutorial) missions: Arretium, Brundisium, Capua, Genoa, and Verona.