I'm using Battlefield Tactics kit for it's feature, and now I want to add artillery to my mod, but I can't get one piece of code to work. I think everything else is ok, but this part... I can't get it to work :
My current code :
Formation code I must merge :
I don't know how to add the two #formation kits to it, when I put it like this it gives an error :
Thanks in advance,
MrRoy
My current code :
Code:
[
("siege_defender_join_battle",
[
(neg|troop_is_wounded, "trp_player"),
],
"Join the battle.",[
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(assign, "$g_battle_result", 0),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_walls),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_castle_exterior),
(try_end),
(call_script, "script_calculate_battle_advantage"),
(val_mul, reg0, 2),
(val_div, reg0, 3), #scale down the advantage a bit.
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(party_slot_eq, "$current_town", slot_center_siege_with_belfry, 1),
(set_jump_mission,"mt_castle_attack_walls_belfry"),
(else_try),
(set_jump_mission,"mt_castle_attack_walls_ladder"),
(try_end),
(jump_to_scene,":battle_scene"),
(assign, "$g_next_menu", "mnu_siege_started_defender"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission)]),
("siege_defender_troops_join_battle",[(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(this_or_next|troop_is_wounded, "trp_player"),
(ge, reg0, 3)],
"Order your men to join the battle without you.",[
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(select_enemy,1),
(assign,"$g_enemy_party","$g_encountered_party_2"),
(assign,"$g_ally_party","$g_encountered_party"),
(assign,"$g_siege_join", 1),
(jump_to_menu,"mnu_siege_join_defense")]),
## ("siege_defender_do_not_join_battle",[(call_script, "script_party_count_fit_regulars","p_collective_ally"),
## (gt, reg0, 0)],
## "Don't get involved.", [(leave_encounter),
## (change_screen_return),
## ]),
## ("siege_defender_surrender",[(call_script, "script_party_count_fit_regulars","p_collective_ally"),
## (this_or_next|eq, reg0, 0),
## (party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
## ],
## "Surrender.",[(assign, "$g_player_surrenders", 1),
## (jump_to_menu,"mnu_under_siege_attacked_continue")]),
]
Formation code I must merge :
Code:
[
("siege_defender_join_battle",
[
(neg|troop_is_wounded, "trp_player"),
],
"Join the battle.",[
#formation kit start-----------------------------------------------
(assign,"$battle_situation","mnu_siege_started_defender"),
(start_presentation,"prsnt_unit_selection"),
#formation kit end-----------------------------------------------
]),
("siege_defender_troops_join_battle",[(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(this_or_next|troop_is_wounded, "trp_player"),
(ge, reg0, 3)],
"Order your men to join the battle without you.",[
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(select_enemy,1),
(assign,"$g_enemy_party","$g_encountered_party_2"),
(assign,"$g_ally_party","$g_encountered_party"),
(assign,"$g_siege_join", 1),
(jump_to_menu,"mnu_siege_join_defense")]),
## ("siege_defender_do_not_join_battle",[(call_script, "script_party_count_fit_regulars","p_collective_ally"),
## (gt, reg0, 0)],
## "Don't get involved.", [(leave_encounter),
## (change_screen_return),
## ]),
## ("siege_defender_surrender",[(call_script, "script_party_count_fit_regulars","p_collective_ally"),
## (this_or_next|eq, reg0, 0),
## (party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
## ],
## "Surrender.",[(assign, "$g_player_surrenders", 1),
## (jump_to_menu,"mnu_under_siege_attacked_continue")]),
]
),
#formation kit start-----------------------------------------------
( "siege_defender_join_battle",mnf_disable_all_keys,
"_",
"none",
[
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(assign, "$g_battle_result", 0),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_walls),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_castle_exterior),
(try_end),
(call_script, "script_calculate_battle_advantage"),
(val_mul, reg0, 2),
(val_div, reg0, 3), #scale down the advantage a bit.
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(party_slot_eq, "$current_town", slot_center_siege_with_belfry, 1),
(set_jump_mission,"mt_castle_attack_walls_belfry"),
(else_try),
(set_jump_mission,"mt_castle_attack_walls_ladder"),
(try_end),
(jump_to_scene,":battle_scene"),
(assign, "$g_next_menu", "mnu_siege_started_defender"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
],[]),
#formation kit end-----------------------------------------------
I don't know how to add the two #formation kits to it, when I put it like this it gives an error :
Code:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
WARNING: Local variable never used: value
Error: Unable to find object:mnu_castle_lead_attack
ERROR: Illegal Identifier:mnu_castle_lead_attack
Error: Unable to find object:mnu_siege_defender_join_battle
ERROR: Illegal Identifier:mnu_siege_defender_join_battle
[...]
Thanks in advance,
MrRoy