A clear all encompassing guide to using module system to add troop trees?

Users who are viewing this thread

Plazek

Master Knight
Firstly is there one? If there is sorry for making this topic.
Secondly someone providing one would gain my unconditional love supposing it does not exist already, in which case you might fool me and say it is yours but in the end I prob will find out and it will be ruined :razz:

Thirdly a few questions:

So I *think* I have corectly modded in a troop tree. The Hycotorian one. First question is did I make it harder on myself as the recruits are not called custom_recruits and f_custom_recruits? I noticed after adding into the troops module file I then had to add to the scripts and I still had some other errors in menu, simple_triggers and triggers module files. While I fixed scripts and menu I could not find mention of trp_custom_recruit or trp_f_cutom_recruit in the trigger files. Will this make any problems? I started a new game and trained some peasants, it seemed to work fine I did not get any crashes like when I edited the troop.txt. However I did nothing more.

So are there custom troop trees that dont need me to change the tags for the custom troops?
+ Will having errors regarding not being able to find the aforementioned custom troops make problems?
+ Do I need to start new games for new troops? My save crashes whenever I try load it now.

4thly:
Is there a way you can just edit the tags in the scripts module file to match those in the troops.txt file so you don't crash? A sort of module/text file combo as it were? Cause then I could use either troops submitted by people in text file format or people who submitted python.

5thly:
When putting in bits of python you may know the Hycotor one provided has clearly set out headings like so:

#Custom Troops  Possibly needs a better name.
  ######### Recruits ############
  ["hycotor_recruit","Hycotor Recruit","Hycotor Recruits",tf_guarantee_armor|tf_guarantee_boots,0,0,fac_commoners,
  [itm_tunic_blueapron,itm_tunic_bluestripe,itm_tunic_bluerust,itm_tunic_blueheraldry,itm_leather_gloves,itm_leather_boots,itm_nomad_boots,itm_leather_cap,itm_sword_medieval_a,itm_sword_medieval_b,itm_sword_medieval_c],
  str_4|agi_4|int_4|cha_4|level(1),wp(40), knows_riding_1,diverse_man_face_1, diverse_man_face_2], 
  ["f_hycotor_recruit","Hycotor Recruit","Hycotor Recruits",tf_female|tf_guarantee_armor|tf_guarantee_boots,0,0,fac_commoners,
  [itm_tunic_blueapron,itm_tunic_bluestripe,itm_tunic_bluerust,itm_tunic_blueheraldry,itm_leather_gloves,itm_leather_boots,itm_nomad_boots,itm_leather_cap,itm_sword_medieval_a,itm_sword_medieval_b,itm_sword_medieval_c],
  str_4|agi_4|int_4|cha_4|level(1),wp(40), knows_riding_1,diverse_woman_face_1,diverse_woman_face_2],

Again it is also very clearly set out for the upgrade paths.
When people have provided one that is not so clearly set out or lacks such heading completely should I Just mimic the examples proved by the Hycotor troop tree?

6th:

An explanation of how to add more custom cultures would be un necessary for me right now but completely brilliant :smile:


Thanks a bunch.

PS Love the mod its really great. I looked at it a few months ago but decided to wait and I am glad I did
PPS most important for me is knowing whether I will get rpoblems with the tigger and simple_trigger missing trp_custom_recruit error when I compiled. I just wanna play :smile:


 
Does it answer my question of the errors compiling causing a problem?

I have looked but saw nothing regarding that...
Cause I think I followed the instructions and it works so far but I don't want problems further down the line.
I will look again anyways but please don't think I have not spent several hours trying to find out already im not that lazy.

edit:

i looked at the guide again and it has nothing to do with the module system...
unless it is in later pages
 
I assume nothing heh.  But figured I'd try to point you in the right direction just in case.  The thread goes on beyond the first post to try to clarify things for others, and should be a good place for questions of that nature as well.
 
You've got several fairly big questions, so I'll answer some as I think of proper answers heh.

For your Third question:

First half, how to make a non "custom_recruit" as your base:

Change the following code in "module_game_menus.py" (around lines 11320 to 1132:cool::
("custom_settlement_culture_option_6",[],"Custom",
[
(faction_set_slot,"fac_player_settlement_faction",slot_faction_culture,"fac_culture_6"),
(faction_set_slot,"fac_player_settlement_faction",slot_faction_tier_1_troop,"trp_custom_recruit"), # replace with your custom troop base recruit
(faction_set_slot,"fac_player_settlement_faction",slot_faction_tier_1_female,"trp_f_custom_recruit"), # replace with your custom troop base recruit
(faction_set_slot,"fac_culture_6",slot_faction_tier_1_troop,"trp_custom_recruit"), # replace with your custom troop base recruit
(faction_set_slot,"fac_culture_6",slot_faction_tier_1_female,"trp_f_custom_recruit"), # replace with your custom troop base recruit
(change_screen_return),
        ]),
The bold parts are what you change to your new troop type for men and women.

The troops will then be used when you pick "Custom Culture" from the "Choose your faction culture" section (in "Manage Faction").

For the second half of your question, if you had deleted/renamed the "custom_recruit" troops from the "module_troops.py" file, theres one other reference in the module system to "custom_recruit" that you would have to change to avoid errors and problems.  In the "module_constants.py" file you'll need to modify the following code (line 389):
bandits_end = "trp_custom_recruit"
from "custom_recruit" to whatever your first entry troop is, so that it knows that the list of bandit troops ends before there.
And yes, you need to start a new game anytime you modify troops.
 
Brilliant :smile:

Hopefully modifying that should solve my problems.
Then I can think about modding more stuff in.

Bear in mind I am still a bit nub at this.
Thanks a lot though.

edit:

recompiled no errors :grin:
 
Back
Top Bottom