Author Topic: Adding a new faction  (Read 8371 times)

0 Members and 1 Guest are viewing this topic.

PuuKKo

  • Sergeant
  • *
    • View Profile
Adding a new faction
« on: November 14, 2007, 04:14:25 PM »
I am adding a totally new faction from a scratch and I need help.
I have read many different posts about this and I tried to do everything I read about, but when I started the game I just got a list of errors.
So, my goals are:
-Getting the 6th faction done in abstract level (diplomacy etc.)
-Assigning the towns and villages to the faction
-Making the heroes and their parties

I am asking for a step by step guide to this issue.

Thanks in advance.

Galead

  • Recruit
  • *
  • Even though my avi's gone, BEWARE THE NAZIGUL
    • View Profile
Re: Adding a new faction
« Reply #1 on: November 14, 2007, 06:07:16 PM »
Well, the first step is to define your faction's ID, name and flags in module_factions.py - just copy kingdom_1 (Swadia) and change the ID to kingdom_6, and the name to whatever you want to name the faction.  Don't worry about the relations yet, they'll be dealt with later - just make sure you have the standard anti-deserters, anti-outlaws etc.

From there... I can't be bothered to go on.  I'll make another post later - just try that out and see if you get any errors.

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: Adding a new faction
« Reply #2 on: November 14, 2007, 06:37:03 PM »
You also need to copy culture 1 and make it culture 6 in module factions.

Add your faction leader under trp_kingdom_5_lord and add your "generals" under faction 5's.

Then when you have that done look for this in scripts game start:
Code: [Select]
(faction_set_slot, "fac_culture_1",  slot_faction_tier_1_troop, "trp_peasant_bowman1"),
(faction_set_slot, "fac_culture_1",  slot_faction_tier_2_troop, "trp_jacen_man_at_arms"),
(faction_set_slot, "fac_culture_1",  slot_faction_tier_3_troop, "trp_mounted_yeoman"),
(faction_set_slot, "fac_culture_1",  slot_faction_tier_4_troop, "trp_ke"),
(faction_set_slot, "fac_culture_1",  slot_faction_tier_5_troop, "trp_kotr"),

Ignore what my troops are in native it is the swadian troops.  You will need to change fac_culture_1 to 6.  You will also need to change the troops to your troops.

Code: [Select]
(faction_set_slot, "fac_kingdom_1",  slot_faction_culture, "fac_culture_1"),
(faction_set_slot, "fac_kingdom_1",  slot_faction_leader, "trp_kingdom_1_lord"),
I think you get what to do with this.

