PDA

View Full Version : Adding battlemap buildings to BI



alpaca
02-05-2006, 23:18
Ok, Verci convinced me to release that thing after I had it for a few days.
Now, this is a compilation of three text files which contain the decompiled information from descr_items.db
Here's a quick walkthrough to adding a new building into descr_items.db using this:

1. Extract the file you need (BI or 1.5) to your data directory
2. Backup descr_items.txt
3. Rename the file you extracted to descr_items.txt
4. Add to the beginning any Includes you want made, I recommend using this to add new buildings (you can see a readme on that in the original descr_items.txt)
5. Add your new building entries
6. Delete descr_items.db
7. Start the game
8. You get tons of error message (normally if you use show_err), either click through them or just hit ctrl+alt+del and kill the game process, but descr_items.db is generated anyways
9. Restart the game and enjoy ;)

If you want to use that in a mod folder, you have to extract the RTW item files you want to use there in order for the game to find them.
If you don't want to use a building that is in that file, just delete the entry.

Get the file here: descr_items.zip (http://www.twcenter.net/forums/attachment.php?attachmentid=695&stc=1)

SigniferOne
03-16-2006, 21:14
alpaca, I just wanted to say thanks, again, because this is a really nice thing! It's being very useful right now :)

EDIT: Also, allow me to ask the first question :)


type roman_tenamentA
lod
max_distance 200.0
model_rigid roman_tenamentA_high.CAS roman_tenamentA_med.CAS roman_tenamentA_low.CAS roman_tenamentA_lowest.CAS
lod
max_distance 400.0
model_rigid roman_tenamentA_high.CAS roman_tenamentA_med.CAS roman_tenamentA_low.CAS roman_tenamentA_lowest.CAS
lod
max_distance 800.0
model_rigid roman_tenamentA_high.CAS roman_tenamentA_med.CAS roman_tenamentA_low.CAS roman_tenamentA_lowest.CAS
lod
max_distance 1600.0
model_rigid roman_tenamentA_high.CAS roman_tenamentA_med.CAS roman_tenamentA_low.CAS roman_tenamentA_lowest.CAS
What's the point of there being four model_rigid files for EVERY level of detail?

alpaca
03-19-2006, 11:27
Yeah yeah that's why I edited in that those files are bugged ;)
I had a bug in my exporter tool, it wrote all lods into every one lod.
You can get the new files here: http://www.twcenter.net/forums/attachment.php?attachmentid=695&stc=1

SigniferOne
03-22-2006, 19:28
Ah very different now, only one file for each level of detail. Are you using some kind of automation to export all these entries? If so, was the four models per LOD merely just a bug in the exporting program or some kind of nifty feature in RTW? ;)

alpaca
03-24-2006, 12:34
Did you read my answer ;)
I'm using a self-written tool to export this stuff from descr_items.db and it had a bug where I forgot to delete the file names of the other lods from the string that holds the path to an lod and so it had all paths for all lods...
I fixed it and now it works like a charm.

Wundai
05-03-2008, 21:34
Hello,

Sorry for reviving this thread, But I hope someone can help me with this:

So I am Editing the descr_items.txt, everything goes fine until I try to edit the roman_colonnaded_portico.cas file, I try to change it into a building of my own.

So I edit the cas files/item files and the descr_items.txt and save it,

I delete the descr_items.db

But now when I try to start the game it gets to the startup screen and it crashes back to desktop without any error message.

Also a new descr_items.db is NOT made.
I kept the old descr_items.db and searched if something was wrong or not found in the files by starting some games in Rtw:Bi, but nothing

One strange thing was, that the old cas file was specified in the descr_items.txt as "roman_colonnaded_portico_high.cas"
but I can't seem to find this cas file ANYWHERE in the Bi or RTW folder.

Any ideas?

Makanyane
05-05-2008, 20:46
CA never issued the majority of the .cas files for the buildings,

you'll typically find the descr_items.txt has entries for a
xxx_high.cas and xxx_low.cas which generated a xxx.item -
but its only the .item that CA supplied with the game.

Have you been trying to change the .item / or make new .cas / or change .item and save it back as a .cas?


Is your -show_err working for other problems?

Wundai
05-05-2008, 21:26
Hey,

Well this is the order in which I did it:

-I got a new building .cas file into the models_building with the textures in models_building/textures

-Then in 3dsmax I pulled up the cas file and exported it as a known item file for the example here: the roman_colonnaded_portico.item

