How to add osp items into your multiplayer mod.

正在查看此主题的用户

Hippocrates

Banned
How to add osp items into your multiplayer mod





Introduction



Adding OSP items into your multiplayer mod is very easy. It requires almost no coding skill and consists of allot of copy and pasting. This is why it baffles me when people say they do not know how to add items. Too understand how to add items into the game we must first learn what a OSP is.​





An OSP is a "Open Source Project" they are models and textures that have been made by community members for the community. They are free to use, all they ask is that you give credit.​



The Tutorial





Before we begin you must have the module system installed. If you have not yet done this is suggest you follow one of these tutorials.


http://forums.taleworlds.com/index.php/topic,56798.0.html
http://forums.taleworlds.com/index.php/topic,111706.0.html
http://forums.taleworlds.com/index.php/topic,5408.0.html

By following these tutorial you should be able to install the Module System, ask me if you need help.​



Step 1



Now that you have succesfully installed the module download this.


http://www.mbrepository.com/file.php?id=2634[/url


I suggest you make folder called models and extract the files to that folder.​


Step 2



Now we need to transfer the textures and the open brf file to your game module. Find the location of your Mount and Blade Warband files. For me they are here.

C:\Program Files (x86)\Steam\steamapps\common\mountblade warband

Now that you are there. Copy the open brf file called Rus_armour_pack and paste it to CommonRes. Then copy all of your textures from your models folder and paste them in the folder called textures. Now open up the location where your mod files are stored. I do not mean the module system i mean the place you get to by going from.


mountblade warband > modules > whatever your mod name is


Now copy and paste the Rus_armour_pack into the resource folder of your mods location. Then copy the texture files into the textures folder.





Step 3

Now open up the module.ini file in your module location. It should have a gear on its avatar. At the very bottom of the text file add this.


load_mod_resource = Rus_armour_pack  = barrier_primitives





Step 4


You now need to download Open BRF.

Here is the download, if you have to their is a tutorial with the link.
  http://forums.taleworlds.com/index.php?topic=72279.0

Install it into your models folder.


Step 5



We are now ready to open up Rus_armour_pack. Find the Open Brf.exe file and double click it. Go to file > open and find the .brf file called Rus_armour_pack.  Now select a file you want to add into the game. Do not worry if the models are black. It is just a glitch they will show textures in game.​


Step 6


To hurry this tutorial up i am going to tell you the next 3 steps in one step. Go to your module_systems folder. Open up module_items.py. I am adding Armour so i am going to search Armor in  search. Just a reference i am using notepad ++.

The site for Notepad ++
http://notepad-plus-plus.org/

Depending on what type of armor it is changes where you place your code. I am adding body Armor. So i will place it under body wear.
Copy this ,


["royalist_clothing_10", "Royalist Musketman clothing 10", [("shirt_c",0)], itp_type_body_armor  |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth],

Paste it at the bottom of that section of code.


Change royalist_clothing to whatever you want to call it. DO NOT USE CAPITALS.. Change the name of the item, for me it is Royalist Musketman clothing 10.  Now go back to open brf and open up our osp. Select some body armor and copy the name of the file, now this is not of the texture or the mesh but the name of the actual model. If you have any complications just ask me. Copy the name of the model and paste it where shirt_c is located. You are done with Module Items.


Now Open up module troops.py. For the sake of simplicity lets add this too swadian crossbowman. Search this in search


Multiplayer troops

Swadian Crossbowman is right below.



you should see some code like this

["swadian_crossbowman_multiplayer","Royalist Musketman","Royalist Musketman",tf_guarantee_all,0,0,fac_kingdom_1,
  [itm_royalist_clothing_1,itm_royalist_clothing_2,itm_royalist_clothing_3,itm_royalist_clothing_4,itm_royalist_clothing_5,itm_royalist_clothing_6,itm_royalist_clothing_7,itm_royalist_clothing_8,itm_royalist_clothing_9,itm_royalist_clothing_10,itm_royalist_boot_1,itm_royalist_boot_2,itm_royalist_boot_3,itm_royalist_boot_4,itm_royalist_boot_5,itm_royalist_boot_6],
  def_attrib_multiplayer|level(19),wpe(90,60,180,90),knows_common|knows_ironflesh_2|knows_athletics_5|knows_shield_5|knows_power_strike_2|knows_riding_1,swadian_face_young_1, swadian_face_old_2],
 

To the end of this

[itm_royalist_clothing_1,itm_royalist_clothing_2,itm_royalist_clothing_3,itm_royalist_clothing_4,itm_royalist_clothing_5,itm_royalist_clothing_6,itm_royalist_clothing_7,itm_royalist_clothing_8,itm_royalist_clothing_9,itm_royalist_clothing_10,itm_royalist_boot_1,itm_royalist_boot_2,itm_royalist_boot_3,itm_royalist_boot_4,itm_royalist_boot_5,itm_royalist_boot_6],
 

Add royalist_clothing_10 or whatever you changed it to make sure that their is a comma before it.




Now we are almost finished open Module_scripts.py. Search for armors. Copy the last line of code in the armors section and paste it at the bottom of the section.


configure it so that it looks like this (Remember royalist_clothing is what i called it you may have named it something different.
(item_set_slot, "itm_royalist_clothing_10", slot_item_multiplayer_item_class, multi_item_class_type_light_armor),


Ok now search for Swadian Crossbowman. Copy

(call_script, "script_multiplayer_set_item_available_for_troop", "itm_royalist_clothing_10", "trp_swadian_crossbowman_multiplayer"),

Paste it to the bottom of that section.

Finished


You are finished be sure to run the module to sync the files. You usually have to run it twice if something went wrong the second time.


What to do if something goes wrong
Re run the program
Double check your code
Double check the tutorial
Ask on the forums
Pm me personally


Thank you all


tumblr_m7mbrcqvD61qc0231.gif
 
后退
顶部 底部