Forced Recruit

Users who are viewing this thread

Utrehd

Sergeant at Arms
Old Guard
Hi i would like do Forced Recruit and i need your help, my ork until now:

Game_menus:


("village_manage",
      [
        (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),
        (party_slot_eq, "$current_town", slot_town_lord, "trp_player")
        ]
      ,"Manage this village.",
      [
          (assign, "$g_next_menu", "mnu_village"),
          (jump_to_menu, "mnu_center_manage"),
        ]),
     

  ("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),
        ]),
           
#Zwangs rekrut   
("zwangsrekrutieren",
      [
        (call_script, "script_cf_village_recruit_volunteers_cond"),
      ]
      ,"Zwangsrekrutierung der Einwohner",
      [
        (try_begin),
          (call_script, "script_cf_enter_center_location_bandit_check"),
        (else_try),
          (jump_to_menu, "mnu_recruit_volunteers"),
        (try_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"),

          (call_script, "script_init_town_walkers"),

          (try_begin),
            (check_quest_active, "qst_hunt_down_fugitive"),
            (neg|is_currently_night),
            (quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
            (neg|check_quest_succeeded, "qst_hunt_down_fugitive"),
            (neg|check_quest_failed, "qst_hunt_down_fugitive"),
            (set_visitor, 45, "trp_fugitive"),
          (try_end),


ok now i look in the script but i don't understand any thing.

I just want that you can are recruited  forced-recrurit in the villages,  by the capricious will decrease the population and the morale of the troops.


sry for my english-

 
Utrehd said:
Hi i would like do Forced Recruit and i need your help, my ork until now:

Game_menus:


("village_manage",
      [
        (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),
        (party_slot_eq, "$current_town", slot_town_lord, "trp_player")
        ]
      ,"Manage this village.",
      [
          (assign, "$g_next_menu", "mnu_village"),
          (jump_to_menu, "mnu_center_manage"),
        ]),
     

  ("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),
        ]),
           
#Zwangs rekrut   
("zwangsrekrutieren",
      [
        (call_script, "script_cf_village_recruit_volunteers_cond"),
      ]
      ,"Zwangsrekrutierung der Einwohner",
      [
        (try_begin),
          (call_script, "script_cf_enter_center_location_bandit_check"),
        (else_try),
          (jump_to_menu, "mnu_recruit_volunteers"),
        (try_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"),

          (call_script, "script_init_town_walkers"),

          (try_begin),
            (check_quest_active, "qst_hunt_down_fugitive"),
            (neg|is_currently_night),
            (quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
            (neg|check_quest_succeeded, "qst_hunt_down_fugitive"),
            (neg|check_quest_failed, "qst_hunt_down_fugitive"),
            (set_visitor, 45, "trp_fugitive"),
          (try_end),


ok now i look in the script but i don't understand any thing.

I just want that you can are recruited  forced-recrurit in the villages,  by the capricious will decrease the population and the morale of the troops.


sry for my english-

You will have to ask morchodai for this one how they implemented that in SOD. I don't think a simple script will do that you probably will need a total overhaul of the recruiting system in order to achieve what you want.

SOD is so far the only mod that accomplish this. Your garrison subtract form village. so every time you get a new recruit in your town or castle the village will have one less recruit in it.
 
^^ i think you don't understand

look

the player coming in the village because he would like recruit troops now he can bulid many forced-rekruten or a littel bit normal recruit.
 
Utrehd said:
^^ i think you don't understand

look

the player coming in the village because he would like recruit troops now he can bulid many forced-rekruten or a littel bit normal recruit.

You mean like different type of units at the same time ??? You get a list and types of recruits you can chose from ??
 
Aaaaaaaaaah! I got it!

You have the option of :
[list type=decimal]
[*]recruit some volunteers
[*]force villagers to join your army
[/list]
In the first case you just get a few recruits like normal. In the second case you get a lot more.

Is this right?
 
I think what h means is something like this.

http://forums.taleworlds.com/index.php/topic,66765.msg1726739.html#msg1726739

Go to village or town. Talk either to elder or merchant and a screen pops up giving you option of different types of soldiers to recruit. At least that is is what i make of it.
 
dzorro said:
I think what h means is something like this.

http://forums.taleworlds.com/index.php/topic,66765.msg1726739.html#msg1726739

Go to village or town. Talk either to elder or merchant and a screen pops up giving you option of different types of soldiers to recruit. At least that is is what i make of it.

No no... How would you think he'd want that when he clearly says he wants a script where he can force recruit peasants to his party. Check Topper, it ain't that hard to get.
 
@Topper + Rudovich

yes i mean that ^^

i would like have 2 option
1. recrurit voleenter    ( tahst the normal option in the village)        not many people.
2. conscripts                (tahts new)                                                  many people but the village people hate you.
 
Just a simple implementation:
Code:
      ("forced_recruits",
      [
        # Standard check
        (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),
        
        # Check if relation is enough to allow for recruitment
        (assign, ":mod_amount", 30),
        (assign, ":mod_rel_change", -15),
        (party_get_slot, ":mod_relation", "$current_town", slot_center_player_relation),
        (store_sub, ":mod_limit", -99, ":mod_rel_change"),
        (ge, ":mod_relation", ":mod_limit"),
        
        # Check if party have enough free slots
        (party_get_free_companions_capacity, ":mod_capacity", "p_main_party"),
        (ge, ":mod_capacity", ":mod_amount"),
       ]
       ,"Force villagers to join your army.",
       [
         # Add troops
         (party_get_slot, ":mod_troop", "$current_town", slot_center_volunteer_troop_type),
         (party_add_members, "p_main_party", ":mod_troop", 30),
         # Change relation
         (call_script, "script_change_player_relation_with_center", "$current_town", -15),
         
         (jump_to_menu,"mnu_village"),
        ]),
Use this instead of the red one you posted at the beginning. With this you get 30 recruits and loose 15 relation. Change the numbers as you like.
 
Sorry for reviving an old thread, but someone may find this useful at some point.
I basically edited a few lines of Duh's expanded version of this script from Floris OSP code so it fits Native or Diplomacy for Warband 1.174 now.

The option to forcibly recruit troops is presented in the village hostile actions menu, the number of obtained recruits is variable, the recruitment fails in some attempts and it all comes with pop-up messages.

The beginning of the script is marked with # FORCED RECRUIT BEGIN and the end is marked with # FORCED RECRUIT END.
Pieces of code above and below that serve for orientation in module_game_menus.

Code:
       "Loot and burn this village.",
       [
#           (party_clear, "$current_town"),
#           (party_add_template, "$current_town", "pt_villagers_in_raid"),
           (jump_to_menu, "mnu_village_start_attack"),
           ]),

# FORCED RECRUIT BEGIN
  
	("forced_recruits", 
		[
		(party_slot_eq, "$current_town", slot_village_state, svs_normal),
		],
		
		"Attempt to forcefully recruit some villagers.",

		[	
		(party_get_slot, ":recruits", "$current_town", slot_center_volunteer_troop_type),
		(party_get_free_companions_capacity, ":capacity", "p_main_party"),
		
		(try_begin),
			(gt, ":capacity", 0),
			(call_script, "script_change_player_relation_with_center", "$current_town", -10),
			(store_faction_of_party, ":fac_no", "$current_town"),
			(try_begin),
				(neq, ":fac_no", "$players_kingdom"),
				(call_script, "script_change_player_relation_with_faction_ex", ":fac_no", -2),
			(try_end),
			(store_random_in_range, ":chance", 0, 10),
			(store_random_in_range, ":amount", 2, 20),
			(try_begin),
				(gt, ":amount", ":capacity"),
				(assign, ":amount", ":capacity"),
			(try_end),
			(try_begin),
				(ge, ":chance", 3),	
				(party_add_members, "p_main_party", ":recruits", ":amount"),
				(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, 0),
				(party_set_slot, "$current_town", slot_center_volunteer_troop_type, 1),
				(assign, reg1, ":amount"),
				(display_message, "@You forced {reg1} villagers to join you."), 
				(change_screen_return),
			(else_try),
				(display_message, "@When the villagers see you approach, they take off as quick as they can. It was fast enough to escape you."),
				(party_set_slot, "$current_town", slot_center_volunteer_troop_type, 2),
				(change_screen_map),
			(try_end),
		(else_try),
			(display_message, "@You have no room left in your party."),
		(try_end),
		]),

# FORCED RECRUIT END
	
	("forget_it",[],
      "Forget it.",[(jump_to_menu,"mnu_village")]),
	
	  ],

All credits go to Duh.
 
Do not use the slot 'slot_center_volunteer_troop_type'. The script worked well as it was...
I presume your edition was only trying to compile without errors. In this modification of Duh there is not only this block, it is also necessary to add a slot and another block in 'simple_triggers' that resets the constant every 24h. in each center.

Code:
			#Duh Forced Recruit
			("forced_recruits", [(party_slot_eq, "$current_town", slot_center_recruits, 0)],
			"Attempt to forcefully recruit some villagers.",
				[
					(party_get_slot, ":recruits", "$current_town", slot_center_volunteer_troop_type),
					(party_get_free_companions_capacity, ":capacity", "p_main_party"),

					(try_begin),
						(gt, ":capacity", 0),
						(call_script, "script_change_player_relation_with_center", "$current_town", -10),
						(store_faction_of_party, ":fac_no", "$current_town"),
						(try_begin),
							(neq, ":fac_no", "$players_kingdom"),
							(call_script, "script_change_player_relation_with_faction_ex", ":fac_no", -2),
						(try_end),
						(store_random_in_range, ":chance", 0, 10),
						(store_random_in_range, ":amount", 2, 20),
						(try_begin),
							(gt, ":amount", ":capacity"),
							(assign, ":amount", ":capacity"),
						(try_end),

						(try_begin),
							(ge, ":chance", 3),
							(party_add_members, "p_main_party", ":recruits", ":amount"),
							(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, 0),
							(party_set_slot, "$current_town", slot_center_recruits, 1),
							(assign, reg1, ":amount"),
							(display_message, "@You and your men persuaded {reg1} villagers to join you."),
							(change_screen_return),
						(else_try),
							(display_message, "@When the villagers see you and your men approach, they take off as quick as they can. It was fast enough to escape you."),
							(party_set_slot, "$current_town", slot_center_recruits, 2),
							(change_screen_map),
						(try_end),
					(else_try),
						(display_message, "@You have no room left in your party."),
					(try_end),
				]
			),
			#Duh Forced Recruit End
A new constant is added to the block, not present in Native, which will take care of collecting the value 0, 1 or 2 as appropriate.
Code:
#Duh Forced Recruit
slot_center_recruits = 455
The following block is added to 'module_simple_triggers'. It will be in charge of resetting the constant every 24h. to avoid spam recruitment.
Code:
	(24, #Duh Forced Recruit, Population Resetting
		[
			(try_for_parties, ":center_no"),
				(this_or_next|party_slot_eq, ":center_no", slot_center_recruits, 1),
				(party_slot_eq, ":center_no", slot_center_recruits, 2),
				(party_set_slot, ":center_no", slot_center_recruits, 0),
			(try_end),
		]
	),
 
Back
Top Bottom