XML: empire sites and requests

This page explains the XML tags required for the sites on the empire map and the requests. Both types have one thing in common: there can be an unlimited number of items (either cities or requests). This “problem” is solved in the XML file by appending a number to the ID string. One thing to note here is that the sequence number starts from zero: the first city is SITE_0, the second one is SITE_1 and so on.

For both empire sites and requests, you can set the text within the editor as well. If you do this, the texts won’t “stick”: the next time you load the scenario in the editor (or in the game itself), the texts are gone.

Sites on the Empire map

For each site, we need to supply three tags (where X is the ID of the site):

  • SITE_X_LABEL: the label shown on the map itself
  • SITE_X_FULLNAME: the full name of the site, shown in the details of that site. This is usually the same as the label
  • SITE_X_SITETYPE: the type of site. For trade cities, this is normally “Roman Province”, for enemy camps this is “Enemy Camp”. For the player’s city, this is usually set to “Player City”, even though the actual text is not used anywhere.
  • SITE_X_ACTIVE: this only applies to the player’s city: this is the label shown when the user hovers over the home city. Normally this is set to the name of the city, followed by a line break and then “Your City”

You will see other tags in the XML files of the official scenarios, but they are not used in the game. These tags are SITE_X_DEACTIVE, SITE_X_CLOSED, and SITE_X_HISTORY. Adding them causes no harm, but the XML file is easier to understand if you leave them out.

An example of how the Empire map part of the XML file would look like, with one trade city, one enemy camp and the player’s city:

<?xml version="1.0" encoding="utf-8"?>

<ScenarioName>
  <StringTable>
    ...
    <String id="SITE_0_LABEL">Latium</String>
    <String id="SITE_0_FULLNAME">Latium</String>
    <String id="SITE_0_SITETYPE">Roman Province</String>

    <String id="SITE_1_LABEL">Francii</String>
    <String id="SITE_1_FULLNAME">Camp of the Francii</String>
    <String id="SITE_1_SITETYPE">Enemy Camp</String>

    <String id="SITE_2_LABEL">Lutetia</String>
    <String id="SITE_2_FULLNAME">Lutetia</String>
    <String id="SITE_2_SITETYPE">Player City</String>
    <String id="SITE_2_ACTIVE">Lutetia\Your City</String>
    ...
  </StringTable>
</ScenarioName>

Requests

There are two types of requests: requests for goods and military requests. The former are set in the editor, the latter are programmed in the CS script file. For each request, we need to supply four tags (where X is again the ID of the request):

  • REQUEST_X_TITLE: in contrast to the name, this is not the title of the request. This is a string that’s seemingly unused in the game. The title is set to “REQ_Y name” or “ORD_Y name” in the scenarios shipped with the game, where Y is “F” for food requests, “B” for basic goods requests, “L” for luxury goods, “E” for exotic goods and “M” for weapons and armour. The actual value of the tag doesn’t seem to matter, and it doesn’t have to be unique either
  • REQUEST_X_HEADING: the actual title of the request, as shown to the user in the request screen, and on the list of orders and requests in Imperial advisor
  • REQUEST_X_BODY: the message shown to the user when the request arrives
  • REQUEST_X_FAILURE: the message shown to the user when he or she has failed to fulfil the request. This should be filled in for orders, but can be empty for requests.

The game doesn’t make a difference between military requests and normal requests in the XML file. However, the ID of the military requests is the one you set in the script file. I don’t know what happens when you set a military request with an ID that is already “taken” by a normal request, but I don’t recommend trying it!

An example of three requests: one order, one request, and one military request:

<?xml version="1.0" encoding="utf-8"?>
<ScenarioName>
  <StringTable>
    ...
    <String id="REQUEST_0_TITLE">ORD_F grain</String>
    <String id="REQUEST_0_HEADING">Rome Orders Grain</String>
    <String id="REQUEST_0_BODY">Famine strikes the city of Rome. Send
      grain as soon as possible.</String>
    <String id="REQUEST_0_FAILURE">You have failed to come to the
      aid of Rome and your favor has fallen as a result</String>

    <String id="REQUEST_1_TITLE">REQ_L wine</String>
    <String id="REQUEST_1_HEADING">Rome Requests Wine</String>
    <String id="REQUEST_1_BODY">Rome plans to give a festival to
      Bacchus. Please send any wine you have to spare.</String>
    <String id="REQUEST_1_FAILURE">You have missed an opportunity to
      raise your favor with Rome.</String>

    <String id="REQUEST_2_TITLE">REQ_MIL</String>
    <String id="REQUEST_2_HEADING">Request For Military Support</String>
    <String id="REQUEST_2_BODY">Rome hopes you will be able to
      support the war effort by contributing soldiers to her legions.</String>
    <String id="REQUEST_2_FAILURE">You have missed an opportunity to
      raise your favor with Rome.</String>
    ...
  </StringTable>
</ScenarioName>

< Previous: XML: basics | Editor Home | Next: XML: invasions and events >