DoW/Modtools/Attribute Editor/Tutorials/UCS strings
From Relic Mod Wiki
Contents |
Tooltips and UCS Editing
Note: this tutorial is for Relic Mod Tools or hand LUA editing.
So you're modding stuff into your game and now you've come across a question: where on earth do I put the tooltips? Why are they coming up wrong or coming completely empty?
Okay. You need to get yourself UCS editing at this point.
The UCS file.
The UCS file is a large simple text file that has sequential numbers down the side with lines of text after each one. Go and look at the Relic DC one using notepad or another text editor - you'll find it in Dawn of War - Dark Crusade/DXP2/Locale/*yourlanguage*. Each lua/rgd file that has tooltips associated with it (these will be almost everything) will have a few numbers in the file that relate to the numbers down the side of the UCS file. The reason for this is so that each lua file will be the same, regardless of what language the gamer is playing in. All that needs to happen for a different langauge to appear is for the a different, fully translated, UCS file to be used which is set when you pick which language you want for the game during the installation.
["ui_ext"]["ui_info"]
GameData["ui_ext"]["ui_info"]["help_text_list"]["text_01"] = "$97142" GameData["ui_ext"]["ui_info"]["help_text_list"]["text_02"] = "$97143" GameData["ui_ext"]["ui_info"]["help_text_list"]["text_03"] = "$97144" GameData["ui_ext"]["ui_info"]["help_text_list"]["text_04"] = "$97145" GameData["ui_ext"]["ui_info"]["icon_name"] = "space_marine_icons/tacticalmarine_icon" GameData["ui_ext"]["ui_info"]["screen_name_id"] = "$97140"
So this is the section of an lua that you need to be interested in. This is the section for a Tactical Marine EBPS (note most LUAs use the same/similar ui_ext, but SBPS use a different one). As you might be able to work out, there's four lines of help text, a link to an icon (not relevant to this tutorial) and then the name of the entity at the bottom. The screen_name_id is the main, large text name of a thing and the most important line to get right.
97140 Space Marine Squad 97141 97142 - Heavy Infantry. 97143 - Resilient general combat unit strong at range and close combat. 97144 - Broad range of weapon upgrades. Can be upgraded to be strong against most unit types. 97145 - Effective against Infantry.
This is the relevant section in the UCS file that it refers to. As you can see, it skips out line 97141. That's fine. The lines you choose to link to a file don't have to be consequetive in any wy and many lines are used by more than one unit. Also, the amount of help text is up to you. You can have four lines, none or I think seven is the most I've seen. Your limit is basically the size of the box on the screen.
Setting up a new UCS file
Do NOT edit the DXP2 UCS file. You must set up you own UCS file.
Set up the folder tree in you Mod folder to mirror that of the one in DXP2. Now, copy the UCS file over to the same place in your Mod Folder. Rename it to the same name as you mod folder. Open up this new copy and delete all the contents. You must copy the file in this way because it is slightly different from a text file; you cannot make your own then simply change the extension to .ucs. Your new UCS is now ready to be used.
First you'll need to do some numbering down the side in number order. Relic has set aside the numbers 15000000 to 20000000 for modding. You can start anywhere within that range and you can put as few or as many numbers as you want in. Put one space or TAB after each number then type in the text that you want. Feel free to leave little headings and notes to yourself in there because that text will only appear in game if you link it to a file.
Linking the text to a file
Here's the odd bit: although you can see the ui_ext number in the Relic Attribute Editor, you cannot edit them there. No idea why, you just can't. What you have to do is close the AE, find the relevant LUA, edit the numbers by hand, reload the AE and then Save to Binary. For this reason it's better to do the UCS editing in big chunks, do a lot of files at a time then re-load and save them. You may find that the file you want doesn't have ui_ext in its LUA. Simple: copy and paste the bits from it that you need from a file of the same type and then edit them in the new file. Be sure to put them in the right order; they are in alphabetical order (not the tooltips in the UCS, the lines in the LUA file). Feel free to omit any line that you don't need like the icon line, but be careful to override any tooltips that the file will inherit. You'll understand more about this when you have more experience with inheritance.
If you put "$0" then you'll get nothing. The same will happen if you reference an empty text line, but the lines of text will move up to fill the gap. Sometimes it's useful to give each file a screen_name and then setup four or five lines of text for it in the ui_ext. These lines will probably be empty in the UCS at first, but when you edit the UCS at a later date, adding tips etc when you're nearing completetion, then you can simply type the text into the UCS file and you will have already had links setup to it, so it will appear in game with no hassle!
Good luck.
