Author Topic: How do you add a new faction?  (Read 2891 times)

0 Members and 1 Guest are viewing this topic.

Offline Sicarius

  • Sergeant Major
  • *
  • Posts: 121
  • Junior modder and cheese lover.
    • View Profile
  • Nick: Cheese
  • Side: Union
How do you add a new faction?
« on: August 10, 2013, 06:34:08 pm »
Hello everyone!
I've got a fairly large question. Is there a way to add a new faction by editing .py files?
I'm currently working on a survival mod (similar to full invasion 2 but on napoleonic wars)

If there is a way to add new factions. Could please someone explain it to me.
It would be very appreciated.

Offline Burakkuada

  • First Lieutenant
  • *
  • Posts: 3109
  • Vince - Unban Tavington.
    • View Profile
  • Nick: 17e_WookieeBurak
  • Side: Confederacy
Re: How do you add a new faction?
« Reply #1 on: August 10, 2013, 09:25:25 pm »
I don't think so, you just have to edit the name etc


Offline Althalus

  • Second Lieutenant
  • *
  • Posts: 881
    • View Profile
  • Nick: Althalus
  • Side: Neutral
Re: How do you add a new faction?
« Reply #2 on: August 10, 2013, 09:26:27 pm »
Technically yes. You simply add them to Module_factions.py

But it gets a little more complex, adding troops etc. The game becomes quite unstable if you add too many more. You should be ok for ~10-15.

Offline Sicarius

  • Sergeant Major
  • *
  • Posts: 121
  • Junior modder and cheese lover.
    • View Profile
  • Nick: Cheese
  • Side: Union
Re: How do you add a new faction?
« Reply #3 on: August 11, 2013, 09:38:20 am »
That is exactly what i did. I also added a couple of infantry units to see it it worked.
But it errors on compiling, So the 6th faction doesn't show up.

Where do I add a new line of code in the module_factions.py?
I added one under the last faction (I believe it was austria or russia) like I said, It errors on compiling.
I haven't forgot the *name*_Other_Ranks though. It kept erroring on compiling.

Any tips guys?
it's really appreciated!

Offline Saxinger

  • Private
  • *
  • Posts: 36
  • Scripter | 3teFK_Rek_Saxinger
    • View Profile
    • Tec-Turorials
  • Nick: Saxinger
  • Side: Neutral
Re: How do you add a new faction?
« Reply #4 on: August 11, 2013, 10:28:33 am »
That is exactly what i did. I also added a couple of infantry units to see it it worked.
But it errors on compiling, So the 6th faction doesn't show up.

Where do I add a new line of code in the module_factions.py?
I added one under the last faction (I believe it was austria or russia) like I said, It errors on compiling.
I haven't forgot the *name*_Other_Ranks though. It kept erroring on compiling.

Any tips guys?
it's really appreciated!

Please post the Error Code and your edited code in the *Script Thread* I think we could help you. You also have to declare all Names in the module_strings. Post the Error code and I think we could help you »°

Offline Sicarius

  • Sergeant Major
  • *
  • Posts: 121
  • Junior modder and cheese lover.
    • View Profile
  • Nick: Cheese
  • Side: Union
Re: How do you add a new faction?
« Reply #5 on: August 11, 2013, 11:08:18 am »
I tried some stuff and I got rid of the errors. I added a couple of lines in script.py and presentations.py

Code
(else_try),
           (eq,":team_1_faction","fac_prolia"),
           (assign,":base_troop_index",9),

Code
# MM
  ("kingdom_1_adjective",                     "United Kingdom"),
  ("kingdom_2_adjective",                     "Empire Francais"),
  ("kingdom_3_adjective",                     "Koenigreich Preussen"),
  ("kingdom_4_adjective",                     "Rossiyskaya Imperiya"),
  ("kingdom_5_adjective",                     "Osterreich"),
  ("kingdom_6_adjective",                     "Kingdom of Prolia"),

Code
#Faction selection
  ("britain_name", "United Kingdom"),
  ("france_name", "French Empire"),
  ("prussia_name", "Kingdom of Prussia"),
  ("russia_name", "Russian Empire"),
  ("austria_name", "Austrian Empire"),
  ("prolia_name", "Prolian Empire"),
Why doesn't The Prolian Empire (Selfmade non existing empire) not show up in the faction selection menu?

