Hello M&B nation. I made a new small code for donating villages(I added it for towns too at bottom of message. Town codes are simple and clear but needs develop. ). This is my first open source code.
I'm working on WFaS module system. WFaS MS is a bit old. But codes are simple and clear.
You can warn if you find some mistakes.
Clear but open to develop as you can see.
module_constants
For WFaS
Find this:
After add this:
For Warband
Find this:
After add this:
module_game_menus
Find this:
After add this:
module_simple_triggers
Go to end of codes and find the last ] sign.
Add this to the top of last ] sign :
I coded it for towns, too.
Giving credit is your preference. You can credit in your mod as "by GrandTÜRK Tüfekçi Başı" or "by GrandTURK Tufekci Basi" if want to do.
You are free to edit codes but you must say at your mod's page if you edit codes.
I'm working on WFaS module system. WFaS MS is a bit old. But codes are simple and clear.
You can warn if you find some mistakes.
Clear but open to develop as you can see.
module_constants
For WFaS
Find this:
Code:
slot_center_last_recruting_time = 345
After add this:
Code:
slot_donate_party= 346
For Warband
Find this:
Code:
slot_center_last_reconnoitered_by_faction_time = 350
After add this:
Code:
slot_donate_party = 351
module_game_menus
Find this:
Code:
("village_hostile_action",[(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),],"Take a hostile action.",
[(jump_to_menu,"mnu_village_hostile_action"),
]),
After add this:
Code:
(
"village_donation",mnf_disable_all_keys," ",
"none",
[],
[
("village_donation_inside",[
(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),],"Make a donation(2000 Thaler).",
[
(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
(store_troop_gold, ":gold", "trp_player"),
(store_random_in_range, ":zero_one", 0,2),
(store_random_in_range, ":one_two", 1,3),
(store_random_in_range, ":two_three", 2,4),
(try_begin),
(neg|party_slot_eq, "$current_town", slot_donate_party, 1),
(try_begin),
(ge, ":gold", 2000), ## donation is 2000 Thaler, you can easily change this.
(troop_remove_gold, "trp_player", 2000),
(try_begin),
(is_between, ":prosperity", 0, 20),
(call_script, "script_change_player_relation_with_center", "$current_town", ":two_three"),
(val_add, ":prosperity", ":two_three"),
(else_try),
(is_between, ":prosperity", 20, 40),
(call_script, "script_change_player_relation_with_center", "$current_town", 2),
(val_add, ":prosperity", 2),
(else_try),
(is_between, ":prosperity", 40, 60),
(call_script, "script_change_player_relation_with_center", "$current_town", ":one_two"),
(val_add, ":prosperity", ":one_two"),
(else_try),
(is_between, ":prosperity", 60, 80),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(val_add, ":prosperity", 1),
(else_try),
(call_script, "script_change_player_relation_with_center", "$current_town", ":zero_one"),
(val_add, ":prosperity", ":zero_one"),
(try_end),
(display_message,"@You donated 2000 Thaler.",0xFFFF00), # Yellow. You can change the colour what you want.
(party_set_slot, "$current_town", slot_donate_party, 1),
(else_try),
(display_message,"@You don't have enough money to donate.",0x888888), # Gray. You can change the colour what you want.
(try_end),
(else_try),
(display_message,"@They didn't accept your donation. You can ask them after one week.",0xAA0000), #I said "one week". This is controlling by a simple trigger. You must match words with digits. Simple trigger has given at bottom of codes. # Dark red. You can change the colour what you want.
(try_end),
]),
]
),
module_simple_triggers
Go to end of codes and find the last ] sign.
Add this to the top of last ] sign :
Code:
(24*7, # 24*7 means one week. I said at bit top. You must match words with digits for your mods health.
[
(try_for_parties, ":party"),
(party_slot_eq, ":party", slot_donate_party, 1),
(party_set_slot, ":party", slot_donate_party, 0),
(try_end),
]),
I coded it for towns, too.
module_game_menus
Find this:
After add this:
module_simple_triggers
Go to end of codes and find the last ] sign.
Add this to the top of last ] sign :
Find this:
Code:
("trade_with_merchants",
[
(party_slot_eq,"$current_town",slot_party_type, spt_town)
],"Go to the marketplace.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu,"mnu_town_trade"),
(try_end),
]),
After add this:
Code:
(
"town_donation",mnf_disable_all_keys," ",
"none",
[],
[
("village_donation_inside",[
(neg|party_slot_eq, "$current_town", slot_village_state, svs_under_siege), # Disabling donation if there is siege.
],"Make a donation(10000 Thaler).",
[
(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
(store_troop_gold, ":gold", "trp_player"),
(store_random_in_range, ":zero_one", 0,2),
(store_random_in_range, ":one_two", 1,3),
(store_random_in_range, ":two_three", 2,4),
(try_begin),
(neg|party_slot_eq, "$current_town", slot_donate_party, 1),
(try_begin),
(ge, ":gold", 10000), ## donation is 10000 Thaler, you can easily change this.
(troop_remove_gold, "trp_player", 10000),
(try_begin),
(is_between, ":prosperity", 0, 20),
(call_script, "script_change_player_relation_with_center", "$current_town", ":two_three"),
(val_add, ":prosperity", ":two_three"),
(else_try),
(is_between, ":prosperity", 20, 40),
(call_script, "script_change_player_relation_with_center", "$current_town", 2),
(val_add, ":prosperity", 2),
(else_try),
(is_between, ":prosperity", 40, 60),
(call_script, "script_change_player_relation_with_center", "$current_town", ":one_two"),
(val_add, ":prosperity", ":one_two"),
(else_try),
(is_between, ":prosperity", 60, 80),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(val_add, ":prosperity", 1),
(else_try),
(call_script, "script_change_player_relation_with_center", "$current_town", ":zero_one"),
(val_add, ":prosperity", ":zero_one"),
(try_end),
(display_message,"@You donated 10000 Thaler.",0xFFFF00), # Yellow. You can change the colour what you want.
(party_set_slot, "$current_town", slot_donate_party, 1),
(else_try),
(display_message,"@You don't have enough money to donate.",0x888888), # Gray. You can change the colour what you want.
(try_end),
(else_try),
(display_message,"@They didn't accept your donation. You can ask them after one month.",0xAA0000), #I said "one month". This is controlling by a simple trigger. You must match words with digits. Simple trigger has given at bottom of codes. # Dark red. You can change the colour what you want.
(try_end),
]),
]
),
module_simple_triggers
Go to end of codes and find the last ] sign.
Add this to the top of last ] sign :
Code:
(24*30, # 24*30 means one month. I said at a bit top. You must match words with digits for your mods health.
[
(try_for_parties, ":party"),
(party_slot_eq, ":party", slot_donate_party, 1),
(party_set_slot, ":party", slot_donate_party, 0),
(try_end),
]),
module_constants
For WFaS
Find this:
After add this:
For Warband
Find this:
After add this:
For WFaS
Find this:
Code:
slot_center_last_recruting_time = 345
After add this:
Code:
slot_donate_party= 346
For Warband
Find this:
Code:
slot_center_last_reconnoitered_by_faction_time = 350
After add this:
Code:
slot_donate_party = 351
Giving credit is your preference. You can credit in your mod as "by GrandTÜRK Tüfekçi Başı" or "by GrandTURK Tufekci Basi" if want to do.
You are free to edit codes but you must say at your mod's page if you edit codes.