Modding General Questions

正在查看此主题的用户

Nord Champion

Grandmaster Knight
How do you put a new faction?

I know its with, but I have a couple of questions.

1) In red: What is this.
2) Do I just put the new faction (in blue) underneath it.
3) How do I get my faction to hold cities?

("player_faction","Player Faction",0, 0.9, [], []),
  ("player_supporters_faction","Player Faction",0, 0.9, [("player_faction",1.00),("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], []),
  ("kingdom_1",  "Kingdom of Swadia", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDD8844),
  ("kingdom_2",  "Kingdom of Vaegirs",    0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DD33),
  ("kingdom_3",  "Khergit Khanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC99FF),
  ("kingdom_4",  "Kingdom of Nords",    0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDDDD33),
  ("kingdom_5",  "Kingdom of Rhodoks",  0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DDDD),
  ("kingdom_6",  "My Kingdom",  0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [],0xDDDD33),

Thanks!


Answered.



Ok, now some more questions:
Can you add more banner spots? In my mod I'm just adding a faction(some other stuff, but mainly adding that), no need to take out a banner just to add a new one.
How do you set villages to specific towns? Because I only want my town to only have about two villages...
How do you create towns? In Thogrim's Map Editer it says I have it on a "One or more Spawns / Towns are on a invalid path tile" or something like that.
Is there a way to automatically start in a faction?

Thanks!
 
http://forums.taleworlds.com/index.php/topic,42588.0.html

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

http://www.mountandblade.es/foro/viewtopic.php?f=39&t=544

:wink:
 
Off to a good start there, but that's only the first of many lines of code.

Ok, first I'll explain the red. This is the faction's name colour code, written in hexadecimal. This is a wiki link with lots of colour codes for you to use.
http://en.wikipedia.org/wiki/List_of_colors

So now to the factions in module_factions. Right above that bit with the kingdoms where you did blue, there's this which you need to copy and adjust accordingly
("culture_1",  "culture_1", 0, 0.9, [], []),

next, go to module_scripts, where you will see this bit, and you will figure out what to do here. I'm not sure if this bit is used anymore, but I do it anyway.
插入代码块:
 # Cultures:
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_5_troop, "trp_swadian_knight"),

right under that bit of code, you will see this bit, again this is quite obvious what to do here
# Factions:
      (faction_set_slot, "fac_kingdom_1",  slot_faction_culture, "fac_culture_1"),

A little bit under that you will come here
(try_begin),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_1"),
     
          (faction_set_slot, ":faction_no",  slot_faction_deserter_troop, "trp_swadian_deserter"),
          (faction_set_slot, ":faction_no",  slot_faction_guard_troop, "trp_swadian_sergeant"),
          (faction_set_slot, ":faction_no",  slot_faction_messenger_troop, "trp_swadian_messenger"),
          (faction_set_slot, ":faction_no",  slot_faction_prison_guard_troop, "trp_swadian_prison_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_castle_guard_troop, "trp_swadian_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"),
        (else_try),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_2"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_vaegir_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_vaegir_guard"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_vaegir_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_vaegir_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_vaegir_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_2_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_2_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_2_reinforcements_c"),


And that's it for the faction stuff in this file, but while we're still on it we can set the faction to hold a city. So, scroll down 'til you get here
#Correcting banners according to the player banner
      (troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop),
      (assign, ":end_cond", kingdom_heroes_end),
      (try_for_range, ":cur_troop", kingdom_heroes_begin, ":end_cond"),
        (troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
        (assign, ":end_cond", 0),
      (try_end),

      (call_script, "script_give_center_to_lord", "p_town_1",  "trp_kingdom_4_lord", 0),
      (call_script, "script_give_center_to_lord", "p_town_2",  "trp_knight_4_1", 0),
      (call_script, "script_give_center_to_lord", "p_town_3",  "trp_knight_5_1", 0),
      (call_script, "script_give_center_to_lord", "p_town_4",  "trp_knight_1_1", 0),
      (call_script, "script_give_center_to_lord", "p_town_5",  "trp_kingdom_5_lord", 0),
      (call_script, "script_give_center_to_lord", "p_town_6",  "trp_kingdom_1_lord", 0),
      (call_script, "script_give_center_to_lord", "p_town_7",  "trp_knight_1_2", 0),
Just change the trp_whatever to whatever hero you want to hold the city. If you keep scrolling down you will also see the village and castle owner declarations.

Ok, now back to setting up your faction, this time go to module_party_templates.py. You are looking for this
# Reinforcements
#  ("default_reinforcements_a","default_reinforcements_a",0,0,fac_commoners,0,[(trp_caravan_guard,1,10),(trp_watchman,3,16),(trp_farmer,9,24)]),
#  ("default_reinforcements_b","default_reinforcements_b",0,0,fac_commoners,0,[(trp_mercenary,1,7),(trp_caravan_guard,3,10),(trp_watchman,3,15)]),
#  ("default_reinforcements_c","default_reinforcements_c",0,0,fac_commoners,0,[(trp_hired_blade,1,7),(trp_mercenary,3,10),(trp_caravan_guard,3,15)]),

Then you should be done with your new faction, you can now try it out in game! If you're having problems, check over the id's of the troops in all parts of the faction code, and double check your syntax is correct(commas, etc).

If you're still having problems, I can send you my python files with my new factions so you can have a look at how I've done it.

EDIT: somewhat ninja'd.
Well that link posted about setting up factions is old and didn't help me at all.
Also, I forgot to mention, you will need to create faction hero troops, like in the first link Idibil posted.
 
Nord Champion 说:
Is there a way to automatically start in a faction?
Yes, there's a thread on here about it. I haven't done it before so I can't help sorry.

Nord Champion 说:
I can't recruit units from my villages :sad:
You mean your new troops? Hmm... I don't know what to say except look through your code. Most likely you've forgotten to change something you copy/pasted under module_scripts.

Nord Champion 说:
How do you create towns? In Thogrim's Map Editer it says I have it on a "One or more Spawns / Towns are on a invalid path tile" or something like that.
Ok first of all, delete what you added to thorgrim's map editor but write down the co-ordinates of it. You get these from pressing "z" key or something like that.
Now, go to your module's folder and into Sceneobjects folder, and find a town scen you want yours to look like and copy all the associated files eg scn_town_1_prison.sco, scn_town_1_alley.sco, scn_town_1_arena.sco, scn_town_1_castle.sco, etc and rename these to the number of the new town(or other party like a village).

Next up go to module_scenes.py and there you will need to enter all the new scenes you just created so pretty much copy/paste again.

Ok now go to module_parties.py and add something like this underneath the other ones like it:
插入代码块:
  ("town_19","Boktor",  icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-25.6, -84),[], 135),

Now you can move onto module_scripts. Here you will see this:
(party_set_slot,"p_town_1", slot_town_arena_melee_1_num_teams,  2),
      (party_set_slot,"p_town_1", slot_town_arena_melee_1_team_size,  1),
      (party_set_slot,"p_town_1", slot_town_arena_melee_2_num_teams,  4),
      (party_set_slot,"p_town_1", slot_town_arena_melee_2_team_size,  1),
      (party_set_slot,"p_town_1", slot_town_arena_melee_3_num_teams,  4),
      (party_set_slot,"p_town_1", slot_town_arena_melee_3_team_size,  1),
      (call_script, "script_center_change_trade_good_production", "p_town_1", "itm_linen", 110, 0),
Your new town will need one of these as well.

So the town is working now, but you will need some npcs to work there, so go to module_troops and add a new armourer, weaponsmith, town mayor, horse merchant, tournament master, and anyone else the town might need. Exploring the town's dialogue options will tell you if you're missing someone.

Ok now there is a few things I've left out here: custom tournaments and trade routes, both of which are under module_scripts. I have no idea how trade routes are supposed to be set up, and anyway they don't stop the town workng properly so you can figure this out yourself.
As for custom town tournaments, search for this under module_game_menus. What to do is pretty simple
(else_try),
              (party_slot_eq, ":cur_town", slot_center_original_faction, ":town_original_faction"),
              (val_add, ":town_index_within_faction", 1),
            (try_end),
          (try_end),
          (try_begin),
            (eq, ":town_original_faction", "fac_kingdom_1"),
            #Swadia
            (store_mod, ":mod", ":town_index_within_faction", 4),
            (try_begin),
              (eq, ":mod", 0),
              (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
            (else_try),
              (eq, ":mod", 1),
The default tournament for a town is the Rhodok tournament so this step isn't necessary but can be cool.


Cheers
 
Mayhem 说:
Off to a good start there, but that's only the first of many lines of code.

Ok, first I'll explain the red. This is the faction's name colour code, written in hexadecimal. This is a wiki link with lots of colour codes for you to use.
http://en.wikipedia.org/wiki/List_of_colors

So now to the factions in module_factions. Right above that bit with the kingdoms where you did blue, there's this which you need to copy and adjust accordingly
("culture_1",  "culture_1", 0, 0.9, [], []),

next, go to module_scripts, where you will see this bit, and you will figure out what to do here. I'm not sure if this bit is used anymore, but I do it anyway.
插入代码块:
 # Cultures:
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_5_troop, "trp_swadian_knight"),

right under that bit of code, you will see this bit, again this is quite obvious what to do here
# Factions:
      (faction_set_slot, "fac_kingdom_1",  slot_faction_culture, "fac_culture_1"),

A little bit under that you will come here
(try_begin),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_1"),
     
          (faction_set_slot, ":faction_no",  slot_faction_deserter_troop, "trp_swadian_deserter"),
          (faction_set_slot, ":faction_no",  slot_faction_guard_troop, "trp_swadian_sergeant"),
          (faction_set_slot, ":faction_no",  slot_faction_messenger_troop, "trp_swadian_messenger"),
          (faction_set_slot, ":faction_no",  slot_faction_prison_guard_troop, "trp_swadian_prison_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_castle_guard_troop, "trp_swadian_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"),
        (else_try),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_2"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_vaegir_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_vaegir_guard"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_vaegir_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_vaegir_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_vaegir_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_2_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_2_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_2_reinforcements_c"),


And that's it for the faction stuff in this file, but while we're still on it we can set the faction to hold a city. So, scroll down 'til you get here
#Correcting banners according to the player banner
      (troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop),
      (assign, ":end_cond", kingdom_heroes_end),
      (try_for_range, ":cur_troop", kingdom_heroes_begin, ":end_cond"),
        (troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
        (assign, ":end_cond", 0),
      (try_end),

      (call_script, "script_give_center_to_lord", "p_town_1",  "trp_kingdom_4_lord", 0),
      (call_script, "script_give_center_to_lord", "p_town_2",  "trp_knight_4_1", 0),
      (call_script, "script_give_center_to_lord", "p_town_3",  "trp_knight_5_1", 0),
      (call_script, "script_give_center_to_lord", "p_town_4",  "trp_knight_1_1", 0),
      (call_script, "script_give_center_to_lord", "p_town_5",  "trp_kingdom_5_lord", 0),
      (call_script, "script_give_center_to_lord", "p_town_6",  "trp_kingdom_1_lord", 0),
      (call_script, "script_give_center_to_lord", "p_town_7",  "trp_knight_1_2", 0),
Just change the trp_whatever to whatever hero you want to hold the city. If you keep scrolling down you will also see the village and castle owner declarations.

Ok, now back to setting up your faction, this time go to module_party_templates.py. You are looking for this
# Reinforcements
#  ("default_reinforcements_a","default_reinforcements_a",0,0,fac_commoners,0,[(trp_caravan_guard,1,10),(trp_watchman,3,16),(trp_farmer,9,24)]),
#  ("default_reinforcements_b","default_reinforcements_b",0,0,fac_commoners,0,[(trp_mercenary,1,7),(trp_caravan_guard,3,10),(trp_watchman,3,15)]),
#  ("default_reinforcements_c","default_reinforcements_c",0,0,fac_commoners,0,[(trp_hired_blade,1,7),(trp_mercenary,3,10),(trp_caravan_guard,3,15)]),

Then you should be done with your new faction, you can now try it out in game! If you're having problems, check over the id's of the troops in all parts of the faction code, and double check your syntax is correct(commas, etc).

If you're still having problems, I can send you my python files with my new factions so you can have a look at how I've done it.

EDIT: somewhat ninja'd.
Well that link posted about setting up factions is old and didn't help me at all.
Also, I forgot to mention, you will need to create faction hero troops, like in the first link Idibil posted.

I dont undestand this please can you make a video or somethin
 
I'm assuming you thought you could get away with text tweaks, right?

This is a much better explanation than my one, it may prove more useful
Achilles_ 说:
Adding factions

module_factions.py

("kingdom_1",  "Kingdom of Swadia", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDD8844),
  ("kingdom_2",  "Kingdom of Vaegirs",    0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DD33),
  ("kingdom_3",  "Khergit Khanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC99FF),
  ("kingdom_4",  "Kingdom of Nords",    0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDDDD33),
  ("kingdom_5",  "Kingdom of Rhodoks",  0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DDDD),
("kingdom_6",  "whatever you want",  0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.05),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDD0000),

oh yea, dont forget to add the culture tag above the factions....like so

  ("culture_1",  "culture_1", 0, 0.9, [], []),
  ("culture_2",  "culture_2", 0, 0.9, [], []),
  ("culture_3",  "culture_3", 0, 0.9, [], []),
  ("culture_4",  "culture_4", 0, 0.9, [], []),
  ("culture_5",  "culture_5", 0, 0.9, [], []),
("culture_6",  "culture_6", 0, 0.9, [], []),

module_parties.py

("castle_29","Nelag_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(96, 2:cool:,[],280),
  ("castle_30","Asugan_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(90, -62),[],260),
  ("castle_31","Vyincourd_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(46.3, 20),[],260),
  ("castle_32","Knudarr_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(5.5, 5:cool:,[],260),
  ("castle_33","Etrosq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-51.8, 17.5),[],80),
  ("castle_34","Hrus_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-31, 69),[],260),
  ("castle_35","Haringoth_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(7, 4),[],260),
  ("castle_36","Jelbegi_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-47, 59),[],260),
  ("castle_37","Dramug_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(57, 50),[],260),
  ("castle_38","Tulbuk_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(18, -94),[],260),
  ("castle_39","Slezkh_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(89.4, 66.4),[],280),
  ("castle_40","Uhhun_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(50.8, -75),[],260),

 
  add more castles for your new faction here... 
 
("castle_41","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-162.2, 21.3),[],250),
  ("castle_42","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-155.3, 69.5),[],250),
  ("castle_43","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-144.1, 9.0),[],250),
  ("castle_44","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-151.7, -14.2),[],250),
  ("castle_45","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-110.5, 63.5),[],250),
  ("castle_46","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-127.2, 43.4),[],250),
  ("castle_47","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-118.4, -26.7),[],250),
  ("castle_48","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-126.9, -6.6),[],250),
  ("castle_49","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-139.9, 88.0),[],250),
  ("castle_50","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-111.8, 12.6),[],250),


You also need to assign new coordinates for the castles, villages..etc..on the map.  You can use Throgrims map editor...once your loaded up you can place your cursor anywhere on the map and press "z"  that will give you the coordinates....than put the coordinates in the lines example: ("castle_41","noname_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-162.2, 21.3),[],250),  Do the same when adding villages and towns.

module_party_templates.py

              add these lines in red...my mods troops strings are in here they wont work in native.

  ("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_tribesman,3,6)]),
  ("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_crossbowman,2,6),(trp_rhodok_crossbowman,4,7)]),
  ("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,6)]),

("kingdom_6_reinforcements_a", "kingdom_6_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_legion_recruit,3,7),(trp_legion_footman,3,7),(trp_legion_axeman,3,7)]),
  ("kingdom_6_reinforcements_b", "kingdom_6_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_legion_trained_footman,3,7),(trp_legion_berserker,3,7),(trp_legion_veteran,3,7)]),
  ("kingdom_6_reinforcements_c", "kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_legion_cavalry,3,7),(trp_legion_crossbowman,3,7),(trp_legion_stalker,3,7)]),

module_scripts.py

    Find this and add the red.
              (call_script, "script_give_center_to_faction_aux", "p_castle_36", "fac_kingdom_4"),
            (call_script, "script_give_center_to_faction_aux", "p_castle_37", "fac_kingdom_2"),
            (call_script, "script_give_center_to_faction_aux", "p_castle_38", "fac_kingdom_3"),
            (call_script, "script_give_center_to_faction_aux", "p_castle_39", "fac_kingdom_2"),
            (call_script, "script_give_center_to_faction_aux", "p_castle_40", "fac_kingdom_3"),
     
  These guys in red need to be added to assign those castles to your new faction.
    (call_script, "script_give_center_to_faction_aux", "p_castle_41", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_42", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_43", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_44", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_45", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_46", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_47", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_48", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_49", "fac_kingdom_6"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_50", "fac_kingdom_6"),


Also in this file find this and add the red.
      (faction_set_slot, "fac_culture_5", slot_faction_tier_1_troop, "trp_rhodok_tribesman"),
      (faction_set_slot, "fac_culture_5", slot_faction_tier_2_troop, "trp_rhodok_spearman"),
      (faction_set_slot, "fac_culture_5", slot_faction_tier_3_troop, "trp_rhodok_trained_spearman"),
      (faction_set_slot, "fac_culture_5", slot_faction_tier_4_troop, "trp_rhodok_veteran_spearman"),
      (faction_set_slot, "fac_culture_5", slot_faction_tier_5_troop, "trp_rhodok_sergeant"),
     
  (faction_set_slot, "fac_culture_6", slot_faction_tier_1_troop, "trp_legion_recruit"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_2_troop, "trp_legion_footman"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_3_troop, "trp_legion_trained_footman"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_4_troop, "trp_legion_axeman"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_5_troop, "trp_legion_veteran"),


Again these are just my troops for my mod you can use natives or your own.

Right below you find this and again add the red.

      (faction_set_slot, "fac_kingdom_5",  slot_faction_culture, "fac_culture_5"),
      (faction_set_slot, "fac_kingdom_5",  slot_faction_leader, "trp_kingdom_5_lord"),

(faction_set_slot, "fac_kingdom_6",  slot_faction_culture, "fac_culture_6"),
      (faction_set_slot, "fac_kingdom_6",  slot_faction_leader, "trp_kingdom_6_lord"),


And again in this file, find this and add the red.
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_5"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_rhodok_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_rhodok_veteran_spearman"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_rhodok_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_rhodok_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_rhodok_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_5_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_5_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_5_reinforcements_c"),
        (else_try),
        (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_6"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_legion_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_legion_axeman"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_legion_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_legion_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_legion_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),

Also in module_scripts.py add this line in red to assign towns to lords and faction leaders.

(call_script, "script_give_center_to_lord", "p_town_15", "trp_knight_5_2", 0),
      (call_script, "script_give_center_to_lord", "p_town_16", "trp_knight_1_3", 0),
      (call_script, "script_give_center_to_lord", "p_town_17", "trp_knight_3_2", 0),
      (call_script, "script_give_center_to_lord", "p_town_18", "trp_knight_3_3", 0),
    (call_script, "script_give_center_to_lord", "p_town_19", "trp_kingdom_6_lord", 0),

I'm thinking thats it...I could be missing something, but I'm sure its fine.  pm me if you have questions.."hope I don't regret saying that"..

I really can't be bothered explaining it right now since editing a faction is basically the same thing, and I have no bandwidth left to get a video program. Anyway, at the beginning of each python file you will probably find an explanation of the syntax used.
 
后退
顶部 底部