Written for WB, SP and MP, unsure if it works with MB.
Don't know if this has been done before, but I keep seeing threads asking for "tf_guarantee_all" and "tf_guarantee_polearms" so I wrote this script.
As the subject say, this script ensures the troops have ALL 1hand 2hand and polearms mentioned in troops.py.
Add to Module_scripts,
Remember, to replace : "YOUR_TROOP", with your troops id!
To enable this script for multiple troops,
replace: (eq, ":troop", "trp_YOUR_TROOP"),
with
And in the ti_on_agent_spawn triggers of the game modes you want to enable this for:
In all the agent_spawn triggers of the native game modes, the agent should already be stored in ":agent_no", but if you are making your own mission template for a game mode, start with something like this:
Screen shot:
(Armour by Njunja, from Eastern Armor OSP 1.0)
Works best with Caba`drin 's weapon switching script!
http://forums.taleworlds.com/index.php/topic,134031.0.html
Thanks Vornne for providing all the amendments!
Cheers.
Don't know if this has been done before, but I keep seeing threads asking for "tf_guarantee_all" and "tf_guarantee_polearms" so I wrote this script.
As the subject say, this script ensures the troops have ALL 1hand 2hand and polearms mentioned in troops.py.
Add to Module_scripts,
Code:
("force_weapon",
[(store_script_param, ":agent", 1),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(agent_is_alive, ":agent"),
(agent_is_non_player, ":agent"),
(agent_get_troop_id, ":troop", ":agent"),
(eq, ":troop", "trp_YOUR_TROOP"),
(troop_get_inventory_capacity, ":cap", ":troop"),
(try_for_range, ":i", 0, ":cap"),
(troop_get_inventory_slot, ":item", ":troop", ":i"),
(ge, ":item", 0),
(item_get_type, ":type", ":item"),
(ge, ":type", itp_type_one_handed_wpn),
(le, ":type", itp_type_polearm),
(neg|agent_has_item_equipped, ":agent", ":item"),
(agent_equip_item, ":agent", ":item"),
(try_end), #try inventory
(try_end),
]),
To enable this script for multiple troops,
replace: (eq, ":troop", "trp_YOUR_TROOP"),
with
Code:
(this_or_next|eq, ":troop", "trp_YOUR_TROOP"),
(this_or_next|eq, ":troop", "trp_YOUR_TROOP2"),
(this_or_next|eq, ":troop", "trp_YOUR_TROO3"),
... ... ...
(eq, ":troop", "trp_YOUR_TROOP_last"),
And in the ti_on_agent_spawn triggers of the game modes you want to enable this for:
Code:
(call_script, "script_force_weapon", ":agent_no"),
In all the agent_spawn triggers of the native game modes, the agent should already be stored in ":agent_no", but if you are making your own mission template for a game mode, start with something like this:
Code:
(ti_on_agent_spawn, 0, 0, [],
[(store_trigger_param_1, ":agent_no"),
(call_script, "script_force_weapon", ":agent_no"),
]),
(Armour by Njunja, from Eastern Armor OSP 1.0)
Works best with Caba`drin 's weapon switching script!
http://forums.taleworlds.com/index.php/topic,134031.0.html
Thanks Vornne for providing all the amendments!
Cheers.