Author Topic: Napoleonic Wars basic modding Tutorial.  (Read 91848 times)

0 Members and 1 Guest are viewing this topic.

Offline usnavy30

  • Colonel
  • *
  • Posts: 1983
  • Former Freelance Modder
    • View Profile
  • Side: Neutral
Re: Napoleonic Wars basic modding Tutorial.
« Reply #75 on: June 03, 2015, 08:05:15 am »
I don't want to sound dumb here, but I just want to replace the British musket with a pike (don't ask why). Is their any way that I could replace the musket with a melee weapon?
In what way would you desire this replacement? A mini-modification or a separate modification?

As a mini-modification you could only replace the musket texture or you would break NW server compatibility.

As a separate modification you could replace the musket with the pike weapon by using the module system. Under module_troops with finding the troop's individual code. Then, replacing the itm_british_brown_bess line in the troop's inventory for your example, with itm_pike instead in it's place.
And lastly if you wanted the pike to replace all British muskets, you only need to edit each troop's individual code in module_troops. Every troop's inventory can be customized after all.
« Last Edit: June 03, 2015, 08:07:34 am by usnavy30 »
How To Run A Mod Installer.exe
Quote
Hello.. I have a problem... It says I don't have Mount&Blade Warband: Napoleonic War and I have to buy it
Try joining a regular Napoleonic Wars server and then re-running the installer.

Offline Uthrid

  • Corporal
  • *
  • Posts: 145
    • View Profile
  • Nick: KR_Nr1_Kpl_Uthrid
  • Side: Union
Re: Napoleonic Wars basic modding Tutorial.
« Reply #76 on: June 03, 2015, 02:10:28 pm »
I don't want to sound dumb here, but I just want to replace the British musket with a pike (don't ask why). Is their any way that I could replace the musket with a melee weapon?
Have you tired just removing the musket from the troop in module_troops and instead put the pike?

Offline Kaasovic

  • Donator
  • *
  • Posts: 8718
  • * and Obelix
    • View Profile
  • Nick: Anonymous
  • Side: Confederacy
Re: Napoleonic Wars basic modding Tutorial.
« Reply #77 on: June 03, 2015, 02:24:19 pm »
Ignore
« Last Edit: June 03, 2015, 02:27:07 pm by Kaasovic »
Developer of NordInvasion. Hi mum.

Offline Uthrid

  • Corporal
  • *
  • Posts: 145
    • View Profile
  • Nick: KR_Nr1_Kpl_Uthrid
  • Side: Union
Re: Napoleonic Wars basic modding Tutorial.
« Reply #78 on: June 04, 2015, 03:29:47 pm »
Does anyone know to to make a unit dev only? I've seen this done before on N&S.

Offline The Mighty McLovin

  • Deserves a better title than this
  • Donator
  • **
  • Posts: 4700
    • View Profile
  • Side: Confederacy
Re: Napoleonic Wars basic modding Tutorial.
« Reply #79 on: June 07, 2015, 12:11:30 am »
I don't want to sound dumb here, but I just want to replace the British musket with a pike (don't ask why). Is their any way that I could replace the musket with a melee weapon?

You can do this with Morgh's editor. If you go to the British musket then you can change the flag from "type crossbow" to "type polearm" if you want it to act it like a polearm. If you want to act as a 1h or 2h change it to "type 1h weapon" and "type 2h weapon".

I think that'll work, can you please give feedback?

Offline Willhelm

  • Donator
  • *
  • Posts: 1850
    • View Profile
    • Blood&Iron
  • Nick: 32nd_Gdm_William
  • Side: Union
Re: Napoleonic Wars basic modding Tutorial.
« Reply #80 on: June 12, 2015, 05:41:12 pm »
Does anyone know to to make a unit dev only? I've seen this done before on N&S.

You have to make two versions of the troop text, one with the special unit on that team, one without. The non devs obviously get the one without. The troop text has to be exactly the same in all other respects so you dont get kicked for cheating.


