PDA

View Full Version : Newbie Mod Tutorials: Provinces



Callatian
11-01-2004, 00:46
How To Make a New Province In RTW


We're going to modify four files here:

/data/world/maps/base/map_regions.tga
/data/world/maps/base/descr_regions.txt
/data/world/maps/campaign/YOURCAMPAIGNNAMEGOESHERE/descr_strat.txt
/data/text/YOURCAMPAIGNNAMEGOESHERE_regions_and_settlement_names.txt

You'll need an image editing program like Photoshop to edit the tga file. Since Photoshop is my preferred program, that's what I'll be using for this guide.

Step 1:
Open map_regions.tga in an image editor.
You'll see each province has its own color as well as a single black pixel, which designates where the city goes. Some cities have a white pixel on a coastal piece of land which shows where the port will go. Not all cities need ports. We're going to make a province to split Armenia and Pontus a little, so we'll go to that section of the map. I've taken the liberty of zooming in quite a bit so we can see what we're doing here:
http://vaticanspecialforces.org/rome/province1.png

Now, select an RGB color that isn't being used already. I just picked a random color of 163, 120, 8.
http://vaticanspecialforces.org/rome/province2.jpg

Go ahead and pencil in your new province--zoom in so you get a good view. I supose this goes without saying, but make sure you're using the pencil tool and not the brush tool in Photoshop. Right click the brush tool and switch it to pencil. We're not going to change the land formation, just change borders and add a new city and port:
http://vaticanspecialforces.org/rome/province3.png

I set the city in what I hope is a valid location by simply looking at the Rome map that came with the game, and sort of figuring out where the mountains won't be. This is a very difficult region to add to since there are mountains EVERYWHERE, and we have to place the city almost exactly, unless we want to edit the map's terrain (not in this guide, muchacho!). If you place a city on an invalid piece of terrain, say a river or mountain, the game won't load.

Save your map_regions.tga file now, and open descr_regions.txt.
We're going back to map_regions.tga a little later, so you may want to just leave the file open for simplicity.

Now we need to come up with a name for this region and city. Google away. I reliaze this isn't the right location for it, but I'm going to call this "Armenia Inferior" anyway. We'll call the city Yerevan because I'm trying to write a Rome modding guide, not history.

So in the descr_regions.txt file, we're going to make a new entry that looks like this:

Armenia_Inferior
Yerevan
armenia
Cappadocians
163 120 8
iron, wild_animals, hides
5
6


The settings are, in order:
Region_Name (underscore if two words)
City_Name (underscore if two words)
city culture
RGB value (remember how we had to set a unique value when making the province? That value goes here)
resource1, resource2, resource3 (I don't think there's a limit to the number of resources you can have)
Triumph Value (does not appear to be used in the game, just set it to 5 like almost every other province for simplicity)
Farm level (5-6 is about average, while some very fertile provinces have over 10)


Now we open up the descr_strat file and insert our province. If you want to give it to rebels, put it below the "slave" city list, and if you want to give it to a particular faction, put it in their city list. We're going to give this to Armenia. So go their section, and add a new settlement. I suggest just copying a previous one and editing it as necessary. I decided to make Armenia Inferior a large down with few military buildings:
settlement
{
level large_town
region Armenia_Inferior

year_founded 0
population 4500
settlement_tax 51
plan_set default_set
faction_creator parthia
building
{
type core_building governors_villa
}
building
{
type hinterland_farms farms
}
building
{
type port_buildings port
}
}And we need to add a garrison that is placed directly on the city here so they don't rebel against us in the first turn. We need to know the X, Y coordinates of our city, so we look them up using in Photoshop:
http://vaticanspecialforces.org/rome/province4.png.

I'm going to make this garrison NOT have a family member, because that's a whole different bag of worms and will unnecessarily complicate this guide. So we'll just stock them with regular units, but you HAVE to put a general in there (he'll appear with one of the units).
So I add this value here:
character Kudurmabug, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 208, y 71