Here's diplomacy:
Code: [Select]
(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_4"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_5"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_2", "fac_kingdom_3"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_2", "fac_kingdom_4"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_2", "fac_kingdom_5"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_3", "fac_kingdom_4"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_3", "fac_kingdom_5"),
      (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_4", "fac_kingdom_5"),

Code: [Select]
(faction_get_slot, ":troop", ":culture",  slot_faction_tier_5_troop),
(faction_set_slot, ":faction_no",  slot_faction_tier_5_troop, ":troop"),
Copy that and change it to faction 6 stuff.

Code: [Select]
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_edmond_man_at_arms"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_edmond_man_at_arms"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_rhodok_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_edmond_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_lyonesse_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"),
Copy and change that to faction 6 stuff.

Code: [Select]
(call_script, "script_give_center_to_lord", "p_town_1",  "trp_kingdom_1_lord"),
      (call_script, "script_give_center_to_lord", "p_town_2",  "trp_knight_3_1"),
      (call_script, "script_give_center_to_lord", "p_town_3",  "trp_kingdom_4_lord"),
      (call_script, "script_give_center_to_lord", "p_town_4",  "trp_knight_1_3"),
      (call_script, "script_give_center_to_lord", "p_town_5",  "trp_knight_1_4"),
      (call_script, "script_give_center_to_lord", "p_town_6",  "trp_knight_1_1"),
      (call_script, "script_give_center_to_lord", "p_town_7",  "trp_knight_1_2"),
     
      (call_script, "script_give_center_to_lord", "p_town_8",  "trp_kingdom_5_lord"),
      (call_script, "script_give_center_to_lord", "p_town_9",  "trp_knight_5_3"),
      (call_script, "script_give_center_to_lord", "p_town_10", "trp_kingdom_2_lord"),
      (call_script, "script_give_center_to_lord", "p_town_11", "trp_knight_5_4"),
      (call_script, "script_give_center_to_lord", "p_town_12", "trp_knight_5_1"),
      (call_script, "script_give_center_to_lord", "p_town_13", "trp_knight_5_2"),
      (call_script, "script_give_center_to_lord", "p_town_14", "trp_kingdom_3_lord"),



      (call_script, "script_give_center_to_faction_aux", "p_castle_1", "fac_kingdom_1"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_2", "fac_kingdom_5"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_3", "fac_kingdom_5"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_4", "fac_kingdom_1"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_5", "fac_kingdom_1"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_6", "fac_kingdom_1"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_7", "fac_kingdom_2"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_8", "fac_kingdom_5"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_9", "fac_kingdom_1"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_10", "fac_kingdom_1"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_11", "fac_kingdom_1"),
And that is town and castle owners.
« Last Edit: November 14, 2007, 06:53:16 PM by grailknighthero »
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

Dindi

  • Sergeant Knight
  • *
  • Losing is Fun
    • View Profile
  • Faction: Bandit
Re: Adding a new faction
« Reply #3 on: November 14, 2007, 06:43:24 PM »
i posted this a couple days ago in a different topic

Quote
Module factions:

Code:
("kingdom_6",  "My Faction",  0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], colourcode here),
colour code:
blue       = 0xFFAAAAFF
light blue = 0xFFAAD8FF
red        = 0xFFFFAAAA
yellow     = 0xFFFFFFAA
pink       = 0xFFFFAAFF
purple     = 0xFF6AAA89
black      = 0xFFAAAAAA
white      = 0xFFFFFFFF
green      = 0xFFAAFFAA
brown      = 0xFF7A4800

module_scripts: (press crt F and look for diplomacy this stuff is around there)

Code:
(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_6"),

Code:
     (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"),

Code:
(else_try),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_6"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_rhodok_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_rhodok_trained_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_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"),

Code:
(call_script, "script_give_center_to_lord", "p_town_11", "trp_kingdom_6_lord"),(cant remeber what town_11 is look in module_parties)

module_troops

Code:
["kingdom_6_lord",  "King Me",  "Kingdom 6 Lord",  tf_hero, 0,reserved,  fac_kingdom_6,[itm_hunter,itm_ragged_outfit,      itm_leather_boots, itm_mail_chausses, itm_lamellar_cuirass, itm_military_pick, itm_heater_shield, itm_flat_topped_helmet], lord_attrib,wp(220),knows_lord_1, 0x00000000000c52c801fb6da6ab995795],
i hope all that helps

Quote
and this in module_party_templates


Code:
  ("kingdom_6_reinforcements_a", "kingdom_6_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,40,50),(trp_rhodok_tribesman,40,50)]),

Code:
  ("kingdom_6_reinforcements_b", "kingdom_6_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_gunner,20,40),(trp_rhodok_trained_crossbowman,20,60),(trp_rhodok_crossbowman,30,70)]),

Code:
("kingdom_6_reinforcements_c", "kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_canon,20,40),(trp_rhodok_sergeant,30,60),(trp_rhodok_sharpshooter,30,60)]),
change each troop to your news and remember to build module once you have made a new troop before putting it in module_party_templates

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: Adding a new faction
« Reply #4 on: November 14, 2007, 06:55:29 PM »
Ah you posted while I was editing my post lol.  You cover more than I do.

Do what Dindi says.
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

Miclee

  • Sergeant Knight at Arms
  • *
  • Meh.
    • View Profile
  • Faction: Neutral
  • MP nick: Miclee
  • M&BWB
Re: Adding a new faction
« Reply #5 on: November 14, 2007, 08:57:51 PM »
You also have to add all the new knights.
I lieks Minecraft.
My twitter: http://twitter.com/#!/micleee

PuuKKo

  • Sergeant
  • *
    • View Profile
Re: Adding a new faction
« Reply #6 on: November 15, 2007, 04:05:45 PM »
I did everything you said (again), but no luck. No working towns, no spawning parties, just errors. The diplomacy works and the new faction exists, but it doesn't have any towns, and it's heroes won't spawn.



When I tried to enter one of the towns/castles/villages I got the battle start screen and an error:



Dindi

  • Sergeant Knight
  • *
  • Losing is Fun
    • View Profile
  • Faction: Bandit
Re: Adding a new faction
« Reply #7 on: November 15, 2007, 04:22:35 PM »
Are using new towns and villages?? You would have to implement them aswell but im not sure how to that.

PuuKKo

  • Sergeant
  • *
    • View Profile
Re: Adding a new faction
« Reply #8 on: November 15, 2007, 05:54:42 PM »
Yes, I have new towns but they have been added in mapeditor by SpawnOfAchilles, not by me. This means that I can't edit the parties.py, map.py or map_icons.py files.

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: Adding a new faction
« Reply #9 on: November 15, 2007, 05:55:46 PM »
Make sure you do (call_script, "script_give_center_to_lord", "p_town_14", "trp_kingdom_3_lord"), for all new towns and make sure you give some to the new faction.  Did you put the faction leader below kingdom5's faction leader and its generals\knights below kingdom5's?  Did you make their faction kingdom6?  If you have new towns and villages you need to look through all of the script game_start and copy all of the initialization that game_start does for towns.

Edit: You posted while I was typing this up.  You need to make sure he placed the towns and villages and castles in the right spots in parties.py.
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

Zaro

  • italiano stallion-o
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Adding a new faction
« Reply #10 on: November 15, 2007, 06:02:28 PM »
This new faction wouldn't happen to be a greek one for Legions would it ?  :P

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: Adding a new faction
« Reply #11 on: November 15, 2007, 07:03:39 PM »
Yes, I have new towns but they have been added in mapeditor by SpawnOfAchilles, not by me. This means that I can't edit the parties.py, map.py or map_icons.py files.

You mean you cant edit parties.txt and map.txt but you can edit map_icons.py and parties.py.  Either have him edit parties.py or ask him to give you the .py file. 

I have taken a closer look at the errors in your picture.  It is saying you reference an invalid party id.  I believe you are telling the script to give a party\town that isnt there to a hero.
« Last Edit: November 15, 2007, 07:05:59 PM by grailknighthero »
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

Miclee

  • Sergeant Knight at Arms
  • *
  • Meh.
    • View Profile
  • Faction: Neutral
  • MP nick: Miclee
  • M&BWB
Re: Adding a new faction
« Reply #12 on: November 15, 2007, 10:12:05 PM »
For adding new towns, you would need to give them scenes still and everything.

Also, the invaild party id thing is probably for you forgetting to change the faction of the hero parties to kingdom_6.
I lieks Minecraft.
My twitter: http://twitter.com/#!/micleee

PuuKKo

  • Sergeant
  • *
    • View Profile
Re: Adding a new faction
« Reply #13 on: November 16, 2007, 08:08:02 PM »
OK, I got it working by modifying the parties.py. Now the Greeks work well but there are still some problems:

-I still get some errors at the beginning:


-The shopkeepers have wrong inventories (armorer has the weapons, arms dealer has empty inventory)

-The game crashes when entering villages (missing scenes I think)

-When entering the castles I get the prison guard conversation

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: Adding a new faction
« Reply #14 on: November 16, 2007, 11:24:19 PM »
OK, I got it working by modifying the parties.py. Now the Greeks work well but there are still some problems:

-I still get some errors at the beginning:


-The shopkeepers have wrong inventories (armorer has the weapons, arms dealer has empty inventory)

-The game crashes when entering villages (missing scenes I think)

-When entering the castles I get the prison guard conversation

1.  Make sure you made the merchants in module_troops.py.  If you have, make sure when you initialize the towns and villages there isnt something that sets a merchant to a village or town.

2.  Ya I think it is because you are missing the scene.  You initialize the scene in game_start.

3.  Hmm, maybe you didnt initialize the castles in game start?  I need to look at the game_start script when I get back to my computer.

The errors say that it is still failing to give centers to kingdom heroes and it is failing to create kingdom hero parties.  Did you put the kingdom leader and the kingdom heroes in the right place?
« Last Edit: November 16, 2007, 11:27:04 PM by grailknighthero »
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.