Offline The Mighty McLovin

  • Deserves a better title than this
  • Donator
  • **
  • Posts: 4700
    • View Profile
  • Side: Confederacy
Re: Napoleonic Wars basic modding Tutorial.
« Reply #81 on: July 18, 2015, 09:47:12 pm »
Does anyone know to to make a unit dev only? I've seen this done before on N&S.

You have to make two versions of the troop text, one with the special unit on that team, one without. The non devs obviously get the one without. The troop text has to be exactly the same in all other respects so you dont get kicked for cheating.

That's interesting. So what would you call the second troop.txt?


Offline Willhelm

  • Donator
  • *
  • Posts: 1850
    • View Profile
    • Blood&Iron
  • Nick: 32nd_Gdm_William
  • Side: Union
Re: Napoleonic Wars basic modding Tutorial.
« Reply #82 on: September 13, 2015, 12:30:15 am »
It would have the exact same name and replace the original, which you would have a back up of.

Offline Dazzer

  • Donator
  • *
  • Posts: 5690
    • View Profile
  • Side: Union
Re: Napoleonic Wars basic modding Tutorial.
« Reply #83 on: September 13, 2015, 12:37:33 am »
nvm
« Last Edit: September 13, 2015, 09:10:34 am by ProDazzer_ »

Offline NickyJ

  • Major General
  • **
  • Posts: 3560
  • The Twilight Zone
    • View Profile
  • Nick: LIR_Lieut_NickyJ
  • Side: Confederacy
Re: Napoleonic Wars basic modding Tutorial.
« Reply #84 on: October 14, 2015, 11:04:39 pm »
I don't want to sound dumb here, but I just want to replace the British musket with a pike (don't ask why). Is their any way that I could replace the musket with a melee weapon?
In a sort of similar way, I'm trying to make a edit to the Russian jaegers and French voltigeurs. Currently, both can choose between cavalry muskets and their usual weapons. I want to change it so that the jaegers can spawn infantry muskets instead of cav muskets and that voltigeurs can spawn rifles instead as well, and people be able to use it without downloading a new module. I edited the modules_troops file to do this, and when I tried it on my server, the voltigeurs' weapon slot was empty, and the jagers spawned a rifle instead. I've been told that there's more code that needs to be added besides simply changing the items, but I'm not sure where or what that code should be. Could someone point me in the right direction?

This is the edited code that I have currently, with my changes in red:

Spoiler
Voltigeurs:
Quote
  ["french_voltigeur","15eme Regiment d'Infanterie Legere","Light Infantry",tf_guarantee_all,0,0,fac_france,
   [itm_french_voltigeur_body_ranker,itm_french_voltigeur_officer_pants,itm_french_voltigeur_pants,itm_french_voltigeur_shako_ranker,itm_bullets,itm_french_charleville,itm_russian_rifle_1805,itm_french_briquet],
   def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],

