Armour implenting

Users who are viewing this thread

tegalad

Banned
I would appreciate a small set of instructions about how to clone an armour so both it and the original are in the game, and then retexture the clone.
I have BRFedit and Paint.net, so software shouldn't be a problem.
 
Open the BRF, press clone on the item you want. Copy the texture to that item, edit the copy. And assign the copy to the cloned armor.
Of course, this is assuming you know some basics.
 
create a new .dds texture, and put it into the texture folder. give it a unique name. it doesn't matter what.

open up Commonres\textures.brf,
go to the Tex tab,
and click "add"

select the newly added texture, and in the "name" field, type the name of your new texture, then click Enter on the keyboard.
save the file (backup the old textures.brf first though)

open up Commonres\materials.brf
go to the Mat tab,
and click add.
in the Name field, type in the name of the material, then click Enter.
in the diffuse tab, type in the name of the texture without the .dds extension, and click enter.
in the Shader tab, select the shader that the previous material uses.
remember to press enter each time after changing the values, or they will reset.
to the left of where it says "Set" you'll see a number. this is a flag value, which sets various parameters. i find its better to type in this value as it is in the other material you're copying, and then pressing enter, rather than using the checkboxes.
after that, save the materials.brf(and backup)

now open up whatever it is the file the model you want to retexture is in,
and click "clone".
give it a new name, and in the Material textbox, type in the name of your new material, and then click Enter.

thats how far you'll get without the module system with this tutorial.
i'm not sure how to edit things with the text files,

but with the module system, you'd open up the module_items.py,

and search for the armour you want to copy. lets say you want to make a retextured Byrnie.

you'd find this:

["byrnie", "Byrnie", [("byrnie_a",0)], itp_merchandise| itp_type_body_armor  |itp_covers_legs ,0,
1300 , weight(17)|abundance(100)|head_armor(0)|body_armor(39)|leg_armor(6)|difficulty(7) ,imodbits_armor ],

you copy and paste this text after any of the ], which basically means the end of an entry,

and where it says [("byrnie_a",0)] you swap that out with [("yourarmournamehere",0)]
the itp_merchandise property will ensure that your armour will eventually pop up in a shop, but if you want your player character to always start with this armour,
you'll need to modify module_troops.py

find the line where it says:
["player","Player","Player",tf_hero|tf_unmoveable_in_party_window,no_scene,reserved,fac_player_faction,[],
str_3|agi_3|int_3|cha_3,wp(150),0,0x000000018000000136db6db6db6db6db00000000001db6db0000000000000000],

this is the entry for the player. right after fac_player_faction, you have [] insert itm_yourarmournamehere or whatever your armour is called.
the itm_  prefix means that you're referencing something in module_items.

now open up module_info.py,
and change  the export_dir to reference native, somewhat like this:

export_dir = "C:/games/mountandblade/Modules/native/"
change the slashes to /, since the windows standard \ causes errors when compiling.

now, run build_module.bat twice, as the first time around, everything hasn't been referenced properly yet, and you'll get loads of error messages.

you can get the module system here:
http://www.taleworlds.com/download/mb_module_system_1010_0.zip
 
dejawolf said:
create a new .dds texture, and put it into the texture folder. give it a unique name. it doesn't matter what.

open up Commonres\textures.brf,
go to the Tex tab,
and click "add"

select the newly added texture, and in the "name" field, type the name of your new texture, then click Enter on the keyboard.
save the file (backup the old textures.brf first though)

open up Commonres\materials.brf
go to the Mat tab,
and click add.
in the Name field, type in the name of the material, then click Enter.
in the diffuse tab, type in the name of the texture without the .dds extension, and click enter.
in the Shader tab, select the shader that the previous material uses.
remember to press enter each time after changing the values, or they will reset.
to the left of where it says "Set" you'll see a number. this is a flag value, which sets various parameters. i find its better to type in this value as it is in the other material you're copying, and then pressing enter, rather than using the checkboxes.
after that, save the materials.brf(and backup)

now open up whatever it is the file the model you want to retexture is in,
and click "clone".
give it a new name, and in the Material textbox, type in the name of your new material, and then click Enter.

I have a problem, I did everything you said, but once done, the new mesh is black instead of the texture that was supposed to be there.
Also, is it normal that during my work on these, every time I edit something, the error-specific sound keeps beeping, even though nothing seems wrong but the above?
Oh, and I'm not doing this in the game folder, but rather in a module folder, so some file names are different. It is possible I screwed up sth because of that.
 
Sheriff-murder said:
The error sound is just confirmation that a change has been made.

Oh, okay. That's good to know.

Sheriff-murder said:
Is the model textured in BRFedit?

I don't know what you mean by that; I opened the .brf where the armour was supposed to be, and there was the texture and material too.
So yeah, I guess so?
 
the black texture is normal. it just means that its textured, but the texture hasn't updated in the viewport. however, if its white, you have a problem.
save the file, and reopen it in BRF edit, and it should show up properly.
also, keep in mind that selecting a field in the material editor could cause it to be "erased".
it isn't, don't type, just select another mesh, and then reselect the mesh you had previously selected, and the text should be back, and you can edit it normally.
 
I got it to work.
But now another thing: the base armour hardly ever shows up in shops, and so does the new armour, I guess (haven't actually seen either in-game)
So how do I increase the rate at which it shows up?
 
You need to edit the "abundance" flag.

Code:
["court_dress", "Court Dress", [("court_dress",0)], itp_type_body_armor|itp_covers_legs|itp_civilian   ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(4)|difficulty(0) ,imodbits_cloth ],

weight(4)|abundance(100)|head_armor(0)|

The 100 is default, change it to something like 350 and it'll show up a lot.
 
But where is this code? I can't find it.
Btw:
clonetroopercaptainscre.png
 
Code:
module_items.py
["clone_trooper_test", "Clonetrooper Test Armor", [("CloneTrooperTest",0)], itp_type_body_armor|itp_covers_legs   ,0, 348 , weight(1)|abundance(500)|head_armor(0)|body_armor(1)|leg_armor(1)|difficulty(0) ,imodbits_cloth ],

Put that piece o' code to the very bottom JUST before the "]".
 
Nevermind, I simply opened item_kinds1 as a text file and took a guess at which value is the abundance. I guessed correctly, armour has been seen in-game, thank you for your help.
I got wild and set the abundance to 1000, and now I keep seeing the thing all over the place :mrgreen: <= [idiot n00b beacon]
 
Back
Top Bottom