army
unit east horse archer exp 0 armour 0 weapon_lvl 0
unit east horse archer exp 0 armour 0 weapon_lvl 0
unit east peltast exp 0 armour 0 weapon_lvl 0
Note two things about this:
First, my general has a valid Armenian name that isn't already taken. You can find these names in the /data/descr_names.txt file, in the appropriate faction list. Make sure the name is not already taken.
Second, my X, Y values are different that what Photoshop says. Photoshop's grid starts at the top left, whereas the game's grid starts at the bottom left. This means that your X value will be the same, but your Y value will be 155 - (whatever photoshop's y is). In my case, Photoshop gave me an X, Y of 208, 84. This is because the map is 155 pixels in height. Make sense?

Now, go into the /text folder and open the regions and settlement names text file associated with your campaign, and add a string value for your new province and city. Ours will look like this:

{Armenia_Inferior} Armenia Inferior
{Yerevan} Yerevan Now that we have all that added, we're going into the /data/world/maps/base/ folder and deleting these two files:
map.rwm
map_heights.hgt

Let's fire up the game now and see if it works. I'd recommend making your shortcut command line look like this: "E:\RTW\RomeTW.exe -show_err", without the quotations, and change the path to wherevery you've installed your game. This will usually give you an error message saying why the game crashes, if it does.

http://vaticanspecialforces.org/rome/province5.jpg

And in this case, it seems to load just fine. I placed this a little close to the river (passing unfriendly armies can't get through, (because it blocks it), so I may move the city a little by adjusting the black pixel in map_regions.tga. But you know how to do that now.

Troubleshooting - If your game is giving you errors, here are some likely problems:
1) The color used for the province is invalid. Either it's already in use or it's simply a color the game doesn't recognize (there appear to be several, and I don't think anyone knows which ones are or aren't). Simply change the color in an image editor.
2) The city is placed on an invalid location
3) The city list in descr_strat.txt is invalid, either it has an improper level (putting buildings in a "village" for example), or there is
an error in the code (as if you left out a line or a bracket).
4) The map.rwm and heights.hgt files have not been deleted and a change has been made that would require them to be (adding a resource, for example)
5) The regions.txt file has spaces in the city/province names. Remember, underscores.
6) The entry has not been added properly into the /text/CAMPAIGN_NAME_regions_and_settlement_names.txt file (if you get some kind of "string" error, this is likely the cause)

Well, that's all there is to it!
**********************************************************

