Guide to MAP.STR
Displaying Text and Objectives in MapsBy Pulkit
Lord of the Text
Having text in your maps is inevitable. What good is a map without any clear set of instructions and objectives? One needs dialogue, chats, the terrible curses, and useful hints. And who can live without having an introduction line or two about their maps!
Welcome to map.str, a file that is used just for this purpose. Adding speeches in your game, piling up a list of objectives, writing hints, instructions, the uses are plenty. In this guide, I'm going to teach about map.str to achieve these ends.
So, how do we go about it?
Map.str is file you create within your map folder. The folder in which is placed your map file, and its associated TGA file. To create a map.str file, simply create a new Notepad document, and then click File -> Save As. In the Save As Type, choose All Files. Then give the name of your file map.str in the File Name field. Click on Save.
You should see your map.str file. Delete the Notepad document, and open your map.str file using Notepad. All workings in the map.str file are done using Notepad. Note here: sometimes World Builder shows its bitter end and refuses to open the map if you have made a map.str. Never panic! Simply trick the fussy World Builder by moving the map.str file out of the map folder, and saving it elsewhere. Once your work in the World Builder is done, copy-paste the map.str file back into your map folder before starting up the game.
Adding the Text
The most common use of map.str is in-game speeches. In whatever maps you create using the World Builder, the text that is to be displayed must be written here in your map.str file. There is a specific format for writing the text, and it is described as follows:
To write a line or two for display in your map, you have to write three lines in map.str. The first line will be the title you give to this piece of text. This is the title that is used in the scripts in World Builder, to identify and display the text. The second line is where your text goes. Enclose the text in double-quotation marks (" "). You can include special characters as well. The third and last line includes the word END. This defines the end of the text, and after this command, you can set up another such layout for the next piece of text.
The basic layout is thus:
"Your text here"
Your heading is the name you give to your text, so as to identify it. This is the name you'll see when searching for the text in World Builder. It is recommended you follow a good format in writing your headings. For example, in my map The Siege of Gondor, I prefer headings such as:
Notice how I prefix the heading with SCRIPT:. It is highly recommended that you follow the same, since in World Builder, only the headings starting with SCRIPT: are identified and displayed in the list. Otherwise the heading will have to be written yourself, and the World Builder will keep saying the text does not exist. It will work in the game nonetheless, but it is far easier to have the heading displayed in the list (we are all so lazy).
The second line is where you write your text, enclosed within the quotation marks (" "). Note that these quotation marks won't be displayed in the game. Also, to change the line of text (equivalent to the Enter key), you can use \n. This little addition will break the line and start a new line, shifting the rest of the text to the next line. Therefore a text such as this:
"Hello and welcome to my map \n The Siege of Gondor"
Will be displayed as:
The Siege of Gondor
Note that all the text is aligned to the centre, when displayed in the game.
The last line is very important. It contains the closing tag, END, without which the game may crash. Make sure all your text scripts have their Ends.
Displaying the Text
Though this is a map.str guide, it is necessary to talk about the scripts involved in World Builder so that one can actually have these texts displayed. To do this, open your map in the World Builder, and set up a new script:
Condition: Choose any condition as desired.
Action if True: For the Action, choose Interface -> Display Text -> Show text message to user. In this action, click on the "Localised String" (whatever the hell it means). In the list that pops up, you'll find the list of headings to various EA campaign texts. However, you will also find your own headings, if you have cared enough to prefix them with SCRIPT: as mentioned above. Simply select or type your desired heading, and assign the time for which the text will be displayed. When playing the game, you will find that your text is be displayed, much to your satisfaction.
Objectives of the Ring
Another very important use of map.str is to set up objectives for your map. Objectives require the use of all three mediums, map.str, map.ini and World Builder. The purpose of the map.str file is to jot down the text for the objective. However, for the sake of completion I will talk about all the three things so that you learn how to set up your own objectives.
The First Step
First thing to do is to write the objectives in map.str. All you need to do is make some text, in just the same way as we learned above: three lines. The first being the headline, the second the text of the objective. And the third is the all-important END. For example, my map The Siege of Gondor contains the following objectives in map.str:
"Get rid of that madman"
"Survive the onslaught"
Similarly, we can write as many objectives as we want. After this, we'll require the next step of setting up a map.ini.
The Second Step
The next thing to do is to create a map.ini file. A map.ini file is similar to map.str. To create a map.ini file, simply create a new Notepad document, and then click File -> Save As. In the Save As Type, choose All Files. Then give the name of your file map.ini in the File Name field. Click on Save.
You should see your map.ini file. Delete the Notepad document, and open your map.ini file using Notepad. All workings in the map.ini file are done using Notepad. Here's a note: often World Builder gets angry at a map.ini file, and refuses to open the map. Do not panic! If something like this happens, simply move the map.ini file out of your map folder, and save it elsewhere. Once you have done your work in the World Builder, copy-paste the map.ini file back into your map folder before starting up the game.
In the map.ini file, we write codes. The codes necessary for our purpose are as follows:
This is the main code. As can be seen, you have to write MissionObjectiveTag for each objective you have created. If you want an objective to be a Bonus objective, then use the BonusMissionObjectiveTag.
The first line, MissionObjectiveList, is the start of this code. It tells the game what you are working on. The last line is the END which tells the game the end of the code. In-between, you can write as many MissionObjectiveTag and BonusMissionObjectiveTag lines. Follow each line with an equation mark ( = ) and write after that the name of the corresponding text you wrote in map.str. For example, in my The Siege of Gondor map, the following code is written:
MissionObjectiveTag = SCRIPT:TSOGObjective_1KillDenethor
MissionObjectiveTag = SCRIPT:TSOGObjective_2Battle
Note that the order in which you write the objectives should be the correct order in which these objectives are going to appear in the game. This is because the next step in the World Builder identifies these objectives as Objective 1, Objective 2 etc. Thus it is important you make sure the objectives in map.ini are listed in correct chronological order.
The Third Step
Lastly, we have to add the scripts in the map so that we can define when and how the objectives are going to show up. For this open your map in World Builder, and set up the following script:
Condition: Choose any condition that you desire.
Action if True: For the Action, choose Interface -> Objectives -> Show mission objective. Choose the Objective number (1 for the first objective, 2 for the next etc.).
In this manner, your objective is set up to be displayed when the conditions are met. However, you also need to notify the player with a pop-up box. For that, add another Action: Interface -> Notification -> Display popup notification box. Choose the box type as NewObjective for objectives, NewBonusObjective for bonus objectives. For the Localised String, find or type in the name of your text corresponding to the objective you mentioned in the above Action. And finally assign a number of seconds for this notification to be displayed.
In this way, the objective is set. You'll need to have another script for detecting and displaying completion of an objective. For this, create a new script:
Condition: Choose the conditions required by the objective you made above. Once these
conditions are met, the Action below will show the player that the objective is complete.
Action if True: For the action, choose Interface -> Objectives -> Mark mission objective as completed. Choose the objective number the same as the one you chose above.
You may also include, if you so wish, a notification that the objective is completed. For such an action, choose: Interface -> Notification -> Display popup notification box. Choose the box type as ObjectiveCompleted for objectives, BonusObjectiveCompleted for bonus objectives. For LocalisedString, choose or type in the name of a text you wrote in map.str particularly for this purpose. Finally, assign the number of seconds this is to be displayed.
Text for Timers
You may have noticed the game campaigns display the time left for, say, the arrival of reinforcements. These are generally a small-sized piece of text followed by a countdown timer. As you may have guessed, this piece of text is written down in map.str file. It is quite essential in maps where you must display the countdown timer to players. A lot of events require you to show the player this timer, such as arrival of reinforcements, the releasing of the Earth Hammer in the Evil Campaign etc. So let us learn how this simple thing could be achieved:
First, open the map.str and write down the text in the correct format. It's the same always: a title to your text in the first line, the main text enclosed in quotation marks in the second line, and the END tag in the last line. For example, in my map The Siege of Gondor, the following text for the timer is used:
"Denethor burns Faramir in"
As you can see, this is the text that appears in the game when you wish to display the timer to the player. To display the timer, you'll need to set up a script:
Condition: Choose any condition that you desire.
Action if True: For the Action, choose Interface -> Counters and Timers -> Specific timer -- display. Select your timer, and for the "Localised String" choose or type in the title of the text you just wrote in map.str. That's it! In the game, the format in which this is displayed is first the text, followed by the countdown timer. For example, the timer in my map The Siege of Gondor displays as:
Denethor burns Faramir in 1:30
The timer will count down to zero, but the question arises: will this text disappear? The answer is, no! To hide this text, you'll need to set up another simple script:
Condition: For the Condition, choose Scripting -> Timer expired. Select your timer.
Action if True: For the Action, choose Interface -> Counters and Timers -> Specific timer -- hide. Select your timer.
With this done, the displayed countdown timer with the text will disappear once the timer has expired.
There's more to map.str. Basically, map.str is a file you create in your map to add to the contents of the parent file lotr.str, the game's equivalent of the map.str. In that big file is stored the text for the various campaign speeches, object names, game menus and much more. However, most of what is written there cannot be simply used in your map.str. A lot of other things require map.ini assistance as well, just like the case of setting up Objectives as shown in the previous sections. These other uses are required by map.ini experts, and only form a small part of the major changes made in the map.ini file. So that realm is only for map.ini enthusiasts. For ordinary purposes, map.str serves as a tool to write down all the text that you want to display in the game, be it for speeches, objectives or for timers. Looking forward to some good maps from all you world builders!