PDA

View Full Version : Adding a Unit to the Game - Solutions to FAQs.



Hesford
04-13-2007, 09:44
Firstly, this is not the tutorial, this is a solution FAQ. For the tutorial go here:

https://forums.totalwar.org/vb/showthread.php?t=75706

Secondly, do not post new questions in this thread unless you have an answer to them, in which case please give your answer along with the question.

Finally, I'd like to thank Musashi for writing the great tutorial, and KnightErrant and anyone else who helped give answers to people's problems.

Let's get started, I will be updating this post as the tutorial thread progresses. If you have better answers to a question please say.:2thumbsup:

Q1) Where can I find the files needed?

A1) export_descr_unit (EDU) and export_descr_buildings (EDB) - Can be found in ProgramFiles/SEGA/MedivalIITotalWar/Data

Model DB file can be found in SEGA/MedivalIITotalWar/data/unit_models/battle_models.modeldb

Unit icons can be found in
ProgramFiles/SEGA/MedivalIITotalWar/data/ui/units/

export_units can be found in
ProgramFiles/SEGA/MedivalIITotalWar/data/text - After running alpaca's strings.bin converter. https://forums.totalwar.org/vb/showthread.php?t=75229

Q2) Do you have to do this in the base game, in a mod folder, or can you do it in either?

A2) The battle_models.modeldb file will only be parsed in the BASE data/unit_models folder. To get the game to parse it you have to add --io.file_first to your command line or batch file.

Q3) What if I want to use just an existing model with a different mount?

A3) Then there's an easier way to do it. Basically it can be done with just the export_descr_unit file. Just set the mount, soldier, and upgrade lines in your unit's entry in the EDU file to what you want them to be.

Q4) Which of these steps do you need to undertake to simply make an already existent unit available to a new faction? In my case I want to give the Naffatun to the Moors. I don't even care about the texture as long as the guys are there and visible.

A4) Well, since Naffatun don't have an entry in the model DB file for the moors, you'll have to either change the lines for the Turks to be for the Moors by changing the faction name, or add texture lines for the Moors. The problem with changing the Turks lines, is that the Naffatun will become invisible when the Turks field them.

Q5) I'm getting a blank screen on loadup, what have I done wrong?

A5) Usually a syntax problem in modeldb file, recheck your
character counts for each entry. Make sure you've updated the faction
count number in both places, body textures and attachment sets.

Q6) My game loads and gets to splash screen but then dies, what have I done wrong?

A6) There is something wrong in EDU or EDB. Check entries in both against what you have in modeldb. Also make sure you've updated the model count on the first line of the modeldb file.

Q7) My new units are invisible, please help?

A7) If people have been working with Milkshape files, this can happen especially if you are working with a file saved under an old version of Milkshape or a plugin that saves in the old format of Milkshape. If this is the case open the file in Milkshape, go to Menu/Vertex/Sims2 Unimesh Show Bone Assignment 2 (or 3 or 4) v.407. This forces the vertex weighting into play. Resave the file, reconvert and this should take care of the Regiment of Invisible Men if this was the problem.

A7b) If you're using a mymod and that's where your modded export_descr_units.txt file is and load the game through a shortcut to a .bat rather than the man launcher then --io.file_first must not only be in the shortcut command line , but also in the .bat .
Find the mymod.bat {located in Program Files\SEGA\Medieval II Total War} , right click it , select edit from the menu and add --io.file_first to the end of the text therein {which is medieval2.exe @mymod.cfg } with a single space between them so it will then read medieval2.exe @mymod.cfg --io.file_first. save the file and close it and Bob's your Uncle .

Thanks to Mr. Frost for A7b.


Q8) How do I replace weapons and shields?

A8) Switching weapons requires GrumpyOldMan's mesh conversion and
merge tool. The weapons are part of the mesh. This is a very long
wiki thread here:

https://forums.totalwar.org/vb/showthread.php?t=79414

but in the later pages after the tool was released, you'll see a lot
of examples of people doing what you want. There's a tutorial
that zxiang1983 wrote:

http://www.twcenter.net/forums/downl...p?do=cat&id=28

It's the file mesh to ms3d Basic_tutorial.doc

Will update.

KnightErrant
04-14-2007, 06:05
I think this is great, here's my first contribution to it,
though it isn't even a problem I had, I want to contribute
something I saw elsewhere. (this is a GrumpyOldMan's solution
but I'm stealing from his knowledge):

(Q) Got a unit in-game but the cavalry animation isn't right:

(A) Bad animation entry.



Hi

@HK

Quote:
I think I'm getting somewhere with that but could someone please tell me how do I get those guys to be properly mounted
Your main problem is your using foot animations in your modeldb

Now I'm not sure what the entries that are required for a mounted arquebusier (but if you work it out I'd like to know) but if you look at the modeldb entries for a camel gunner:-

