SP Tutorial Module System Complete Guide to Adding Factions

Users who are viewing this thread

If you can understand initialise_aristocracy and make exceptions for the faction, you can assign familial relations manually via slots. Hard to explain because I'm in a Kenyan airport with about 30 seconds of internet left, but it's not that hard.

But yeah, banners are a crime against humanity.
 
Hi, I'm having a problem with the banner stuff. The banners never show up ingame, is that normal? I search everywhere for them ingame and I can't seem to find them. Also, I'm getting a warning saying,

Code:
WARNING: Local variable never used: kingdom_7_banners_begin, at: game_start

What does this mean and how can I get the banners to show up in the game?
 
Gamanek said:
Question: the personality for the various lords/kings/ladies, how is set? How you choose to give a specific lord/king a specific behaviour? For example Martial or Debauched

you have the personalities in module_constants.py
Code:
#lord reputation type, for commentaries
#"Martial" will be twice as common as the other types
lrep_none           = 0 
lrep_martial        = 1 #chivalrous but not terribly empathetic or introspective, - eg Richard Lionheart, your average 14th century French baron
lrep_quarrelsome    = 2 #spiteful, cynical, a bit paranoid, possibly hotheaded - eg Robert Graves' Tiberius, some of Charles VI's uncles
lrep_selfrighteous  = 3 #coldblooded, moralizing, often cruel - eg William the Conqueror, Timur, Octavian, Aurangzeb (although he is arguably upstanding instead, particularly after his accession)
lrep_cunning        = 4 #coldblooded, pragmatic, amoral - eg Louis XI, Guiscard, Akbar Khan, Abd al-Aziz Ibn Saud
lrep_debauched      = 5 #spiteful, amoral, sadistic - eg Caligula, Tuchman's Charles of Navarre
lrep_goodnatured    = 6 #chivalrous, benevolent, perhaps a little too decent to be a good warlord - eg Hussein ibn Ali. Few well-known historical examples maybe. because many lack the drive to rise to faction leadership. Ranjit Singh has aspects
lrep_upstanding     = 7 #moralizing, benevolent, pragmatic, - eg Bernard Cornwell's Alfred, Charlemagne, Salah al-Din, Sher Shah Suri

lrep_roguish        = 8 #used for commons, specifically ex-companions. Tries to live life as a lord to the full
lrep_benefactor     = 9 #used for commons, specifically ex-companions. Tries to improve lot of folks on land
lrep_custodian      = 10 #used for commons, specifically ex-companions. Tries to maximize fief's earning potential

#lreps specific to dependent noblewomen
lrep_conventional    = 21 #Charlotte York in SATC seasons 1-2, probably most medieval aristocrats
lrep_adventurous     = 22 #Tomboyish. However, this basically means that she likes to travel and hunt, and perhaps yearn for wider adventures. However, medieval noblewomen who fight are rare, and those that attempt to live independently of a man are rarer still, and best represented by pre-scripted individuals like companions
lrep_otherworldly    = 23 #Prone to mysticism, romantic. 
lrep_ambitious       = 24 #Lady Macbeth
lrep_moralist        = 25 #Equivalent of upstanding or benefactor -- takes nobless oblige, and her traditional role as repository of morality, very seriously. Based loosely on Christine de Pisa

look for this kind of operation on module_scripts.py. At a game start there is a random distribution of personalities for lords and ladies
Code:
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_conventional),

so you can use the slot slot_lord_reputation_type to set whatever reputation you want a special troop to have
 
Thank you for the awesome tutorial! I was able to get a new faction basically working by using this, however I am using the Floris Dev Suite 2.55 instead of the warband module system and a few things (such as lord ages and families) are not working yet.

The banners, unfortunately, are definitely not working. What are you using to edit the BRF files?
 
If you're using floris I can't really help you without combing the code myself. There might be edits to the banner code or brfs so it mightbbe better to ask the developers themselves how to add a new faction, or try to find the various banner codes and replicate any "patterns" you might see that would suggest per-faction scripts. I wouldn't recommend this if you're not familiar with the module system though.

Use Openbrf to edit BRF files.
 
jacobhinds said:
If you're using floris I can't really help you without combing the code myself. There might be edits to the banner code or brfs so it mightbbe better to ask the developers themselves how to add a new faction, or try to find the various banner codes and replicate any "patterns" you might see that would suggest per-faction scripts. I wouldn't recommend this if you're not familiar with the module system though.

Use Openbrf to edit BRF files.

Yeah I'm definitely missing something...hopefully will figure it out by poking around.

I'm wondering if there is a way to make batch edits to mesh names etc as there will be 20 factions in my mod, and thru Openbrf it seems as though each mesh needs to be renamed individually (which means 80 renamings of meshes and materials per faction x 14 = 1120 times I will need to right click and rename something, just for the banners).

Anyway thanks a lot for responding.

Btw do you have working cannon code in your Sayazn mod? Sea battles?  :grin:
 