-Then I changed the entries in the descr_items.txt and removed the descr_items.db , after that the CTD's began after startup.

And my -show_err has worked so far that when a file couldn't be found it would report that as an error.

Furthermore it would normally report a list of errors when I deleted the descr_items.db, then I ended BI, restarted it, and the game would start normally with the new building, not this time though :(

Makanyane
05-05-2008, 21:44
I think you might need to not try to export it as an .item but leave it as a .cas and let the game make the .item file

so have
type roman_colonnaded_portico
lod
max_distance 4000.0
model_rigid your_cas_name.cas

in descr_items.txt - that's assuming you've only got the one lod level - that should get you a roman_colonnaded_portico.item that's based on your cas, assuming the .db file rebuilds.

unfortunately I have no idea why its not giving error message for the missing stuff - unless it's just falling over instantly because it doesn't like the exported item.


(Note you need to in the end get all the .item's in the same folder - but the process of letting the .db file build and go through missing items gives you a load of junk ones - based on the non-existent .cas files for the original stuff, so you need to make sure you overwrite everything apart from your new item with the original ones)

Wundai
05-06-2008, 10:31
Ah yes thanks, you're right about the not exporting it as item thing, could have saved me alot of work, and well, I would be happy to implement it as soon as the descr_items.db error goes away :sweatdrop:

Still let me see if I understand this correctly, you think when I overwrite all my item files with the old BI items, except this new one, the CTD might dissappear?

I'm asking again because its a pretty big step, and I'm worried it might just do more damage than good :(

I mean previously I did about 15 buildings the exact same way as this one and it worked out, now suddenly I'm facing an error which doesn't let me start Barbarian Invasion anymore.

Well, I also tried some different things which didn't work out:

-Create a bogus .cas file named roman_colonnaded_portico_high.cas
-Went into the old descr_items.db itself to change the .cas names, which strangely had the same effect as the descr_items.db not being there, a CTD
- Tried to rename the descr_items.txt entries back to what they were (roman_colonnaded_portico.high.cas and low.cas)

One funny thing was though Makanyane that when I started a game with the old descr_items.db(this was one of the first things I did, before all the things tried above) it suddenly gave the error message "cannot find data/models_building/roman_colonnaded_portico_high.cas and low.cas"
I mean why would it ask for a .cas file when CA never issued it with the game itself, hmm confusing.

Wundai
05-12-2008, 10:11
Makanyane are you still here?

Makanyane
05-12-2008, 11:49
sorry been off for a bit and missed question in last post... :embarassed:

re: overwriting the items (back up what you've got at moment anyway)
look in the items folder and see if you've got any new small items 1kb - that's what it makes if it tries to make them and can't find .cas - if you've ended up with any of those you definitely need to copy the original .items back in to replace them.

I never had any other inspiration for why you're crashing without error message though....

If you can get back to a working version (without the new roman_colonnaded_portico) is it worth trying to add the new building with a completely new name? And then change the instances of the roman_colonnaded_portico item being used in settlement plans to new_building_name item and see it that works? There seems to be something funny going on with it.


(Probably not relevant but one thing I did discover doing walls - if you're putting fake text for an item in the descr_items.txt to make new db file to accept an item you've got from elsewhere or previously generated - then you do need to have the right number of lod levels listed (same number that were used in generating the item) otherwise it'll try and remake them again even without deleting the db file.....

wondering if something like mismatch in lod numbers in the .db list and your item might have been cause of last error - if you had new item in use with old db)

Wundai
05-13-2008, 11:16
No problem mate,

Its just that you're the only help I got here with this problem :yes:

Well I overwrited every single 1kb .item file in my items folder I could find.

Then deleted the descr_items.db and still CTD to desktop :shame:

Well the thing is I kept the old descr_items.db so I can still start the game, but creating a new one is just not possible somehow so if I could do it without the roman_colonnaded_portico I would gladly do it, because I think you're right, there is something not right with that building.

By the way the building itself is not that important to the game, isn't it possible to just delete it everywhere? Items files/entries in the descr_items.txt etc.?

Oh yes and one more thing, truth is I don't really use LOD models, I just copy the same .cas building entry for every LOD model, the game doesn't lag, and it seems to give no problems with the buildings I put in so far?

With your last comment, did you mean you think I deleted one line in the descr_items.txt too many? For example an entire LOD line and that that mismatch caused the error? If that is the case maybe I should find some program that counts the textlines in a wordpad file or something and check with my BI descr_items.txt?

Wundai
05-13-2008, 12:58
Hahaha Great News,

I finally solved it with your help :laugh4:

So I checked both the descr_items.txt files from my mod and Vanilla BI and I noticed my mod had One Line more, so I manually searched through 75 pages, page by page to find that at one file the filename was broken off because of an ENTER.

Omg big errors come from small causes I guess but now it all works again, I can't thank you enough mate, been struggling with this problem for 2 weeks but its finally solved, Thanks Again! :2thumbsup:

Makanyane
05-13-2008, 12:58
With your last comment, did you mean you think I deleted one line in the descr_items.txt too many? For example an entire LOD line and that that mismatch caused the error? If that is the case maybe I should find some program that counts the textlines in a wordpad file or something and check with my BI descr_items.txt?
That wasn't actually what I meant - I was trying to incorporate another mod's item without having the .cas's to go back to and didn't know how many levels originally made it up - giving it an items listing with only one lod level when it actually had two originally meant it kept trying to regenerate the item even with out deleting the db file...... think that's probably a red herring for your problem based on the other stuff you've said.... (For completely new items we only had one .cas and only gave it the one entry at max_distance 4000.0, which worked fine too)



What happens if you try to start game without the .db file but with alpaca's BI items.txt file? Does that get you back to the conventional position of CTD with errors but re-generated .db file?? If it does then problem might indeed be typo or mis-formatting of the items.txt you're trying to use, a file comparison tool to compare yours with alpaca's might find the problem.

Examdiff seems to work
http://www.prestosoft.com/edp_examdiff.asp#download
you need to tell it to treat both files as text files though or it won't show anything. There are probably other ones too, I do remember someone else telling me that the line spacing between items (one line only between and none within them) is critical, though I never tested that myself - so if you do cross check make sure you've got the comparison showing up any line spacing differences.


EDIT: gah simultaeneous posting.... glad you fixed it! :)
- it sounds like you've confirmed the hard way for everyone else that the line spacing is important!!!!!

Wundai
05-13-2008, 13:01
lol I posted just a bit earlier I guess, its solved mate :2thumbsup:
Edit on your edit: Yes indeed, well I hope others may benefit from this as well then :)

wlesmana
05-17-2009, 15:32
I'm not sure if people still check this but here goes the question anyway:

If your mod is mod-foldered, can the desc_items.db be placed in the folder, or must it be in the parent folder (BI or vanilla)?
So in another phrase: does the mod line actually looks for a db file in a mod folder, or does it skip it and look in the parent foler instead?

Makanyane
05-17-2009, 15:50
a new .db file will be read from the mod-folder and if not there it will look in the RTW folder
(if you are using a mod-folder it will never automatically look for anything in the BI folder, even if using BI.exe.... hence the problem with having to duplicate most of stuff from BI/data into your_mod/data)

if you have any new .items in your modfolder you also need to copy in all the vanilla (either RTW or BI) ones into your modfolders /items folder

wlesmana
05-18-2009, 08:03
Thanks for the reply, Mak!
One more question: so what does ITEM files actually do? I noticed BI only has new .cas files for their buildings. So what is the purpose of ITEM files? If I made a new .cas for a new building, it appears to be optional whether I include it as an ITEM or not?

Makanyane
05-18-2009, 23:07
I actually thought the Items where the only ones used... and the .cas's CA had left behind in the BI folder where irrelevant once the item was made?

taking an example the
BI_barb_stables_lvl_4_lod1.CAS's etc you'll find they are listed in the extracted version of descr_items.txt that Alpaca posted eg:


type BI_barb_stables_lvl_4
lod
max_distance 200.0
model_rigid ../../bi/data/models_building/BI_barb_stables_lvl_4_lod1.CAS
lod
max_distance 300.0
model_rigid ../../bi/data/models_building/BI_barb_stables_lvl_4_lod2.CAS
lod
max_distance 800.0
model_rigid ../../bi/data/models_building/BI_barb_stables_lvl_4_lod3.CAS
lod
max_distance 1200.0
model_rigid ../../bi/data/models_building/BI_barb_stables_lvl_4_lod4.CAS

and the resulting
BI_barb_stables_lvl_4.item
is in the BI/data/items folder (you can see from code example that its incorporated the various lod levels into one item)

I've not tried running without the BI cas's still in the folder but as RTW doesn't include its cas models I'd assumed they were redundant....

wlesmana
05-19-2009, 10:24
Aah, ok, I got it, I think. I didn't see the items folder in BI before so I assumed they only used the .cas files.

Thanks, Mak!