News Center
-Current
-Submit news

Com Center
-Forums
-Email

Map Tutorials
-Introduction
-Foreword by RVMECH
(Getting Familiar)
Chapter 1: Part 1
Chapter 1: Part 2
Chapter 1: Part 3
(Sculpting Tools)
-Chapter 2
(Texture Tools)
-Chapter 3
(Object Tools)
-Chapter 4
(
Misc. Map Tools)
-Chapter 5
(
String Files)
-Chapter 6
(
Scripting Teams)
-Chapter 7
(
Making Trains)
-Chapter 8

FIRST MAP
-Part 1
-Part 2
-Part 3
-Part 4
-Part 5


Site Staff
Webmaster
-LionKeypr
Map Staff
-RVMECH



 


Chapter 6: Creating Map String Files

 

The good folks at EA Pacific have provided the map/mission maker with a simple method to enter text messages into the scenario. In the TS and RA genre it is impossible to place a text message into the game without the word "Missing" being in front of the custom text, or string. The only proper way to do this was by editing the csf file and distributing this along with the map. This required using a csf editor and replacing the entire csf file. This has caused tremendous problems for folks, yours truly included. I was always forgetting about a loose file running around in my game directory causing some mods and missions that I was playing or creating to be in error from the get-go.

By using a text editor (such as Wordpad, Notepad, EditPad, etc.) we can create a separate string file and place it in the folder where the map resides. We can call up the strings by the simple use of a script. I'll explain the string file creation first and then tackle the script.

The game will call up a string by the name that you give it. So to make it simple we can give the text string the name of the map followed by a colon, and a description. Here is an example of the first entry we should make
MyMapName:Intro_1
The next entry that should be made is the context, or message to be viewed ingame. This entry should be listed under the first one. The message itself should be written as a quote, I.E. encapsulated by quotation marks. This lets the engine know that this is the portion to parse, or use. The message must be as brief as possible, it is limited to 64 characters by the script we will be using. If more than one line is needed then you need to make another string and script it also. Here is an example
"Created by RVMECH"

The last entry for the string is written on the third line and simply states
END.

Our sting should look like this when we are finished
MyMapName:Intro_1
"Created by RVMECH"
END

All that is left to do now is to save the file and place it in the map folder along with the map. Name the file map.str, and place it in the map folder.

Okay now, lets address the scripting part. I am not going to make this a tutorial on scripting as that is a separate subject in itself. I will however show you how to make your custom message show up in the game.

First off open the script editor by going to EDIT then scripts. This will open the Script Editor. The script has to be placed under the civilian house, or side, so select PlyCivilian and then click on "New Script". The "Script Properties" page will appear, this is where we name the script. I will call this one simply Text Message. Make sure the active box is checked as well as the deactivate box.

After finishing that go to the Script Conditions page. The default here states that if the conditions are "true", or in other words the map has actually loaded and started, this script will fire. There are other ways to make this work but for this example we will stick to the default. This will cause the script to fire when the map starts. Just make sure the default is set to "IF" and "True", just as it appears in the previous screenshot.

Next click on the Actions if true page. The default action calls for null, or nothing to happen. This is not what we desire, obviously, so go ahead and click on edit and lets get the action we need. This will open up the Edit Actions menu. Click on the arrow next to the action title (see the red Circle in the previous screenshot) and all the Script Actions will appear. Scroll to the "scripting " section and select "[Scripting] Show military briefing caption" from the list. Now we have to fill in the parameters for this action.

Click on the link "string???" and when the "Edit Parameter" box appears type in the name of your string, after doing that click on OK. This will bring us back to the previous box where we can address the last parameter. Click on the link "0" milliseconds and the edit parameter box will reappear for you. I want this message to stay on the screen for 15 seconds so a bit of basic arithmetic is called for. There are 1000 milliseconds to each second, so I want to enter 15000 milliseconds into the parameter box. All that's left to do is to click ok in each of the boxes and back out of the Script editor. Save the map!!!!

When your done and have checked your map out in-game it should look similar to this screenshot. It will start to print from left to right as soon as the game starts, stay on the screen for 15 seconds and then fade from view.

Good luck!

 

« Chapter 5 (Misc Tools) | Chapter 7 (Creating Teams) »