two unconnected troop trees

正在查看此主题的用户

Amigo

Knight at Arms
I want to make two separate troop trees, because i am about to make infatry troop tree recuitable in villages as usual, and cavalry troop tree recruitable in castles. I am really bad in python, i can handle only standard editing.
Amigo
 
you meant module_troops.py?

unconnected = starting with different starting unit.
example:
            One faction
          /                \
Infatry peasant      Cavalry peasant recruited in castles
in villages

-"cavalry" peasant is completely new unit
 
its has nothing to do with script? i doubt it will work when i just modify troop tree.
there should be at least added some castle dialog "recruit nobles" or so.  :shock: complete manual is also appreciated  :???:
amigo
 
umm no there right, you will have to script peasants to be recruited from castles, except that the horse peasant will be a different troop and you make a different troop tree for this peasant and remove horsemen from the normal troop tree.
 
horse peasant is supposed to be different troop tree and horsemans will be removed from paesant troop tree.
i thought that it was obvious:
            One faction
          /                \
Infatry peasant      Cavalry peasant recruited in castles
in villages
:smile:

so how to add horse paesants recruitable in castles
 
Im working on same idea, a regular troops recruited in villages as native and noble/veteran/mercenary/mutant troops recluted in castles.
Working on module_dialogs I get it working with a try-troop standing in zendar tavern; this npc gives troops and take money. Now i have to put a "trainer" npc who hire you the units trhough dialogs in hall castles, but now i dont know how to do this, i will try tomorrow...
If anyone knows a easy way it will be wellcome... also a script or dialog to limit this hire units for a bunch each weak...
Cabre
Later i'll add the rusty code im used, I made it using forum tutorials and source code from mburepositary
Sorry bad english, im spanish.
 
Have you tried  modifying the existing "update_volunteer_troops_in_village" script to put out a different recruit and adding the village recruit menu entry to the castle menu?  i.e make an "update_volunteer_troops_in_castle" script.

Here's my ugly script for getting as many types of recruit as you want out of a village.  For my purposes I use 3 different types of recruits spread over 10 slots.

The modified portion of the update_volunteer_troops_in_village script.  Note I'm only showing the modified section not the whole script.

插入代码块:
  #script_update_volunteer_troops_in_village
  # INPUT: none
  # OUTPUT: none
  ("update_volunteer_troops_in_village",
    [
       (store_script_param, ":center_no", 1),
       (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
       (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
       (store_div, ":tier_upgrades", ":player_relation", 16),
       (store_random_in_range, ":random_no", 0, 5),
       (val_add, ":tier_upgrades", ":random_no"),
       (try_begin),
         (ge, ":tier_upgrades", 10),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_10_troop),
       (else_try),
         (eq, ":tier_upgrades", 9),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_9_troop),
       (else_try),
         (eq, ":tier_upgrades", 8),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_8_troop),
       (else_try),
         (eq, ":tier_upgrades", 7),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_7_troop),
       (else_try),
         (eq, ":tier_upgrades", 6),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_6_troop),
       (else_try),
         (eq, ":tier_upgrades", 5),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_5_troop),  
       (else_try),
         (eq, ":tier_upgrades", 4),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_4_troop),
       (else_try),
         (eq, ":tier_upgrades", 3),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_3_troop),
       (else_try),
         (eq, ":tier_upgrades", 2),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_2_troop),
       (else_try),
         (le, ":tier_upgrades", 1),
         (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_recruit_1_troop),
       (try_end),
       
       (assign, ":upper_limit", 5),
       ........

Like I said it's pretty crude.  All it's doing is dividing the player's relation with the village by 16 and adding a random number between 0 and 4 to get a final value between 0 and 10.  The final value then corresponds to a specific recruit.

Obviously you can have as few or as many recruit types as you want.  The relationship factor could be ditched for a straight random number or whatever else you can think of.



module_scripts Cultures section Obviously there's a similar entry for each of the 5 factions.  This section defines the specific troop recruited.  Obviously each slot could be a separate troop rather than repeats.

插入代码块:
(faction_set_slot, "fac_culture_1",  slot_faction_recruit_1_troop, "trp_swadian_subject"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_2_troop, "trp_swadian_subject"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_3_troop, "trp_swadian_townsman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_4_troop, "trp_swadian_subject"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_5_troop, "trp_swadian_townsman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_6_troop, "trp_swadian_squire"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_7_troop, "trp_swadian_townsman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_8_troop, "trp_swadian_squire"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_9_troop, "trp_swadian_townsman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_recruit_10_troop, "trp_swadian_squire"),

You also have define the new slot_faction_recruit_x_troop in the modules_constant Faction Slots section.