Offline Hinkel

  • Colonel
  • *
  • Posts: 1484
  • Confederate Commander in Chief
    • View Profile
  • Nick: Gen_Hinkel
  • Side: Confederacy
Re: How do you add a new faction?
« Reply #6 on: August 11, 2013, 11:13:47 am »
You can't add a 6th faction, the script limit is reached.

You have to work with at least 7 different python files beside the Module_factions.py to change a faction.

Offline Saxinger

  • Private
  • *
  • Posts: 36
  • Scripter | 3teFK_Rek_Saxinger
    • View Profile
    • Tec-Turorials
  • Nick: Saxinger
  • Side: Neutral
Re: How do you add a new faction?
« Reply #7 on: August 11, 2013, 11:15:16 am »
Do you want to add or change a faction? Post the Error Code also please :)
« Last Edit: August 11, 2013, 11:17:26 am by Saxinger »

Offline Sicarius

  • Sergeant Major
  • *
  • Posts: 121
  • Junior modder and cheese lover.
    • View Profile
  • Nick: Cheese
  • Side: Union
Re: How do you add a new faction?
« Reply #8 on: August 11, 2013, 11:21:33 am »
You can't add a 6th faction, the script limit is reached.

You have to work with at least 7 different python files beside the Module_factions.py to change a faction.
Darn, That really sucks. Thanks for your reply Hinkel.

Do you want to add or change a faction? Post the Error Code also please :)
There is no error code, And I was trying to add a 6th faction but as Hinkel just said it's impossible :(

Offline Saxinger

  • Private
  • *
  • Posts: 36
  • Scripter | 3teFK_Rek_Saxinger
    • View Profile
    • Tec-Turorials
  • Nick: Saxinger
  • Side: Neutral
Re: How do you add a new faction?
« Reply #9 on: August 11, 2013, 11:42:48 am »
Of course it is possible to add a 6th, 7th or 8th faction lol... It's all module system.

Offline Sicarius

  • Sergeant Major
  • *
  • Posts: 121
  • Junior modder and cheese lover.
    • View Profile
  • Nick: Cheese
  • Side: Union
Re: How do you add a new faction?
« Reply #10 on: August 11, 2013, 11:48:10 am »
Then how do I do it?

Offline Saxinger

  • Private
  • *
  • Posts: 36
  • Scripter | 3teFK_Rek_Saxinger
    • View Profile
    • Tec-Turorials
  • Nick: Saxinger
  • Side: Neutral
Re: How do you add a new faction?
« Reply #11 on: August 11, 2013, 11:51:11 am »
Like he said you need a lot of different files to add a new faction. Here is a tutorial :

http://forums.taleworlds.com/index.php/topic,116286.0.html

Try it out :)

Offline Sicarius

  • Sergeant Major
  • *
  • Posts: 121
  • Junior modder and cheese lover.
    • View Profile
  • Nick: Cheese
  • Side: Union
Re: How do you add a new faction?
« Reply #12 on: August 11, 2013, 12:13:13 pm »
I've seen that tutorial but the thing is
That tutorial shows how you can add a faction in native! Not in Napoleonic wars. The 2 modules are different and require different files to be edited.

That tutorial is quite useless for napoleonic wars modders like me

Offline Saxinger

  • Private
  • *
  • Posts: 36
  • Scripter | 3teFK_Rek_Saxinger
    • View Profile
    • Tec-Turorials
  • Nick: Saxinger
  • Side: Neutral
Re: How do you add a new faction?
« Reply #13 on: August 11, 2013, 12:49:04 pm »
The system should be the same...

Offline Althalus

  • Second Lieutenant
  • *
  • Posts: 881
    • View Profile
  • Nick: Althalus
  • Side: Neutral
Re: How do you add a new faction?
« Reply #14 on: August 14, 2013, 09:43:53 am »
The system should be the same...

AHAHAHAHAHAHAHAHA no. The NW sourcecode, I suspect, contains a lot of unnecessary complication to discourage modders. It also has many engine changes.

Several of the menus need to be edited manually for this to show up. I can't pinpoint exactly where, I never went looking, but I do know that there is a factions file - a spreadsheet style file - in the NW folder that has the faction names. Might have something to do with it. You would also have to add it into every gamemode in module_mission_templates.