Made By Burebista[Callatian] and Vorbis with RDB II support on www.twcenter.net (http://www.twcenter.net/)

This Tutorials will be enlarged in the future with new stuff. If we are missing some info pls. see the tutorials on this site [forums.totalwar.org] they are the best so far from what I've seen.

**********************************************************

The_Rat
06-22-2006, 21:37
the link to those images is dead

Lusted
06-22-2006, 21:38
The tutorial was written well over a year ago, im not surprised the image links are dead.

DVK901
09-08-2006, 15:41
Just out of curiosity...why the 'pencil' tool rather than the brush?

Makanyane
09-12-2006, 05:49
Just out of curiosity...why the 'pencil' tool rather than the brush?

Brush tool in Photoshop merges colours at the edges if you try using that you get more colours than regions and CTD. Pencil is solid colour and works fine.

PaintShopPro brush tool is OK you just need to check control settings are - paper texture = none, and opacity = 100%.

Oh, and welcome to the .org DVK901 - (always wanted to say that to someone!)

Rockpsl76
10-28-2006, 23:55
I tried creating a couple new British Providences. But now I'm getting all sorts of weird errors about ports being in specified in regions where they aren't allowed, and cities being in invalid locatoins. The reason I'm calling these wierd is because they are in other areas of the world that I never touched... I tried changing my colors, but that did seem to help. So unless I'm really bad at picking my random colors (and yes I do check them against the existing colors), I can't figure out what's wrong...

Any ideas?

descr_regions.txt

Brigantes
legion: Caledonica
Eboracum
celts
Pictones
255 164 33
timber, slaves
5
5
christianity 20 pagan 80

Domnonii
legion: Britannica
Isca
celts
Pictones
241 165 57
dogs, slaves
5
6
christianity 40 pagan 60

descr_strat.txt (this is in the middle of the slave faction territories)

settlement
{
level town
region Brigantes

year_founded 363
population 1094
plan_set default_set
faction_creator celts
building
{
type core_building governors_house
}
}

settlement
{
level town
region Domnonii

year_founded 363
population 563
plan_set default_set
faction_creator celts
building
{
type core_building governors_house
}
}

descr_regions_and_settlement_name_lookup.txt

Domnonii
Brigantes
Eboracum
Isca

barbarian_invasion_regions_and_settlement_names.txt

{Domnonii} Domnonii
{Brigantes} Brigantes
{Eboracum} Eboracum
{Isca} Isca

Rockpsl76
10-29-2006, 02:35
Ok, I've done this twice now, so I'm pretty sure there wasn't any operator error the second time. I installed Goth's 2.4.2 for BI. Then I run it and everything works. Then I add a province, and nothing works. Then I restore the files I modded back to Goth's version, and still nothing works? There is no hgt file being generated, but I delete the map file everytime. I did notice that a corrected_regions.tga and cliffs_debug.tga file get created in the base dirrectory everytime the game runs. I tried deleting these, but the game is still bust :( Anyone know of any other autogenerated files that might be corrupting the game? I've reinstalled the game 4 times today and I'm starting to get a little tired of it :( 16 hours is way to long to spend on such a simple mod :( I'm totally out of ideas now :(

Rockpsl76
10-29-2006, 04:37
Is there anyway to see errors besides -show_err? Because show_err isn't very useful... It only shows the last error/warning. And its always just showing me a warning unrelated to the crash, even when the game runs perfect.

5th try. I was able to add one province. Then when I tried adding a second one it bombed. Then I removed the province and it ran fine. Then I tried adding a second province in a different place and it bombed... I think there are only around 145 provinces in Goth's mod, I thought the province limit was 199? Why am I running into trouble arount 145?

Rockpsl76
10-29-2006, 07:56
After about 30 hours of straight struggling with this, I managed to get things working finally... Then I started to play the game, and guess what. Goth's mod breaks BI... No night battles, no loyalty... I minds as well have just stayed with RTW. Now I've got to restart my mods all over again :wall:

Rockpsl76
10-29-2006, 08:32
After about 30 hours of straight struggling with this, I managed to get things working finally... Then I started to play the game, and guess what. Goth's mod breaks BI... No night battles, no loyalty... I minds as well have just stayed with RTW. Now I've got to restart my mods all over again :wall:

NM I was wrong. I didn't realize none of the barbarians started with a loyalty factor. You have to add it :inquisitive:

How come I can't edit or delete my posts? I really didn't intend to troll this topic :embarassed:

Aemilianus the Younger
03-24-2007, 03:42
How about if we just want to move the location of an existing city in an existing province? And how do you change the names of an existing city?

Makanyane
03-24-2007, 09:32
You can move the position of an existing city by moving the location of the black pixel which represents it in map_regions.tga - just make sure you don't move it onto a forest or mountain tile (you need to cross reference to map_ground_types for that or check possible positions in game first). As tutorial says make sure you are using pencil tool to make changes so you don't get blurred colours.

Easiest way of changing name of city is to just change the displayed name in data/text/campaign_regions_and_settlements_names.txt for example

{Armenia_Inferior} New city name
{Yerevan} New region name
If you don't change anything within the brackets you don't have to change any other files - though it does make it a bit irritating for future modding, the name in the {} is the one that has to be used in descr_regions, descr_strat etc.

Madshadow202
05-18-2007, 20:47
I've tried adding a new province to Britannia using Goths mod for BI, but for some reason I cannot get the game to play right no matter what I do. I followed the instructions twice now and I cannot seem to figure out what it is I missed.

I know Rockpsl76 had a similar problem. How was this fixed?

Thanks

Marcus Orentius
06-30-2007, 04:17
Does anyone know how to check co ordinates on the map in photoshop? because it's eluded me.

Makanyane
06-30-2007, 16:49
In PS elements that is largely the same, you can go into "window" then select the "info" box, that then gives you both the RGB colour and the co-ordinate your cursor is over.

Maxinius Scipio
09-09-2007, 15:36
Hi, I tried to make my own region (Molise), but when I go to start up the imperial campaign I get a CTM, and when I close RTW it says that "Molise cannot be found in stringtable." What does it mean by stringtable? I'm sure I did everything I was supposed to do.

Maxinius Scipio
09-09-2007, 16:00
Wait, now the error message says,"you have chosen an invalid tile(0,0) for settlement of" and it says it's under descr_strat all the way at the bottom.

(Sorry for the double post, I couldn't edit my last post.)

Makanyane
09-09-2007, 16:57
see https://forums.totalwar.org/vb/showthread.php?t=85902

If line xxx is the bottom of the descr_strat file and the settlement name is not specified.

* Pixels on map_regions.tga of a colour that do not belong to any region colour specified in descr_regions.txt - watch out for merged colours when editing map_regions.tga as that is usual cause.

If settlement is named and line xxx is it's listing in descr_strat.txt

* Settlement is actually placed on invalid terrain. This may include being over river location, over impassable forest, or mountain ground types, or being over area marked as sea in map_heights.tga. The last includes areas of 'land' which are true black RGB 0,0,0 as the game takes them as sea unless a map_heights.hgt is created.
you sound like you've got the top one (there might be more possible causes though)

The stringtable is just it trying to make its own database to reconcile the names in descr_strat.txt descr_regions.txt and the file in data/text with the regions names in. It sounds like you figured that part out though.

Maxinius Scipio
09-09-2007, 20:05
Woohoo!!!! I got it to work, thank you!!

What happened was I had the region's settlement on bad terrain and some of the colors got mixed together.

Thanks again. :rtwyes:

That Zero Guy
09-16-2007, 03:50
In PS, when I open the info box, the X,Y coords are in decimals.

What do I do with that?

And by map there, you're referring to map_regions.tga, right?

Makanyane
09-16-2007, 16:14
Hi, welcome to the forums :2thumbsup:

I've only got access to PS elements at the moment but I suspect this is the same. You should be able to show 'info' palette as a window. In that's properties if you click more, so you get "info palette options" you can set "mouse coordinates" - "ruler units" to "Pixels", which is what you want.

And yes map_regions.tga is the one that is the right size to get coordinates from.

Once you have map loading you can also get co-ordinates by opening rome shell, use the ¬` key or ~ depending on keyboard, hover cursor over bit of map you want coordinate of and type
show_cursorstat
into prompt, hit enter and it will give coordinate under cursor.

Roman_Man#3
09-17-2007, 02:10
I've only got access to PS elements at the moment but I suspect this is the same. You should be able to show 'info' palette as a window. In that's properties if you click more, so you get "info palette options" you can set "mouse coordinates" - "ruler units" to "Pixels", which is what you want.
I usually just transfer it to Adobe Image Ready, that does the trick. Never though of changing the units.


Once you have map loading you can also get co-ordinates by opening rome shell, use the ¬` key or ~ depending on keyboard, hover cursor over bit of map you want coordinate of and type
show_cursorstat
into prompt, hit enter and it will give coordinate under cursor.
Alternitavly, if you don't want it very specific, just flip the image horizontaly (I think thats the one. You want it upside down). RTW measures from the top left of screen, while photoshop measures from bottom left. So this gets coordinates properly.

That Zero Guy
09-18-2007, 12:42
Thanks!

But I have another problem.

So i click provincial campaign, pick britons, hopefully so i can look and "harden up" with the prospects of seeing that i actually now have inserted a region.

but it doesn't work. i keep on going back to the screen where you choose which campaign you can choose.

and that sucks. i'm sure i did everything right. it's not like there's a lot of mountains in the area, so i don't see why it still doesn't work after putting the black dot really close to the coast line.

and i also changed the RGB values a few times, then changing desc_regions.txt, and checking all other files.

so yeah, what am i doing wrong here?

Makanyane
09-18-2007, 13:00
are you using -show_err ? it should give you a message when you exit the game for most of those sorts of problems.

That Zero Guy
09-18-2007, 13:23
ok, so it says:

"you have chosen an invalid coordinate (48,154) at the settlement of Dal Raida.
it will mean not being able to access this settlement and is a bug."

it also says something about the desc_strat file.

so i just change the map_regions.tga or do i have to do something else?

Makanyane
09-18-2007, 18:47
I'm assuming Dal Raida is the one you just added? Anyway if it gives co-ordinate it normally means it really is in the wrong place. If you placed it near the coast you might not have it quite tying up with map_heights so it might be in the sea! Check the corrected_regions.tga that should be in your main RTW folder to see if city pixel appears on that.

Otherwise double check the map_ground_types and if there is any mountain or dense forest in the area change it to a plain fertile colour for now.

Occasionally it gives you message about settlement when it is actually complaining about port. If you added port check where that is turning up on corrected_regions.tga as well.

additional note from https://forums.totalwar.org/vb/showthread.php?t=85902

Settlement is actually placed on invalid terrain. This may include being over river location, over impassable forest, or mountain ground types, or being over area marked as sea in map_heights.tga. The last includes areas of 'land' which are true black RGB 0,0,0 as the game takes them as sea unless a map_heights.hgt is created.

That Zero Guy
09-19-2007, 09:17
Thanks!

It seems that I forgot to delete the map.rwm, hehe.

so, thanks for everything. :D

Captain Nemo
09-21-2007, 13:52
About the map_heights.hgt: After a nicely failed attempt at provincial supplementation, I decided to load the game after each step, so I would know what went wrong. Right after the deletion of the aforementioned file (step 1, by the way), my Imperial Campaign failed to load. I have RTW 1.5, which is supposed to work without this file, correct?

Captain Nemo
09-21-2007, 14:48
I have also placed -show_err on my shortcut path, but nothing shows up when RTW exits. Perhaps this Dr. Watson program overrides it? I have also tried replacing the map_height.hgt with Alpaca's tga converter... still, no luck. I am only trying with one province - it must be something rather small that's messing things up.

Makanyane
09-21-2007, 16:00
Yes 1.5 should run fine without map_heights.hgt, the difference would be once it is deleted the game reads the map_heights.tga instead, so if there is a problem with that file it would show up then.

Did you delete the map.rwm at the same time? I'm pretty sure you would need to.

The most common problem that would show up without the .hgt file is that true black RGB 0,0,0 on map_heights.tga then gets read as water and not land (RGB 1,1,1 or lighter is fine)

The vanilla map has some 0,0,0 in odd places but not enough to cause trouble. Are you working on the original RTW map or a mod?


(Dr Watson shouldn't do anything to -show_err, unfortunately some odd problems in the files can mask something that would otherwise give error - a few people have experienced that but I don't think anyone pinpointed why)

Captain Nemo
09-21-2007, 16:34
I've deleted the map.rwm and map_heights.hgt together... and I haven't edited map_heights.tga. And I have been very sure to delete the newly generated map.rwm after any changes (all the time, just to be sure). The game loads fine, but after the regeneration of map.rwm, I get a KTM, then the Imperial Campaign can no longer be selected...

The map is the original RTW war map - no mods are installed at all.