vitali-attila
Regular
Hello. I'm interested in this thing as well. I am new to modding as well. I looked at these mission-templates, but didn't find the answer either. What I was thinking about: After we win in usual battles in the field we get both 'capture prisoners' and 'looting' screens. After we capture a settlement we only have the 'capture prisoners' screen So we should just copy the code of looting menu from the usual battle's code and put it after the 'capture prisoners' code from the siege victory code.kraggrim said:Drugs, this is what I was told when I asked that before:
JuJu70 said:In mission templates you need to compare village_attack_bandits and village_raid to lead_charge and make changes, also need to edit in game_menu attack_bandits and village_raid (or whatever it's called).
Sadly I wasn't able to figure it out.
In addition we can add the code to reward the player with money and xp after for capturing a settlement. Again we copy he code and put it in the right place.
Unfortunately, I do not know for sure how to do this correctly but I've found some code. I hope that more experienced modders will help us.
I did everything in module_game_menus.py
Code:
(troop_clear_inventory, "trp_temp_troop"),
(call_script, "script_party_calculate_loot", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
(gt, reg0, 0),
(troop_sort_inventory, "trp_temp_troop"),
(change_screen_loot, "trp_temp_troop"),
(else_try),
#finished all
(try_begin),
(le, "$g_ally_party", 0),
(end_current_battle),
(try_end),
(call_script, "script_party_give_xp_and_gold", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
(try_begin),
(eq, "$g_enemy_party", 0),
(display_message,"str_error_string"),
(try_end),
I also found a simpler way of rewarding with money and xp, but it is a fixed amount.
Add this
Code:
#Add a fixed amount of money and xp to player after he has captured a settlement
(call_script, "script_troop_add_gold", "trp_player", 5000),
(add_xp_as_reward, 500),
after this line
Code:
(call_script, "script_change_troop_renown", "trp_player", 5),
Of course, make this changes in a separate module, not directly in Native!
I hope this code will be improved by experienced modders.