Jaegers:
Quote
  ["russian_infantry_rifle","21-y Yegerskiy Polk","Rifleman",tf_guarantee_all,0,0,fac_russia,
   [itm_russian_jaeger_ranker,itm_rus_jaeger_pants,itm_rus_jaeger_shako_ranker,itm_russian_rifle_1805,itm_russian_musket_1808,itm_bullets,itm_russian_jaeger_bayonet_jaeger],
   def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
  ["russian_infantry_rifle_nco","21st Jaeger Regiment","Sergeant",tf_guarantee_all,0,0,fac_russian_ranks,
   [itm_russian_jaeger_nco,itm_rus_jaeger_pants,itm_rus_jaeger_shako_nco,itm_russian_rifle_1805,itm_russian_musket_1808,itm_bullets,itm_russian_jaeger_bayonet_jaeger],
   def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
[close]
« Last Edit: October 14, 2015, 11:17:58 pm by NickyJ »

Offline Gokiller

  • Almost Pride of Ni
  • Major General
  • **
  • Posts: 3913
  • Bydand in the chat lads!
    • View Profile
  • Side: Neutral
Re: Napoleonic Wars basic modding Tutorial.
« Reply #85 on: October 14, 2015, 11:15:24 pm »
Could be just me, but I can't see any red coloured text.

Offline NickyJ

  • Major General
  • **
  • Posts: 3560
  • The Twilight Zone
    • View Profile
  • Nick: LIR_Lieut_NickyJ
  • Side: Confederacy
Re: Napoleonic Wars basic modding Tutorial.
« Reply #86 on: October 14, 2015, 11:16:57 pm »
Oops, sorry about that. Will fix it.

Offline JohannBrahms

  • Sergeant
  • *
  • Posts: 79
  • benis
    • View Profile
  • Nick: JohannBrahms
  • Side: Neutral
Re: Napoleonic Wars basic modding Tutorial.
« Reply #87 on: October 16, 2015, 08:50:33 pm »
I followed the guide and this ain't working  :'(

-Installed Python in default directory
-Checked twice to make sure environment variables has ;C:\Python27
-Extracted "mb_warband_napoleonic_wars_source_1104" to desktop giving me a "Napoleonic Wars Source Code" folder
-Have Notepad++
-Followed the next step in the guide: set export dir in module_info.py (in the \mm dev- MS\ directory) to export_dir = "C:/Program Files (x86)/Steam/steamapps/common/MountBlade Warband/Modules/mymod/"  I made sure I had forward slashes
-I do have a folder in modules called "mymod" (currently it contains text files like actions, factions, map_icons, etc. and an uninstall app- that's basically it, all from a past attempt to make a test mod)
-build module worked when I initially ran it, just ran it again, "initializing, copiling all global variables, exporting strings, exporting a bunch of other stuff, that's what's supposed to happen. This tells me Pything is correctly installed and directed, according to the guide...
-Followed the guide, edited module_troops.py, familiarized myself with what does what
-Edited the code, pasting
 ["test_infantry","Test ","Test Infantry",tf_guarantee_all,0,0,fac_austria,
   [itm_austrian_infantry,itm_aus_infantry_ranker,itm_austrian_infantry_pants,itm_bullets,itm_austrian_musket],
   def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
With the correct alignment (indentation) and made sure it was before the hussars and after the riflemen
-Saved, now building the mod. Buildmod says  Initializing; Compiling all global variables; Exporting string; Exporting skills; etc.
Script processing has ended
Go to MountBlade Warband/Modules/mymod in the steam directory, and "mymod" STILL only has a bunch of text files. It's not a module I can launch!

Where's muh mod?!

Offline usnavy30

  • Colonel
  • *
  • Posts: 1983
  • Former Freelance Modder
    • View Profile
  • Side: Neutral
Re: Napoleonic Wars basic modding Tutorial.
« Reply #88 on: October 16, 2015, 10:37:52 pm »
You should copy Napoleonic Wars folder and rename that copy to mymod, the reason you do not see it in Module selection is because it is missing the critical component, the module.ini file. So text files do not make the mod workable itself.
How To Run A Mod Installer.exe
Quote
Hello.. I have a problem... It says I don't have Mount&Blade Warband: Napoleonic War and I have to buy it
Try joining a regular Napoleonic Wars server and then re-running the installer.

Offline JohannBrahms

  • Sergeant
  • *
  • Posts: 79
  • benis
    • View Profile
  • Nick: JohannBrahms
  • Side: Neutral
Re: Napoleonic Wars basic modding Tutorial.
« Reply #89 on: October 17, 2015, 12:42:27 am »
You should copy Napoleonic Wars folder and rename that copy to mymod, the reason you do not see it in Module selection is because it is missing the critical component, the module.ini file. So text files do not make the mod workable itself.
I'll try that, thanks.