插入代码块:
slot_faction_recruit_1_troop      = 25
slot_faction_recruit_2_troop      = 26
slot_faction_recruit_3_troop      = 27 
slot_faction_recruit_4_troop      = 28   
slot_faction_recruit_5_troop      = 29     
slot_faction_recruit_6_troop      = 30
slot_faction_recruit_7_troop      = 31
slot_faction_recruit_8_troop      = 32
slot_faction_recruit_9_troop      = 33
slot_faction_recruit_10_troop     = 34

 
thanks, i will study this lines and see what can i do. I liked your mod with couched damage erased and fasted lance thrust. How do you make it? im doing an own mod and want to include more spearman in armies and more things... if you can show me some tutorials from the forum sure i will have things easier.  In spanish forum there arent so much mod working and im gettin sick of reading and searching for noob tutorials... Of course im checked module tutorials and this thing but a bit help just showing me interesting tutorial for dialogs and quest....
Cabre
 
Amigo 说:
horse peasant is supposed to be different troop tree and horsemans will be removed from paesant troop tree.
i thought that it was obvious:
             One faction
           /                 \
Infatry peasant      Cavalry peasant recruited in castles
in villages
:smile:

so how to add horse paesants recruitable in castles

This is really easy, just set up the two seperate trees in module_troops and then create a new recruit script for casltes and add it to the castle menu.
 
Cabre 说:
thanks, i will study this lines and see what can i do. I liked your mod with couched damage erased and fasted lance thrust. How do you make it? im doing an own mod and want to include more spearman in armies and more things... if you can show me some tutorials from the forum sure i will have things easier.  In spanish forum there arent so much mod working and im gettin sick of reading and searching for noob tutorials... Of course im checked module tutorials and this thing but a bit help just showing me interesting tutorial for dialogs and quest....
Cabre

The spears are simple.  Change the properties in module_items.  itp_type_polearm makes a weapon couchable.  I simply changed them to itp_type_one_handed_wpn for the shorter ones.  For the longer ones I use itp_type_handed_wpn plus itp_two_handed and itp_cant_be_used_on_horseback to make them purely two handed infantry weapons.  If you don't include the itp_two_handed you get a 2h/1h like the native bastard sword.
插入代码块:
["boar_spear",         "Boar Spear", [("boarspear",0)], itp_type_one_handed_wpn|itp_merchandise|itp_spear|itp_primary, itc_spear, 76 , weight(4)|difficulty(0)|spd_rtng(84) | weapon_length(156)|swing_damage(0 , cut) | thrust_damage(18 ,  pierce),imodbits_axe ],
["boar_spear_b",    "Long Boar Spear",   [("boarspear_b",0)], itp_type_two_handed_wpn|itp_merchandise| itp_spear|itp_primary|itp_cant_use_on_horseback|itp_two_handed, itc_spear, 95 , weight(3)|difficulty(0)|spd_rtng(82) | weapon_length(185)|swing_damage(0 , cut) | thrust_damage(21 ,  pierce),imodbits_axe ],

IMHO 2h/1h also makes them hard to balance properly.  Using a 2 hander with 1 hand gives around a 25% speed and damage penalty.

To keep the polearm skill from showing up in the character screen go into module.ini and under the line,
display_wp_firearms = 0
add the line
display_wp_polearms = 0
Thanks to nijis for that one.

The skill still exists you just don't see and can't put points into it.  If you go lancing in the arena you can still improve the skill through use.

 
LCJr 说:
To keep the polearm skill from showing up in the character screen go into module.ini and under the line,
display_wp_firearms = 0
add the line
display_wp_polearms = 0
Thanks to nijis for that one.

Hmmm handy...
 
LCJr 说:
Cabre 说:
thanks, i will study this lines and see what can i do. I liked your mod with couched damage erased and fasted lance thrust. How do you make it? im doing an own mod and want to include more spearman in armies and more things... if you can show me some tutorials from the forum sure i will have things easier.  In spanish forum there arent so much mod working and im gettin sick of reading and searching for noob tutorials... Of course im checked module tutorials and this thing but a bit help just showing me interesting tutorial for dialogs and quest....
Cabre