Supplysidejesus said:
I'm wondering if there is a way to make batch edits to mesh names etc as there will be 20 factions in my mod, and thru Openbrf it seems as though each mesh needs to be renamed individually (which means 80 renamings of meshes and materials per faction x 14 = 1120 times I will need to right click and rename something, just for the banners).

You can batch edit to an extent, and you can batch edit suffixes of any kind. Selecting multiple entries batch renames all the common characters between them. So if you have some entries called:

mesh_banner_1
mesh_banner_2
mesh_banner_ab
mesh_banner
mesh_banner_23

And you select all of them, pressing F2 (rename shortcut) will allow you to edit the mesh_banner bit.
 
I thought its alot easier :cry: but awesome guide. I really don't understand how people can write so hard scripts like this :eek: I respect everyone who can script
 
jacobhinds said:
You can batch edit to an extent, and you can batch edit suffixes of any kind. Selecting multiple entries batch renames all the common characters between them. So if you have some entries called:

mesh_banner_1
mesh_banner_2
mesh_banner_ab
mesh_banner
mesh_banner_23

And you select all of them, pressing F2 (rename shortcut) will allow you to edit the mesh_banner bit.

Thanks...unfortunately I still have to change each one individually bc the numbers need to be changed. The banner system really is brutal to mod.

This is off topic, but since you know what you're doing I'll ask bc I'm stuck: what indicates the brf file where an ixmesh for an item can be found?

For example: a longbow indicates "ixmesh_carry" in items.py. Is "ixmesh_carry" located in a brf file, and if so, do I simply need to look through each individually to find it?

The reason I would like to know is that I want to pull some resources from OSPs without pulling EVERYTHING from those osps...I want to be able to include items on an individual basis.

Thanks again for all your help, it is greatly appreciated.
 
You can search for meshes using ctrl+f in OpenBrf.

The "ixmesh" refers to alternative meshes in specific situations. Look at this entry:

[("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver",ixmesh_carry)]

The red bit shows the mesh name accompanied by a "0", which means it's the base mesh. The blue bit, "flying missile" is a mesh that gets used for mid-air arrows. The bit in bold is the actual mesh while the other bit, "ixmesh_flying_ammo", tells you what it does. It's the same for the bit in blue.
 
jacobhinds said:
You can search for meshes using ctrl+f in OpenBrf.

The "ixmesh" refers to alternative meshes in specific situations. Look at this entry:

[("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver",ixmesh_carry)]

The red bit shows the mesh name accompanied by a "0", which means it's the base mesh. The blue bit, "flying missile" is a mesh that gets used for mid-air arrows. The bit in bold is the actual mesh while the other bit, "ixmesh_flying_ammo", tells you what it does. It's the same for the bit in blue.

Thank you, that helps me quite a bit.

Btw I really enjoy your artwork!  :grin: I also think that your ancient painting of the Ukranian crisis is very creative and should be on your site.
 
:lol:

Don't want to upset any potential Russian or Russian-allied clients though. One of my paintings is actually on the wall of an unknown school i was driven to in the middle of china. Don't want to upset Xi Jinping, he might need someone to handle his propaganda in the near future.
 
jacobhinds said:
:lol:

Don't want to upset any potential Russian or Russian-allied clients though. One of my paintings is actually on the wall of an unknown school i was driven to in the middle of china. Don't want to upset Xi Jinping, he might need someone to handle his propaganda in the near future.

I hear that ministering propaganda is pretty lucrative work. Short life expectancy maybe.

Another question for you- what is your mapmaker/editor of choice? Have you used Cartographer?
 
I have a question about carving new factions out of the old ones. I'm currently trying to make a new faction out of the northern parts of the Nords and Vaegirs. I've got the lords situated, have a king, and got Wercheg and Rivacheg to switch over. Unfortunately, it's not working for the three castles i'm trying to convert. I've changed the faction to fac_kingdom_7 in the give_faction_center_aux section, but it's not working. The three castles are still part of their old factions.

here's the relevant bit of code. I'm trying to change over castles 3, 8, and 10. This is the only place in module_scripts I could find these castles referenced, so I assume I'm missing something somewhere else.

Code:
(call_script, "script_give_center_to_faction_aux", "p_castle_3", "fac_kingdom_7"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_4", "fac_kingdom_2"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_5", "fac_kingdom_4"),
      (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_3"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_8", "fac_kingdom_7"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_9", "fac_kingdom_5"),
      (call_script, "script_give_center_to_faction_aux", "p_castle_10", "fac_kingdom_7"),

On a semi related note, does anyone know how to change which villages a town has?

Thanks, m19
 
The only thing I can think of is that you need to change the part of the code where centers are assigned to lords rather than just factions, which is located just below. Otherwise settlements aren't assigned anywhere else.

Villages are assigned to castles automatically by a script in script_game_start.
 
Pulled it up this morning and the changes magically worked. Oh well.

Thanks for the village tip, I guess I'll just have to change some locations rather than the assignment code.
 
Back
Top Bottom