DogSoldieR needs beta testers for WARBAND native-feel project

Users who are viewing this thread

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

What do you know, someone came and put out a chest tutorial just when we were discussing it!
AHAHAHA I will see where this takes us.

Be patient my good people, this will be interesting. The next version shall be delayed again. No dateline yet.
 
No, just merely putting in a chest inventory access function like castles and towns. I will not do scene editing more than I need to.


Update:

Feast location selection

After weeks of bashing my head into a forest of entangling codes. I have given up modifying the feast function. It is way above my understanding akin to a space monkey spouting rocket science theory. I am way out of my depth here.

Deserter recruitment refinement
I will come back to this now and see how the game reacts to your code you given Zerilius. I am considering extending this function to recruiting bandits to the "Bandit edition" when I get around to it. Hope everything goes well here.

Apartment function
Next up will be the apartment function.

1st phase of coding will be to allow guild masters to sell to the player an apartment, much like an enterprize venture.

2nd phase of coding will be more ambitious, which is to RENT an apartment monthly. This is complicated as it involves several variables. I would like everyone's input on this.

1. Faction ownership of town. What will happen if another faction siezes it?

2. Chest inventory. Which NPC chest inventory should be suitable to be used for this? I'm thinking to link the apartment chest inventory to the castle/town inventory. They will share the same box, function wise.

3. Rental access. Code will be tricky to allow or disallow a player access to an apartment. I could try to port over the codes concerning an enterprize.







 
I thought you would manage the feast thing yourself but if you were stuck why didn't you ask. You could have sent me a PM. Okay now I will see what the problem is, just PM me that part of code.

Deserters code works for me but if there are multiple troops in deserter party then additional code is to be added. In my game I haven't seen this but if you see then tell me.

For third part I would say if you are at peace with besieging faction then no problem should be there.
 
This part is good, it works fine.

##choosing a town/castle to host a feast

[anyone, "spouse_feast_location_ask",
  [
  ],
  "Where do you want to host the feast?", "spouse_feast_select",
  []],


  [anyone|plyr|repeat_for_parties, "spouse_feast_select",
  [
  (store_repeat_object, ":center"),
    (is_between, ":center", walled_centers_begin, walled_centers_end),
    (troop_get_slot, ":cur_residence", "$g_talk_troop", slot_troop_cur_center),
    (party_slot_eq, ":center", slot_town_lord, "trp_player"),
    (str_store_party_name, s9, ":center"),
  ],
"{s9}.", "spouse_feast_ask_confirm",
  [
(store_repeat_object, ":feast_venue"),
(str_store_party_name, s9, ":feast_venue"),
]
],


  [anyone|plyr, "spouse_feast_select",
  [],
  "No. I changed my mind.", "spouse_pretalk",[
]],



  [anyone, "spouse_feast_ask_confirm",
  [
      #(str_store_party_name, s9, ":feast_venue"),
  ],
  "Are you sure that you want to host the feast at {s9}?", "spouse_feast_move_comfirm",[
]],


[anyone|plyr, "spouse_feast_move_comfirm",
  [ ],#[(str_store_party_name, s9, ":feast_venue"), ],
  "Yes,  please arrange everything.", "spouse_feast_move_comfirmed",[

#move the spouse/wife to new feast venue
#(try_begin),
  #      (troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
#      (troop_slot_eq, ":player_spouse", slot_troop_occupation, slto_kingdom_lady),
  ##diplomacy end+
#      (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":feast_venue"),
  ##diplomacy start+
#  (try_end),
  ##diplomacy end+

]],


  [anyone|plyr, "spouse_feast_move_comfirm",
  [],
  "No. I changed my mind.", "spouse_pretalk",[
]],


  [anyone, "spouse_feast_move_comfirmed",
  [],
  "As you wish, I will make arrangements for the feast to be hosted at {s9}.", "spouse_feast_comfirm_yes",[
]],

But the problem is linking the part above to this part which exists.
I simply do not understand what the logic is doing, highlighted in blue.

#feast actual function

###NOT SURE WHAT THIS FUNCTION IS ABOUT !?!?!?

## The blue parts puzzles me what this logic function is doing

## this is logic check for 1 condition

