Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: [Tutorial] Joining models in Heroes 5
Thread: [Tutorial] Joining models in Heroes 5
Hayven
Hayven


Famous Hero
posted June 09, 2014 05:47 PM bonus applied by VOKIALBG on 10 Jun 2014.
Edited by Hayven at 17:11, 19 Nov 2014.

[Tutorial] Joining models in Heroes 5

Hi everybody!

Here I come up with a tutorial which I was asked to create by bigjocker. It tells about joining models in Heroes of Might and Magic 5!

I started joining models with [url=http://www.youtube.com/watch?v=sYWT0mg9fwM]Lord Khorne's tutorial and this one is based on the Khorne's. However, my goal was to be more specific about what to do.

There will be some steps in the whole operation:

1. Separating model from the game files
2. Adding Effects to the animation files
3. Preparing ModelInstance file
4. Making textures

Ah, an first of all, if you want to play with modding, you should firstly extract whole data.pak with 7-zip.

First Step - getting model

To join models you have to first decide which creature do you want to add a model to. I chose Vindicator and I am going to add him an axe instead of sword. The axe will be the Great Axe of Giant Slaying.

Luckily Vindie has all his files in one folder. I will only make his battle model appearing both during combat and on the adventure map, excluding unnecessary LOD model. If you want to create a new creature with its joined models, put all of its .(Model), .(AnimSet), .(BasicSkelAnim), .(Material) (and so on) files into one folder. Remember to change their internal paths
(e.g.
Material href="blabla.(Material).xdb#xpointer instead of
Material href="/_(Material)/Creatures/Neutral/blabla.(Material).xdb#xpointer)

Second step - adding an animation effect to creature

Joined models are nothing more than .(ModelInstance) effects added to creatures. To make everything work you have to get:

1. .(Effect) file
2. .(ModelInstance) file

You'll find an example .(Effect) file in directory /Effects/_(Effect)/Artefacts/Magic_Want_Glow.(Effect).xdb. Copy this file to your creature's directory and erase everything between "Instances". Add a </Models> line after <Models> to make everything looking like below:

<?xml version="1.0" encoding="UTF-8"?>
<Effect>
<Instances/>
<Lights/>
<Models>
</Models>
<WindAffected>false</WindAffected>
<WindPower>1</WindPower>
<Duration>2.5</Duration>
</Effect>

You'll find the .(ModelInstance) file in /Effects/_(ModelInstance)/Effects/Artefacts/General_blue.xdb. You can rename it with "General_blue.(ModelInstance).xdb" but it's not important.
Erase Model and AnimSet directories and add a "GlueToNamedBone" line, also change some other values. Below you can check out an example of a blanc .(ModelInstance) file. You can also backup your .(Effect) file and replace its text with this:

<?xml version="1.0" encoding="UTF-8"?>
<ModelInstance ObjectRecordID="1000230">
<Model/>
<SkelAnim/>
<Position>
<x>0</x>
<y>0</y>
<z>0</z>
</Position>
<Rotation>
<x>0</x>
<y>0</y>
<z>0</z>
<w>1</w>
</Rotation>
<Scale>1</Scale> --- sorry for stupid mistake, it had to be 1 by default
<Offset>0</Offset>
<CycleLength>10</CycleLength>
<CycleCount>0</CycleCount>
<GlueToNamedBone>Unknown</GlueToNamedBone>
<GlueToBone>0</GlueToBone>
</ModelInstance>

Find your creature's animation (.(BasicSkelAnim)) files and open them. Change line <Effect href=""/> to

<Effect href="Effect.xdb#xpointer(/Effect)"/>

in each of them, where "Effect.xdb" means the name of your file.

Add your ModelInstance to the Effect file, like that:

<Models>
<Item href="Axe.xdb#xpointer(/ModelInstance)"/>
</Models>

Third step - adding the ModelInstance to creature

Now check your ModelInstance once again. Find the files of the model which you want to add and copy all of them (.(Model), .(Material), .(Texture) etc.) into your creature's directory. For me the needed files will be:
1. Great_Axe_of_Giant_Slaying.(Model).xdb - I'll raname it with Axe.(Model).xdb to make the things more clear.
2. Great_Axe_of_Giant_Slaying.tga.xdb
3. Great_Axe_of_Giant_Slaying.tga.dds

I won't rename files 2. and 3. but only change the direction in the model file to make it finding new textures in my folder. This line now looks like that:

<Texture href="Great_Axe_of_Giant_Slaying.tga.xdb#xpointer(/Texture)"/>

Now I'll add a directory to the ModelInstance file to make it finding my model. This line will now look like this:

<Model href="Axe.(Model).xdb#xpointer(/Model)"/>

I will also find a bone that I want to add my axe to. It will be sword and thanks to that my axe will move exactly like the sword before. To check what's this bone's name you'll have to install the Granny Viewer or something to look at skeletons - maybe Nexus Buddy? I haven't tried it but it probably has the Granny Viewer in it.

When you are ready, find your model's .(Skeleton) file. It will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<Skeleton>
<SrcName href="/H5A1/Models/Creatures/Renegates/Swordsman.mb"/>
<RootJoint>Global</RootJoint>
<MSRFormat>true</MSRFormat>
<Animations/>
<uid>6F3184EF-26AB-46CF-9DF1-36EFDA10C410</uid>
</Skeleton>

Copy the ID from <uid> line and open Granny Viewer. Choose "Load New Model", navigate to the data/bin/skeletons/ folder and paste the copied ID. GV will automatically find skeleton. Right-click on the screen and choose "Skeletons". Press "Bone Connectors" and "Bone Names".



Now find the bone you're interested in and type its name in the "GlueToNamedBone" line. For me it is "Sword_joint" so for me it looks like:

<GlueToNamedBone>Sword_joint</GlueToNamedBone>

Now the last, fourth step

First, remove the part of the original texture that you won't need in the new model.

Now it's the time to run the Map Editor. Create a new, tiny map and put your creature in it. You'll see your modelinstance floating somewhere in the space.



WARNING!!! If the erased texture still appears, find correct .(Material) file and change line "AlphaMode" from AM_OPAQUE to AM_ALPHA_TEST.

Now open your ModelInstance and find "Position" and "Rotation" line. Now it's the time to adjust them to put your instance in its correct place. Every time you change some of the values, reload the editor to check changes.

WARNING!!! Don't change any of rotations more than "-0.5" or "0.5" as it will result with glitches. I did it because It was necessary to add weapon but you shouldn't do it anyway.

HINT: You can open your idle00.(BasicSkelAnim) file and change <uid></uid> to <uiad> to disable the animation so that your directions will be exactly like standard x-y-z axis for every bone. Then you can remove 'a' from <uiad> to restore the old animation.

The result looks like that:



 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
markkur
markkur


Honorable
Legendary Hero
Once upon a time
posted June 10, 2014 01:12 PM

You put some time into this, nice effort Hayven

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 09, 2014 04:22 PM

I don't understand your explaining!

Hi Hayven!

i don't understand something:  " You can rename it with "General_blue.(ModelInstance).xdb" but it's not important.
Erase Model and AnimSet directories and add a "GlueToNamedBone" line, also change some other values. Below you can check out an example of a blanc .(ModelInstance) file. You can also backup your .(Effect) file and replace its text with this:
   i dont know Where should i write gluetonamedbone and what would i write between them. And ,so now replace the texts at General blue xdb or at the Magic glow(or something like this)Effect.xdb
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 09, 2014 08:08 PM

You'll have to replace it in the file which is more similar

This <GlueToNamedBone> line is to add in the .(ModelInstance) file. Between the tags you have to write the name of 'bone' which you want to add your weapon to so it will move like the chosen bone. Most likely it'll be named 'Weapon', 'R_Hand' 'Fork', 'Sword' or so.

If you want to make sure what's its name, check it in the Granny Viewer (i told about it above).
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 10, 2014 12:17 AM

"You'll have to replace it in the file which is more similar"
more similar to General blue xdb or the effect's xdb
                                         


 
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 10, 2014 10:56 AM

Quote:
i don't understand something:  " You can rename it with "General_blue.(ModelInstance).xdb" but it's not important.


The name is optional. You can name your instance even "Shauvinistic jackass" if you remember to write this name in the .(Effect) file to make sure that the game will find it

Quote:
more similar to General blue xdb or the effect's xdb


More similar to the replacing text

I said:
You can also backup your .(Effect) file and replace its text with this:

<?xml version="1.0" encoding="UTF-8"?>
<ModelInstance ObjectRecordID="1000230">
<Model/>
<SkelAnim/>
<Position>
<x>0</x>
<y>0</y>
<z>0</z>
</Position>
<Rotation>
<x>0</x>
<y>0</y>
<z>0</z>
<w>1</w>
</Rotation>
<Scale>0</Scale>
<Offset>0</Offset>
<CycleLength>10</CycleLength>
<CycleCount>0</CycleCount>
<GlueToNamedBone>Unknown</GlueToNamedBone>
<GlueToBone>0</GlueToBone>
</ModelInstance>



Is that the fragment you didn't understand?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 10, 2014 02:44 PM

Yes... "Shauvinistic jackass" XDDDDDDDDDDDDDDD
 
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 10, 2014 03:03 PM

Ahm, I told wrong thing.

.(Effect) said:

<?xml version="1.0" encoding="UTF-8"?>
<Effect>
<Instances/>
<Lights/>
<Models>
</Models>
<WindAffected>false</WindAffected>
<WindPower>1</WindPower>
<Duration>2.5</Duration>
</Effect>



.(ModelInstance) said:

<?xml version="1.0" encoding="UTF-8"?>
<ModelInstance ObjectRecordID="1000230">
<Model/>
<SkelAnim/>
<Position>
<x>0</x>
<y>0</y>
<z>0</z>
</Position>
<Rotation>
<x>0</x>
<y>0</y>
<z>0</z>
<w>1</w>
</Rotation>
<Scale>0</Scale>
<Offset>0</Offset>
<CycleLength>10</CycleLength>
<CycleCount>0</CycleCount>
<GlueToNamedBone>Unknown</GlueToNamedBone>
<GlueToBone>0</GlueToBone>
</ModelInstance>




____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 11, 2014 02:39 PM
Edited by konterr56 at 16:36, 11 Jul 2014.

And now then the general blue xdb is the Modelinstance file.I understand it now.(If i wrong pls write it)

i do not understand i tried everything you've written but nothing happened,I think you should make a video about "Joining models in heroes 5"(But it can be the fault is inside of me).
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 11, 2014 05:47 PM
Edited by Hayven at 17:48, 11 Jul 2014.

Yes, you ARE right now

The structure is:

.(CreatureVisual) -> .(Character) -> .(AnimSet) -> .(BasicSkelAnim) -> .(Effect) -> .(Model Instance) -> .(Model)

Send me your mod, please - I'll check what's wrong
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 11, 2014 09:12 PM

Ok ,but i think i've modded just some of those files that you've written now.
I have theese files in one folder(but it's sure wrong because i don't know how much and what file belongs to the vindie or for me the squire.I know you've written,but you didn't said that so far you posted now the structure.):-BasicSkelAnim files (All of Squire's)
                   -General_Blue.(ModelInstance).xdb:
<?xml version="1.0" encoding="UTF-8"?>
<ModelInstance ObjectRecordID="1000230">
<Model href="Great_Axe_of_Giant_Slaying.(Model).xdb#xpointer(/Model)"/>
<SkelAnim/>
<Position>
<x>0</x>
<y>0</y>
<z>0</z>
</Position>
<Rotation>
<x>0</x>
<y>0</y>
<z>0</z>
<w>1</w>
</Rotation>
<Scale>0</Scale>
<Offset>0</Offset>
<CycleLength>10</CycleLength>
<CycleCount>0</CycleCount>
<GlueToNamedBone>Sword_joint</GlueToNamedBone>
<GlueToBone>0</GlueToBone>
</ModelInstance>
                       -2 AnimSet files:/Footman_LOD-adv.(AnimSet).xdb,Footman-arena.(AnimSet).xdb/
                       -The Axe's (Model).xdb,.xdb and dds file
                       -Footman.(Model).xdb,Footman_LOD-footman_lambert.(Material).xdb,Footman_LOD-Footman_LOD.(Texture).xdb,Footman_LOD-Footman_weapon_LOD.(Texture).xdb,Footman_LOD-weapon_lambert.(Material).xdb
                       -And the Effect.xdb:<?xml version="1.0" encoding="UTF-8"?>
<Effect>
<Instances/>
<Lights/>
<Models>
<Item href="General_blue.(ModelInstance).xdb#xpointer(/ModelInstance)"/>
</Models>
<WindAffected>false</WindAffected>
<WindPower>1</WindPower>
<Duration>2.5</Duration>
</Effect>

And that's all,I hope you can tell me what's wrong with itI think you will write so much wrong about it





____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 12, 2014 01:02 PM
Edited by Hayven at 13:19, 12 Jul 2014.

Do your .(BasicSkelAnim) files all point to Effect href="Effect.xdb"?
Is your Swordsman .(Model) put in /_(Model)/

Check out this, more advanced scheme and check out if you made all files finding each other:

.(CreatureVisual)
            |
/---- .(Character)-----\               ELSE .(AdvMapMonsterShared) -> LOD.(Model), LOD.(AnimSet) etc.
|                      |
.(Model)----------\    .(AnimSet)
|             |   |       |
.(Material) -skel -geom   .(BasicSkelAnim)
|(norm.)|(mirror)     |         |          |
.(Texture)        -geomAI   .(Sound)   .(Effect)--------------------------\
|                                   |            |                        |                    |  
.(Texture).dds            ID.wav   .(ParticleInstance)  .(ModelInstance)  .(LightInstance)
                                                                      |             |
                                                                    .(Model)     .(BasicSkelAnim)
                                                                     |
                                                                      \- skel, geom, geomAI, .(Material) -> .(Texture) -> .(Texture).dds

Remember that if you put for example .(Texture) file in .(BasicSkelAnim) folder and modify it, the game won't fint it unless you change directory in .(Material) file and put it in its folder. Moreover, I recommend to find:

.(Model), .(AnimSet), .(BasicSkelAnim), .(Material), -skel, -geom, -geomAI, .(Texture), .(Texture.dds files and put them all into one folder. Then you have to change their internal directories for example .(Model) to make it not "/_(Material)/auto-importec/blabla/.(Material).xdb" but ".(Material).xdb". Moreover you may also have to change .(Character) or .(CreatureVisual) directories.

You can download my Succesion Wars 0.01a to find out how I made creatures' models appearing in game and map editor. Erasing .(AdvMapMonsterShared) LOD files, changing .(CreatureVisual) directories, finally putting .(Character), .(Model), .(AnimSet), .(Effect) and the rest into one folder changing their directories so that they will find each other.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 12, 2014 08:20 PM
Edited by konterr56 at 13:18, 13 Jul 2014.

That's nice but i've found this in Footman.(Model).xdb:
<Texture href="/Textures/Creatures/Haven/Footman_LOD/Footman_weapon.tga.xdb#xpointer,    now then what destination is need to be modded to change wepaon,this or the other one.
We will be confused about this
(and pls tell me how can i make pictures about my creatures)
And should i write to the specability basicskelanim file the <Effect href="Effect.xdb#xpointer(/Effect)"/> because the specability has this:
<Effect href="/Effects/_(Effect)/Characters/Creatures/Haven/Footman/Specability.xdb#xpointer(/Effect)"/>
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 13, 2014 04:16 PM

Quote:
And should i write to the specability basicskelanim file the <Effect href="Effect.xdb#xpointer(/Effect)"/> because the specability has this:
<Effect href="/Effects/_(Effect)/Characters/Creatures/Haven/Footman/Specability.xdb#xpointer(/Effect)"/>


To EVERY BasicSkelAnim. If you want the Specability effect to be saved, just find it, copy to your folder and add your ModelInstance line (between <Models> and </Models>. Then, change the BasicSkelAnim patch to <Effect href="Specability.xdb#xpointer(/Effect)"/>

Quote:
<Texture href="/Textures/Creatures/Haven/Footman_LOD/Footman_weapon.tga.xdb#xpointer,    now then what destination is need to be modded to change wepaon,this or the other one.
We will be confused about this


Find this .(Texture) file and following .dds texture and copy them into your folder with model. Change path to <Texture href="Footman_weapon.tga.xdb#xpointer(/Texture)"/> Now you can modify your weapon texture (if that's replacing your weapon, you have to erase sword blade, handle etc. - but save your shield).

Quote:
(and pls tell me how can i make pictures about my creatures)


Press 'Print Screen' button on your keyboard, open Paint or whatever and Paste it
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 16, 2014 09:36 PM

Hayven.i've found this in some of your sucesion wars and other xdb files:
<Item href="#n:inline(Material)" id="item_d4eb1ba1-eb73-4742-9ecb-804c627df40f">
Can you tell me what does it mean and how can i use it for anything?

____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 17, 2014 11:48 AM

That's .(Material) file inside .(Model) file. It works just like usual .(Material) file but doesn't need its own .xdb file. If it's included into .(Model) file, it goes like .(Model) -> .(Texture) and its mirror.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 17, 2014 08:52 PM

You said in my question thread:
"1) To make a part of texture (model) invisible - like if it was unexistant use alpha channel while editing texture. Use eraser or something. In GIMP if you mark a part of texture and press delete, it becomes "empty"."
I tried it but when i tried it has only became white and reappeared theese textures, which were hidden(transparent).
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted July 18, 2014 09:33 AM

Err... did you use .dds plugin that opened your .dds texture? If yes, there should already be alpha channel.

If you were erasing a regular picture (not Direct Draw Surface but JPG or PNG without alpha for example), it's normal there is blanc sheet instead of 'empty' part because you should use "Add Alpha Channel" option first.

The alpha channel will be shown as grey and white grid.

____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
konterr56
konterr56


Hired Hero
posted July 18, 2014 09:08 PM

Hayven said:
Err... did you use .dds plugin that opened your .dds texture? If yes, there should already be alpha channel.

If you were erasing a regular picture (not Direct Draw Surface but JPG or PNG without alpha for example), it's normal there is blanc sheet instead of 'empty' part because you should use "Add Alpha Channel" option first.

The alpha channel will be shown as grey and white grid.


Ok thanks i found it. i know now how to erase parts.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
nhs12008
nhs12008

Tavern Dweller
posted April 20, 2015 05:20 AM
Edited by nhs12008 at 00:46, 21 Apr 2015.

Hi there, thanks for the information! I've decided to make my own creature's model after seeing this thread!
Would I know if there's a way to increase creature's size?

http://heroescommunity.com/viewthread.php3?TID=31364&PID=797421#focus

In that thread TSoD said
'you manage to have transparent main model, then apply a ModelInstance effect type with wolf texture, model & animation that you scale with a factor> 1... '

Thus I made 1.(Effect).xdb and 1.(ModelInstance).xdb to check whether I correctly understood his saying.
Here's my files, intended to increase Pit spawn' size when moving.


<?xml version="1.0" encoding="UTF-8"?>
<Effect>
<Instances/>
<Lights/>
<Models>
<Item href="12.(ModelInstance)"/>
</Models>
<WindAffected>false</WindAffected>
<WindPower>1</WindPower>
<Duration>2.5</Duration>
</Effect>


<?xml version="1.0" encoding="UTF-8"?>
<ModelInstance ObjectRecordID="68">
<Model href="T6_Pit_Spawn.xdb#xpointer(/Model)"/>
<SkelAnim href="T6_Pit_Spawn-arena-move.xdb#xpointer(/BasicSkelAnim)"/>
<Position>
<x>0</x>
<y>0</y>
<z>0</z>
</Position>
<Rotation>
<x>0</x>
<y>0</y>
<z>0</z>
<w>1</w>
</Rotation>
<Scale>3</Scale>
<Offset>0</Offset>
<CycleLength>0</CycleLength>
<CycleCount>0</CycleCount>
<GlueToBone>0</GlueToBone>
</ModelInstance>

I had those in /Charcters/Creatures/Inferno/AlternativeUpgrade and added Effect line to 6_Pit_Spawn-arena-move.xdb, but it didn't work!

I don't know why it didn't work

EDIT: solved, it was 'cause I didn,t typed '.xdb' to effect file ref.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0946 seconds