The spears are simple.  Change the properties in module_items.  itp_type_polearm makes a weapon couchable.  I simply changed them to itp_type_one_handed_wpn for the shorter ones.  For the longer ones I use itp_type_handed_wpn plus itp_two_handed and itp_cant_be_used_on_horseback to make them purely two handed infantry weapons.  If you don't include the itp_two_handed you get a 2h/1h like the native bastard sword.
插入代码块:
["boar_spear",         "Boar Spear", [("boarspear",0)], itp_type_one_handed_wpn|itp_merchandise|itp_spear|itp_primary, itc_spear, 76 , weight(4)|difficulty(0)|spd_rtng(84) | weapon_length(156)|swing_damage(0 , cut) | thrust_damage(18 ,  pierce),imodbits_axe ],
["boar_spear_b",    "Long Boar Spear",   [("boarspear_b",0)], itp_type_two_handed_wpn|itp_merchandise| itp_spear|itp_primary|itp_cant_use_on_horseback|itp_two_handed, itc_spear, 95 , weight(3)|difficulty(0)|spd_rtng(82) | weapon_length(185)|swing_damage(0 , cut) | thrust_damage(21 ,  pierce),imodbits_axe ],

IMHO 2h/1h also makes them hard to balance properly.  Using a 2 hander with 1 hand gives around a 25% speed and damage penalty.

To keep the polearm skill from showing up in the character screen go into module.ini and under the line,
display_wp_firearms = 0
add the line
display_wp_polearms = 0
Thanks to nijis for that one.

The skill still exists you just don't see and can't put points into it.  If you go lancing in the arena you can still improve the skill through use.
The bad side of this is that spears and the like loose the ability to make horses stop and rear upon hit, thus making it a less effective weapon for infantry.
 
It's no real loss.  I've never noticed the addition of rearing having any real impact in battles.  Certainly hasn't helped the Rhodoks any.
The AI gets more out of having a higher attack speed, seems to help them get more hits.  But that's just my opinion.
 
LCJr 说:
It's no real loss.  I've never noticed the addition of rearing having any real impact in battles.  Certainly hasn't helped the Rhodoks any. The AI gets more out of having a higher attack speed, seems to help them get more hits.  But that's just my opinion.
Its a big one to me. Its true that it hasn't helped rhodoks, but thats because they suck beyond help, a spear is not gonna make up for the sucky equipment and ****ty skills.
Just try a footman char, get a poleaxe, thrust a horse when its about to reach you, then slash it to pieces. The AI does it pretty well too, as the pikemen in my mod do.
 
D'Sparil 说:
LCJr 说:
It's no real loss.  I've never noticed the addition of rearing having any real impact in battles.  Certainly hasn't helped the Rhodoks any. The AI gets more out of having a higher attack speed, seems to help them get more hits.  But that's just my opinion.
Its a big one to me. Its true that it hasn't helped rhodoks, but thats because they suck beyond help, a spear is not gonna make up for the sucky equipment and ****ty skills.
Just try a footman char, get a poleaxe, thrust a horse when its about to reach you, then slash it to pieces. The AI does it pretty well too, as the pikemen in my mod do.
Yap Rhodoks in native have lower proficiencies levels in comparison to other faction troops of the same level! And yes it is a BIG LOSS!!
If the horse rears in the middle of three guys = bye bye rider!
 
Really thanks for spear code, I have find a simple way for hiring in town castles. In module_scripts there are a "add guards" script, i just clone it changing "guard_troop" for "merecenary troop" them create a slot_faction_mercenary_troop in constants and place in module script a troop for this slot; so the "mercenary troop" spawns in a entry point in the castle. Then I make this troop sold you troops through dialog... Too simple but at last it makes faction-related this mercenary unit and place in every town castle in game.
 
Cabre 说:
Really thanks for spear code, I have find a simple way for hiring in town castles. In module_scripts there are a "add guards" script, i just clone it changing "guard_troop" for "merecenary troop" them create a slot_faction_mercenary_troop in constants and place in module script a troop for this slot; so the "mercenary troop" spawns in a entry point in the castle. Then I make this troop sold you troops through dialog... Too simple but at last it makes faction-related this mercenary unit and place in every town castle in game.

All that matters is it works and does what you want.

I've been looking over my script and it's needlessly complicated for what I'm doing with it.  I don't need 10 of slot_faction_recruit, just one for each of the 3 choices.  Also  I could have just easily used(or expanded) the existing slot_faction_tier troops.  Live and learn.
 
Cabre 说:
Really thanks for spear code, I have find a simple way for hiring in town castles. In module_scripts there are a "add guards" script, i just clone it changing "guard_troop" for "merecenary troop" them create a slot_faction_mercenary_troop in constants and place in module script a troop for this slot; so the "mercenary troop" spawns in a entry point in the castle. Then I make this troop sold you troops through dialog... Too simple but at last it makes faction-related this mercenary unit and place in every town castle in game.

any chance you could show the code you used to make that happen? As I have been trying to find a way to do this for a while with no luck so far. Also is there a way to make them spawn anywhere in the town castle?
 
后退
顶部 底部