Log in

View Full Version : Building Files



Thor the Bassist
01-03-2008, 14:52
Can anyone give a short explaination of the building files and how they are linked to each other.

The model/info files are .cas .item and .bpi i think. The .cas is artificial and created so the game can convert it to .item for the battlefield model.

I have no idea what the .bpi does but the pak extractor spits it out.

The txt files are descr_buildings.txt, expr_descr_building.txt and the descr_building_model folder (multiple ones in there). These have all the stats in for the buildings but I dont know which one dictates the building's name, the battle stats, the build and upgrade stats etc and which dictates the model files to be used.

I've been trying for a couple of days to get buildings into the game as i've done some unit model and maps but cant get buildings to work. So far i've been overwriting the eastern city barracks model (used by parthia etc) but I either get a CTD without an error when i go to battle map or the city barracks uses the default RTW model.

Plz help :wall:

Makanyane
01-03-2008, 17:12
Hi and welcome to the forum,

have a look at this
https://forums.totalwar.org/vb/showthread.php?t=60818
and see if it helps you get the method for getting game to create item files right, in case you are having problems with that. Only way we found to get it to work in mod was to save model as a .cas and then let game convert to .item, trying to export to item files directly didn't work.

Nothing in text files specifies the texture to be used, so make sure you include the textures that the .cas file was using (it defaults automatically to those) and they must be in models_building/textures


descr_building_battle.txt gives the stats for the buildings, but most are actually specified in the separate text files that it 'includes' you'll see section in that which lists the ones in use like

include dbb_slot_fillers.txt

include dbb_walls_wooden.txt
include dbb_walls_roman.txt
you can make new text file and add it to the include list or add your building info to the bottom of descr_building_battle.txt


For naming; I think buildings that are in EDB get their name from the export_buildings file in data/text, ambient buildings that you just place in settlement plans can be named using data/text/building_battle.txt
so if you use
localised_name sacred_blood
in the buildings battle info

you need
{sacred_blood} Sacred Blood
in building_battle.txt (don't ask what that was about!)

giving it a new localised name and not giving it the entry in building_battle.txt
will give you CTD

you can use
localised_name ambient
if you just want it to say 'building'


The .bpi files are another conversion of a different sort of .cas file which gives the game information about the size of the building so things don't walk through it.
We didn't manage to make new ones for our mod, but re-used existing ones for roughly similar sized buildings/objects. You list those but call them .cas
lr_statue_meta
{
full_health 10
localised_name ambient
level
{
min_health 0
battle_stats
item lr_statue_meta
physical_info INFO_SHRINE_ROUND.cas
}
}
in the descr_building_battle.txt (or included new text file)


If you've added new building in EDB that didn't have a battle model assigned to it before you'll have to edit descr_settlement_plans.txt to get it to appear in a slot.


say if any of that helps or if you're still totally stuck!

Thor the Bassist
01-03-2008, 17:55
Thanks. I looked at the tutorials but didn't have any joy as the game doesn't create the items if you are overwriting a original model.

However I just stumbled on a workaround and if you create a new building you can then re-name the item file you get from that or re direct the item directory in the txt files. My textures screwed up so I think I need help with that but I'll search the forum.

Makanyane
01-03-2008, 18:18
on the items it should do it for an existing building if you follow Alpaca's tut and delete the existing items.db file.

Things to watch - it only actually makes the conversions in sequence with when it gives you the error message that its missing XXX and you click through - so you'll want to move any existing building you're trying to remake to the top of the items.txt file!

We did it for walls from mod folder so you have entries like

type roman_town_wall_straight
lod
max_distance 4000.0
model_rigid ../../bi/eod2/data/models_building/roman_town_wall_straight.cas
moved to the top of the file, in our case path is for working from bi mod-folder

for the generation if you tell it to look for your new cas in a mod-folder or differently named folder that should sort out any confusion with it trying to refer to RTW packs for the model.


If you let it run through the items.txt list till it gets to the existing models, a lot of them don't have .cas files sent with the game so it will start generating non-functioning 1kb ones, make sure you don't end up with those in game! I did the items making procedure on a spare install and just copied the regenerated items.db and the new items I wanted over to my proper install.


You have to have entire contents of items folder in one place in the end btw, you can't have some in data/items and try and read others from packs, if you use mod-folder you need all the items in the mod-folder.

Thor the Bassist
01-04-2008, 15:08
I've got the item files working using verci's dbedit.exe to edit the entries in the .db file. The whole thing has basically worked except for the textures and UV mapping which seems to have been lost maybe as early as during the export from max.

I stumbled on a problem that the game will not overwrite an original item file it will magically recall the old item file even if you deleted it (eg the city_barracks_eastern.item file which i deleted to replace it with my new city_barracks_eastern.item was actually replaced by the original file somehow) but this can be worked around by creating a new building and then redirecting the original eastern_city_barracks to use the new .item file.

My main problem is the textures which currently appear skewed and without any UV mapping (infact I believe its using the wrong texture files). If anyone knows about that i'd be grateful.

Thor the Bassist
01-04-2008, 15:22
Sorry for the double post I cant find the edit button in this forum.

I gibbered a bit in the last post. I meant that I had got the building into game fine but the textures were all skewed. Does using more than one texture per model or anything like that cause problems?