[anyone, "spouse_feast_comfirm_yes",
  [ (neq, "$players_kingdom", "fac_player_supporters_faction"),],
  "I shall send word, then, that we will host a feast as soon as conditions in the realm permit. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality.",  "spouse_pretalk",[


  (assign, ":feast_venue", -1),
    (try_begin),
      (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
      (this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
        (party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
      (assign, ":feast_venue", "$g_encountered_party"),
  (else_try),
      (try_for_range, ":center", walled_centers_begin, walled_centers_end),
        (eq, ":feast_venue", -1),
        (this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
            (party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
        (assign, ":feast_venue", ":center"),
      (try_end),
  (else_try),
      (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
      (assign, ":feast_venue", "$g_encountered_party"),
    (try_end),



  (str_store_party_name, s9, ":feast_venue"),
  (setup_quest_text, "qst_organize_feast"),
  (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),

  (quest_set_slot, "qst_organize_feast", slot_quest_target_center, ":feast_venue"),
  (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
  (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
  ]],


## this is logic check for condition 2.

  [anyone, "spouse_feast_comfirm_yes",
  [
  ],
  "Very well, then. Let the feast begin immediately at {s9}. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality. You may declare the feast to be concluded at any time, either by beginning a campaign or by letting it be known that the vassals can return to their homes.",  "spouse_pretalk",[

  (str_store_party_name, s9, "$g_player_court"),
  (setup_quest_text, "qst_organize_feast"),
  (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),

  (quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$g_player_court"),
  (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
  (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),

  (faction_set_slot, "$players_kingdom", slot_faction_ai_state, sfai_feast),
  (faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$g_player_court"),

  (assign, "$player_marshal_ai_state", sfai_feast),
  (assign, "$player_marshal_ai_object", "$g_player_court"),

  (assign, "$g_recalculate_ais", 1),
  (assign, reg4, 1),
  (try_begin),
  (neq, "$g_encountered_party", "$g_player_court"),
  (assign, reg4, 0),
  (try_end),

  ]],

This was what you suggested.
In the first code assign $temp = :feast_venue

In the second code replace all $g_encountered_party with $temp

I hope this should work but still you need to move your wife to the feast venue until feast is over and then move her back to the court.

I am very puzzled at the way $g_encountered_party and $g_player_court works in the existing code, highlighted in blue.
I tried what you suggested but something in those blue codes cant accept the changes. This is what truly stumps me.
Hopefully you can understand what the logic is doing in those blue codes.
 
I propose the following changes;

That every faction would have two different troop trees: a "professional" troop tree, which will stay the same but a few added troops i'll make.

Then there would be a peasant/conscript/levy tree, which would have low-quality but easy-to-maintain troops, which could then over time upgrade to troops armed with regular swords and some weak mail armour. Something like Mercenary Swordsmen, but weaker. Every faction has different type of troop trees, of course.

This levy-thing will require an option to conscript peasants from villages, i think there is already option like that implanted though. I think it was native expansion or the sorts. You would conscript a troop, for example "Swadian Conscript", which would upgrade to "Swadian Levy Bowman(crossbowman, if you wish) and "Swadian Levy Militia", which would then upgrade to "Swadian Heavy Militia".

These are just my thoughts, they will expand. I just took swadia as an example.


 
Code:
##choosing a town/castle to host a feast

[anyone, "spouse_feast_location_ask",
   [
   ],
   "Where do you want to host the feast?", "spouse_feast_select",
   []],


  [anyone|plyr|repeat_for_parties, "spouse_feast_select",
  [
   (store_repeat_object, ":center"),
    (is_between, ":center", walled_centers_begin, walled_centers_end),
   # (troop_get_slot, ":cur_residence", "$g_talk_troop", slot_troop_cur_center),
    (party_slot_eq, ":center", slot_town_lord, "trp_player"),
    (str_store_party_name, s9, ":center"),
  ],
 "{s9}.", "spouse_feast_ask_confirm",
   [
##zerilius changes begin
#(store_repeat_object, ":feast_venue"),
#(str_store_party_name, s9, ":feast_venue"),
(store_repeat_object, "$temp"),
(str_store_party_name, s9, "$temp"),
##zerilius changes end
 ]
],


  [anyone|plyr, "spouse_feast_select",
   [],
   "No. I changed my mind.", "spouse_pretalk",[
 ]],

 

  [anyone, "spouse_feast_ask_confirm",
   [
       #(str_store_party_name, s9, ":feast_venue"),
   ],
   "Are you sure that you want to host the feast at {s9}?", "spouse_feast_move_comfirm",[
 ]],


 [anyone|plyr, "spouse_feast_move_comfirm",
   [ ],#[(str_store_party_name, s9, ":feast_venue"), ],
   "Yes,  please arrange everything.", "spouse_feast_move_comfirmed",[

#move the spouse/wife to new feast venue
#(try_begin),
  #      (troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
#      (troop_slot_eq, ":player_spouse", slot_troop_occupation, slto_kingdom_lady),
   ##diplomacy end+
#      (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":feast_venue"),
   ##diplomacy start+
#   (try_end),
   ##diplomacy end+

 ]],


  [anyone|plyr, "spouse_feast_move_comfirm",
   [],
   "No. I changed my mind.", "spouse_pretalk",[
 ]],


  [anyone, "spouse_feast_move_comfirmed",
   [],
   "As you wish, I will make arrangements for the feast to be hosted at {s9}.", "spouse_feast_comfirm_yes",[
 ]],

Code:
## this is logic check for 1 condition

[anyone, "spouse_feast_comfirm_yes",
   [ (neq, "$players_kingdom", "fac_player_supporters_faction"),],
   "I shall send word, then, that we will host a feast as soon as conditions in the realm permit. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality.",   "spouse_pretalk",[


    (assign, ":feast_venue", -1),
    (try_begin),
	##zerilius changes begin
	  (is_between, "$temp", walled_centers_begin, walled_centers_end),
      (this_or_next|party_slot_eq, "$temp", slot_town_lord, "trp_player"),
      (party_slot_eq, "$temp", slot_town_lord, "$g_talk_troop"),
      (assign, ":feast_venue", "$temp"),
      # (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
      # (this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
      # (party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
      # (assign, ":feast_venue", "$g_encountered_party"),
	  ##zerilius changes end
   (else_try),
      (try_for_range, ":center", walled_centers_begin, walled_centers_end),
         (eq, ":feast_venue", -1),
         (this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
         (party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
         (assign, ":feast_venue", ":center"),
      (try_end),
   (else_try),
      (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
      (assign, ":feast_venue", "$g_encountered_party"),
   (try_end),


   (str_store_party_name, s9, ":feast_venue"),
   (setup_quest_text, "qst_organize_feast"),
   (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),

   (quest_set_slot, "qst_organize_feast", slot_quest_target_center, ":feast_venue"),
   (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
   (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
   ]],


## this is logic check for condition 2.

   [anyone, "spouse_feast_comfirm_yes",
   [
   ],
   "Very well, then. Let the feast begin immediately at {s9}. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality. You may declare the feast to be concluded at any time, either by beginning a campaign or by letting it be known that the vassals can return to their homes.",   "spouse_pretalk",[

   ##zerilius changes begin
   #(str_store_party_name, s9, "$g_player_court"),
   (str_store_party_name, s9, "$temp"),
   ##zerilius changes end
   (setup_quest_text, "qst_organize_feast"),
   (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),

   ##zerilius changes begin
   #(quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$g_player_court"),
   (quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$temp"),
   ##zerilius changes end
   (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
   (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),

   (faction_set_slot, "$players_kingdom", slot_faction_ai_state, sfai_feast),
   ##zerilius changes begin
   #(faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$g_player_court"),
   (faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$temp"),
   ##zerilius changes end

   (assign, "$player_marshal_ai_state", sfai_feast),
   ##zerilius changes begin
   #(assign, "$player_marshal_ai_object", "$g_player_court"),
   (assign, "$player_marshal_ai_object", "$temp"),
   ##zerilius changes end

   (assign, "$g_recalculate_ais", 1),
   (assign, reg4, 1),
   (try_begin),
   (neq, "$g_encountered_party", "$g_player_court"),
   (assign, reg4, 0),
   (try_end),
   ]],

Hi Dogsoldier. Back after a long time. Actually I had my exams and was busy in the preparation, so no time for modding. :neutral:
But now I am free for some time. :razz:

Okay use this code for that feast thing. This is untested so tell me if there are problems.
 
Wow, Zerilius you're an expert, that's very impressing.  :grin:

Would it be possible to add an option to "force" recruitment from villages, for example conscripts?
 
Das Knecht said:
I propose the following changes;

That every faction would have two different troop trees: a "professional" troop tree, which will stay the same but a few added troops i'll make.

Then there would be a peasant/conscript/levy tree, which would have low-quality but easy-to-maintain troops, which could then over time upgrade to troops armed with regular swords and some weak mail armour. Something like Mercenary Swordsmen, but weaker. Every faction has different type of troop trees, of course.

This levy-thing will require an option to conscript peasants from villages, i think there is already option like that implanted though. I think it was native expansion or the sorts. You would conscript a troop, for example "Swadian Conscript", which would upgrade to "Swadian Levy Bowman(crossbowman, if you wish) and "Swadian Levy Militia", which would then upgrade to "Swadian Heavy Militia".

These are just my thoughts, they will expand. I just took swadia as an example.

Yeah , its Native Expansion , becareful tho, dont make the same mistake as NE, over-powered cavalry troops like Paladins and the higher tiers elite troops, cruising in NE makes it boring...

 
Das Knecht said:
Would it be possible to add an option to "force" recruitment from villages, for example conscripts?

Yeah possible and easy enough. Just tell the conditions and requirements.

Yeah , its Native Expansion , becareful
tho, dont make the same mistake as
NE, over-powered cavalry troops like
Paladins and the higher tiers elite
troops, cruising in NE makes it boring...
don't use what you don't like. Btw those powerful troops are for dark knights. It is very difficult to beat them without paladins and crusaders.
 
Zerilius said:
Das Knecht said:
Would it be possible to add an option to "force" recruitment from villages, for example conscripts?

Yeah possible and easy enough. Just tell the conditions and requirements.

Let's say for example -7 relations with the village when you force recruitment, you get 10-30 recruits. When you conscript your own village, the relation loss is -10. Requirements? You need to be a vassal of a realm. You get a troop called "Faction X Conscript", for example "Swadian Conscript"

I've already made the conscript troop tree's skeleton troops, which will be edited and tested as soon as I will get the conscription script  :smile:
 
Zerilius said:
Das Knecht said:
Would it be possible to add an option to "force" recruitment from villages, for example conscripts?

Yeah possible and easy enough. Just tell the conditions and requirements.

Yeah , its Native Expansion , becareful
tho, dont make the same mistake as
NE, over-powered cavalry troops like
Paladins and the higher tiers elite
troops, cruising in NE makes it boring...
don't use what you don't like. Btw those powerful troops are for dark knights. It is very difficult to beat them without paladins and crusaders.

i know. but waht if the dark knights are dead and gone. They will probably will in most games..the Elites are gonna get wasted if you just disband them. Im just stating what most swadian player will do...Yes, it may be difficult without Elites, but in THIS mod, there is no dark knights so far...
 
Hey DK here is your force recruitment code. Needs thorough testing though.

In module_game_menus.py
Code:
("recruit_volunteers",
      [
        (call_script, "script_cf_village_recruit_volunteers_cond"),
       ]
       ,"Recruit Volunteers.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (jump_to_menu, "mnu_recruit_volunteers"),
         (try_end),
        ]),	
		
      ##zerilius changes begin
	  ("force_recruit_volunteers",
      [
	  (call_script, "script_cf_village_recruit_conscripts_cond"),
	  ]
       ,"Force Recruit Volunteers.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (jump_to_menu, "mnu_force_recruit_conscripts"),
         (try_end),
        ]),
		##zerilius changes end
		
      ("village_center",[(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
                         (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
                         (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),]
       ,"Go to the village center.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (party_get_slot, ":village_scene", "$current_town", slot_castle_exterior),
           (modify_visitors_at_site,":village_scene"),
           (reset_visitors),
           (party_get_slot, ":village_elder_troop", "$current_town",slot_town_elder),
           (set_visitor, 11, ":village_elder_troop"),

IN module_game_menus (at the end)
Code:
##zerilius changes begin
(
    "force_recruit_conscripts",0,
    "{s18}",
    "none",
    [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_conscript_troop_type),
     (party_get_slot, ":volunteer_amount", "$current_town", slot_center_conscript_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
     (assign, ":party_capacity", ":free_capacity"),
     (val_min, ":party_capacity", ":gold_capacity"),
     (try_begin),
       (gt, ":party_capacity", 0),
       (val_min, ":volunteer_amount", ":party_capacity"),
     (try_end),
     (assign, reg5, ":volunteer_amount"),
     (assign, reg7, 0),
     (try_begin),
       (gt, ":volunteer_amount", ":gold_capacity"),
       (assign, reg7, 1), #not enough money
     (try_end),
     (try_begin),
       (eq, ":volunteer_amount", 0),
       (str_store_string, s18, "@No one here seems to be willing to join your party."),
     (else_try),
       (store_mul, reg6, ":volunteer_amount", 10),#10 denars per man
       (str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
       (try_begin),
         (eq, reg5, 1),
         (str_store_string, s18, "@One {s3} volunteers to follow you."),
       (else_try),
         (str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
       (try_end),
       (set_background_mesh, "mesh_pic_recruits"),
     (try_end),
	 (try_begin),
	   (this_or_next|eq, "$g_encountered_party_faction", "$players_kingdom"),
	   (eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
	   (call_script, "script_change_player_relation_with_center", "$current_town", -10),
	 (else_try),
	   (call_script, "script_change_player_relation_with_center", "$current_town", -7),
	 (try_end),
    ],
    [
      ("continue_not_enough_gold",
      [
        (eq, reg7, 1),
      ],
      "I don't have enough money...",
      [
        (jump_to_menu,"mnu_village"),
      ]),
       
      ("continue",
      [
        (eq, reg7, 0),
        (eq, reg5, 0),
      ], #noone willing to join                   
      "Continue...",
      [
        (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
        (jump_to_menu,"mnu_village"),
      ]),
       
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_village_recruit_conscripts_recruit"),
                        
        (jump_to_menu,"mnu_village"),
      ]),
      
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Forget it.",
      [
        (jump_to_menu,"mnu_village"),
      ]),
    ],
  ),
  ##zerilius changes end

In module_constants
Code:
slot_party_under_player_suggestion			= 249 #move this up a bit
slot_town_trade_good_prices_begin 			= 250

slot_center_last_reconnoitered_by_faction_time 				= 350
#slot_center_last_reconnoitered_by_faction_cached_strength 	= 360
#slot_center_last_reconnoitered_by_faction_friend_strength 	= 370

##zerilius changes begin
slot_center_conscript_troop_type  = 400
slot_center_conscript_troop_amount= 401
##zerilius changes end

In module_simple_triggers (at the end)
Code:
##zerilius changes begin
  (72,
   [
     (try_for_range, ":village_no", villages_begin, villages_end),
	   (call_script, "script_update_conscript_troops_in_village", ":village_no"),
     (try_end),
    ]),	
  ##zerilius changes end
 
 
In module_scripts (at the end)
Code:
##zerilius changes begin
("update_conscript_troops_in_village",
    [
       (store_script_param, ":center_no", 1),
       (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
       (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
	   ##you may need to change this line below otherwise it takes only the faction troops
       (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
       (assign, ":volunteer_troop_tier", 1),
       (store_random_in_range, ":tier_upgrades", 0, 2),
       (try_for_range, ":unused", 0, ":tier_upgrades"),
         (store_random_in_range, ":random_no", 0, 100),
         (lt, ":random_no", 10),
         (store_random_in_range, ":random_no", 0, 2),
         (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
         (try_begin),
           (le, ":upgrade_troop_no", 0),
           (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
         (try_end),
         (gt, ":upgrade_troop_no", 0),
         (val_add, ":volunteer_troop_tier", 1),
         (assign, ":volunteer_troop", ":upgrade_troop_no"),
       (try_end),

       (assign, ":upper_limit", 14),
       (try_begin),
         (ge, ":player_relation", 5),
         (assign, ":upper_limit", ":player_relation"),
         (val_div, ":upper_limit", 2),
         (val_add, ":upper_limit", 10),
       (else_try),
         (lt, ":player_relation", 0),
         (assign, ":upper_limit", 10),
       (try_end),
	   (try_begin),
         (party_slot_ge, ":center_no", slot_center_volunteer_troop_amount, 0),
         (val_add, ":upper_limit", 10),
	   (try_end),
	   

##Uncomment below to use this diplomacy part
# ##diplomacy begin
      # (assign, ":percent", 100),
      # (try_begin), #-30% if not owner
        # (neg|party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
        # (val_sub, ":percent", 30),
      # (try_end),
      # (try_begin), #1%/4 renown
        # (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
        # (val_div, ":player_renown", 4),
        # (val_add, ":percent", ":player_renown"),
      # (try_end),
      # (try_begin), #1%/3 honour
        # (assign, ":player_honour", "$player_honor"),
        # (val_div, ":player_honour", 3),
        # (val_add, ":percent", ":player_honour"),
      # (try_end),
      # (try_begin), #+5% if king
        # (faction_get_slot, ":faction_leader", "fac_player_supporters_faction", slot_faction_leader),
        # (eq, ":faction_leader", "trp_player"),
        # (val_add, ":percent", 5),

        # (try_begin), #-5% for each point of serfdom
          # (faction_get_slot, ":serfdom", "fac_player_supporters_faction", dplmc_slot_faction_serfdom),
          # (neq, ":serfdom", 0),
          # (val_mul, ":serfdom", 5),
          # (val_sub, ":percent", ":serfdom"),
        # (try_end),

        # (try_begin),  #+5% if king of village
          # (store_faction_of_party, ":faction", ":center_no"),
          # (eq, ":faction", "fac_player_supporters_faction"),
          # (val_add, ":percent", 5),
        # (try_end),
      # (try_end),

      # (try_begin),
        # (gt, ":upper_limit", 0),
        # (val_clamp, ":percent", 0, 201),
        # (val_mul, ":upper_limit", ":percent"),
        # (val_div, ":upper_limit", 100),
      # (try_end),

# ##diplomacy end


       (val_mul, ":upper_limit", 3),
       (store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
       (val_div, ":upper_limit", ":amount_random_divider"),

       (store_random_in_range, ":amount", 0, ":upper_limit"),
       (party_set_slot, ":center_no", slot_center_conscript_troop_type, ":volunteer_troop"),
       (party_set_slot, ":center_no", slot_center_conscript_troop_amount, ":amount"),
     ]),
	 
("village_recruit_conscripts_recruit",
    [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_conscript_troop_type),
     (party_get_slot, ":volunteer_amount", "$current_town", slot_center_conscript_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, ":volunteer_amount", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
     (val_min, ":volunteer_amount", ":gold_capacity"),
     (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
     (party_set_slot, "$current_town", slot_center_conscript_troop_amount, -1),
     (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
     (troop_remove_gold, "trp_player", ":cost"),
     ]),
	 
("cf_village_recruit_conscripts_cond",
    [

	 (try_begin),
		(eq, "$cheat_mode", 1),
		(display_message, "str_checking_volunteer_availability_script"),
	 (try_end),

	 (neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
     (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
     (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
	 
	  (this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
	  (eq, "$player_has_homage", 1),

	 (try_begin),
		(eq, "$cheat_mode", 1),
		(display_message, "str_relationfaction_conditions_met"),
	 (try_end),


     (party_slot_ge, "$current_town", slot_center_conscript_troop_amount, 0),
     (party_slot_ge, "$current_town", slot_center_conscript_troop_type, 1),

	 (try_begin),
		(eq, "$cheat_mode", 1),
		(display_message, "str_troops_available"),
	 (try_end),


     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (ge, ":free_capacity", 1),

	 (try_begin),
		(eq, "$cheat_mode", 1),
		(display_message, "str_party_has_capacity"),
	 (try_end),


     ]),
##zerilius changes end


In this code you will get the conscripts as same troops as of the faction. Since I don't know your troop tree I can't add them. I hope you can add them on your own.

(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),

This line needs to be changed like below

(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_conscript_troop),

Then you also need to initialize them in script_game_start
(Search for # Cultures:  )
 
Ok, thanks mate  :smile:

Sending the troop.txt file to you now.

Epic work with the scripts man. I'll go and test them when i just get the conscript troops correctly.

I have only swadian conscript up so far, just to test the system out. So if it's possible, make them in a way you don't have to redo the scripts when i make the troops for other factions  :smile:
 
Back
Top Bottom