Quote:
17 camel_gunners_ug1
1 4
64 unit_models/_Units/ME_Burmous_Padded/camel_gunners_ug1_lod0.mesh 121
64 unit_models/_Units/ME_Burmous_Padded/camel_gunners_ug1_lod1.mesh 900
64 unit_models/_Units/ME_Burmous_Padded/camel_gunners_ug1_lod2.mesh 2500
64 unit_models/_Units/ME_Burmous_Padded/camel_gunners_ug1_lod3.mesh 6400
1
5 moors
70 unit_models/_Units/ME_Burmous_Padded/textures/ME_burmous_moors.texture
71 unit_models/_Units/ME_Burmous_Padded/textures/ME_burmous_normal.texture
47 unit_sprites/moors_Camel_Gunners_ug1_sprite.spr
1
5 moors
60 unit_models/AttachmentSets/Final ME Heavy_moors_diff.texture
60 unit_models/AttachmentSets/Final ME Heavy_moors_norm.texture 0
1
5 Horse
16 MTW2_CR_Arquebus
13 MTW2_CR_Sword 1
24 MTW2_HR_Arquebus_Primary 1
18 MTW2_Sword_Primary
16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
You can see that the highlighted areas use mounted animations (CR_ stands for Camel Rider and HR_ for Horse Rider). Possibly change the CR_Sword for HR_Sword for your figures. My knowledge of the text entries is very basic, try looking for threads that deal in more detail, and asking there.

Let me know how you go.

Cheers

GrumpyOldMan
Reply With Quote

grumpyoldman
View Public Profile
Send a private message to grumpyoldman
Find More Posts by grumpyoldman
Hans Kloss's Avatar
off
Hans Kloss is offline
Posts: 1,107
Local Moderators


Old Today, 06:37 PM / Re: Starting to unravel the MESH format
#187
Hans Kloss
Grumpy you are a superstar

HTML Code:

16 MTW2_HR_Arquebus
13 MTW2_HR_Sword 1
24 MTW2_HR_Arquebus_Primary 1
18 MTW2_Sword_Primary

and finally it is all working



Don't know if I nailed it but the problem resolved by GrumpyOldMan had to
to do with bad animation entries for the converted files. This is good enough
for promotion to a resolution entry in your FAQ, because its sure to come up again.

Hesford
04-14-2007, 08:54
Thanks KnightErrant. Damn every time in that post I spelt Medieval 'Medival'.
Anyway.

Q10) What do the first two numbers mean at the start of this line?

52 unit_models/_Units/EN_Lmail_Hmail/templars_lod0.mesh 121

A10) They mean that the following string will have 52 characters in. So if you had the number 56 in front, the string would be something like

unit_models/_Units/EN_Lmail_Hmail/hospitallers_lod0.mesh 121

Hesford
04-14-2007, 09:01
Q11) Where can I find a more easily readable battlemodel DB file?

A12) Here: http://www.twcenter.net/forums/downloads.php?do=file&id=1180
It is seperated into very readable chunks, and nicely layed out. Unit making will be much easier with this.

Hesford
04-14-2007, 09:16
Q12) What do the Bold numbers stand for?

4 61 unit_models/_Units/EN_Peasant_Padded/ne_cannon_crew_lod0.mesh 121 61 unit_models/_Units/EN_Peasant_Padded/ne_cannon_crew_lod1.mesh 900 61 unit_models/_Units/EN_Peasant_Padded/ne_cannon_crew_lod2.mesh 2500 61 unit_models

A12) As far as I understand it the 4 means there are 4 level of detail meshes to load for the unit and the larger numbers are the distance that each lod should be used.

Mr Frost
08-21-2007, 11:41
Q7) My new units are invisible, please help?



Will update.
...
A7b If you're using a mymod and that's where your modded export_descr_units.txt file is and load the game through a shortcut to a .bat rather than the man launcher then --io.file_first must not only be in the shortcut command line , but also in the .bat .
Find the mymod.bat {located in Program Files\SEGA\Medieval II Total War} , right click it , select edit from the menu and add --io.file_first to the end of the text therein {which is medieval2.exe @mymod.cfg } with a single space between them so it will then read medieval2.exe @mymod.cfg --io.file_first .
save the file and close it and Bob's your Uncle .:2thumbsup:


You may now worship me .






I must now go and give my mighty unlocalised placement texts some names .

mor dan
08-21-2007, 16:31
but in the later pages after the tool was released, you'll see a lot
of examples of people doing what you want. There's a tutorial
that zxiang1983 wrote:

http://www.twcenter.net/forums/downl...p?do=cat&id=28



that link no longer works.

nikolai1962
10-24-2007, 16:07
A2) The battle_models.modeldb file will only be parsed in the BASE data/unit_models folder. To get the game to parse it you have to add --io.file_first to your command line or batch file.



Maybe I'm misunderstanding what you mean but changes i've made to the modeldb file in my mod folder are working from that folder? (1.2 patch)

absinthia
08-16-2008, 11:28
i can confirm that the battle_models.modeldb file works fine from the mod folder. at least it does in kingdoms expansion.