Buenass, logre que cuando una batalla se desarrolle en terrotorio de estepa, en vez de luchar en un aleatorio de estepa se luche en un escenario, al que llamé scn_callejon.sco, el tema es que quiero que el combate pueda suceder en 4 posibles escenarios, o mas incluso, y no se como ponerlo, este es el codigo que funciona, en module_game_menus:
en la ultima parte del codigo abajo del todo es donde elijo el escenario, ese else_try no funciona, solo elige un escenario siempre, el primero supongo xD
lo primero es neq, lo cual dedusco que es "no igual" al terreno 2, ahi se da la batalla normalmente en el campo, y el segundo ese eq, lo cual dedusco que es igual a territorio 2 (estepa) XD y manda a peleas en las calles. Saque ese codigo del q se usa para las batallas maritimas, pero no se como poner para que sea mas de un escenario posible al azar. tengo entendido que no es muy dificil pero no se como se pone! help
- Código:
("encounter_attack",[
(eq, "$encountered_party_friendly", 0),
(store_troop_health,reg(5)),(party_get_current_terrain,":terrain","p_main_party"),
(neq,":terrain",2),
],
"Charge the enemy.",
[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
(try_begin),
(eq, ":encountered_party_template", "pt_village_farmers"),
(unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
(try_end),
(call_script, "script_calculate_renown_value"),
##diplomacy start+
(try_begin),
#Call this to properly set cached values for strength
(eq, "$g_dplmc_terrain_advantage", DPLMC_TERRAIN_ADVANTAGE_ENABLE),
(assign, ":terrain_code", dplmc_terrain_code_none),#defined in header_terrain_types.py
(try_begin),
(this_or_next|eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(assign, ":terrain_code", dplmc_terrain_code_village),#defined in header_terrain_types.py
(else_try),
(encountered_party_is_attacker),
(call_script, "script_dplmc_get_terrain_code_for_battle", "$g_encountered_party", "p_main_party"),
(assign, ":terrain_code", reg0),
(else_try),
(call_script, "script_dplmc_get_terrain_code_for_battle", "p_main_party", "$g_encountered_party"),
(assign, ":terrain_code", reg0),
(try_end),
(neq, ":terrain_code", dplmc_terrain_code_none),
(call_script, "script_dplmc_party_calculate_strength_in_terrain", "p_main_party", ":terrain_code", 0, 1),
(call_script, "script_dplmc_party_calculate_strength_in_terrain", "$g_encountered_party", ":terrain_code", 0, 1),
(try_end),
##diplomacy end+
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_lead_charge"),
#gekokujo 3.0 disable horses in sea battles start
(party_get_current_terrain, ":terrain_type", "p_main_party"),
(try_begin),
(eq, ":terrain_type", rt_bridge),
(mission_tpl_entry_set_override_flags, "mt_lead_charge", 0, af_override_horse),
(mission_tpl_entry_set_override_flags, "mt_lead_charge", 1, af_override_horse),
(mission_tpl_entry_set_override_flags, "mt_lead_charge", 2, af_override_horse),
(mission_tpl_entry_set_override_flags, "mt_lead_charge", 3, af_override_horse),
(try_end),
#gekokujo 3.0 disable horses in sea battles end
(call_script, "script_setup_random_scene"),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("encounter_order_attack",
[
(eq, "$encountered_party_friendly", 0),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),(ge, reg0, 4),
#gekokujo 2.1 PBO
## PreBattle Orders Begin
(party_slot_eq, "p_main_party", slot_party_prebattle_plan, 0),
## PreBattle Orders End
],
"Order your troops to attack without you.",
[
(jump_to_menu, "mnu_order_attack_begin"),
#(simulate_battle,3),
]),
("encounter_leave",[
(eq,"$cant_leave_encounter", 0),
#gekokujo 2.1 PBO
## PreBattle Orders Begin
(party_slot_eq, "p_main_party", slot_party_prebattle_plan, 0),
## PreBattle Orders End
],"Leave.",[
]),
("encounter_attack",[
(eq, "$encountered_party_friendly", 0),
(store_troop_health,reg(5)),(party_get_current_terrain,":terrain","p_main_party"),
(eq,":terrain",2),
],
"Charge the enemy.",
[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
(try_begin),
(eq, ":encountered_party_template", "pt_village_farmers"),
(unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
(try_end),
(call_script, "script_calculate_renown_value"),
##diplomacy start+
(try_begin),
#Call this to properly set cached values for strength
(eq, "$g_dplmc_terrain_advantage", DPLMC_TERRAIN_ADVANTAGE_ENABLE),
(assign, ":terrain_code", dplmc_terrain_code_none),#defined in header_terrain_types.py
(try_begin),
(this_or_next|eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(assign, ":terrain_code", dplmc_terrain_code_village),#defined in header_terrain_types.py
(else_try),
(encountered_party_is_attacker),
(call_script, "script_dplmc_get_terrain_code_for_battle", "$g_encountered_party", "p_main_party"),
(assign, ":terrain_code", reg0),
(else_try),
(call_script, "script_dplmc_get_terrain_code_for_battle", "p_main_party", "$g_encountered_party"),
(assign, ":terrain_code", reg0),
(try_end),
(neq, ":terrain_code", dplmc_terrain_code_none),
(call_script, "script_dplmc_party_calculate_strength_in_terrain", "p_main_party", ":terrain_code", 0, 1),
(call_script, "script_dplmc_party_calculate_strength_in_terrain", "$g_encountered_party", ":terrain_code", 0, 1),
(try_end),
##diplomacy end+
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_lead_charge"),
(try_begin),
(val_add,reg10,reg11),
(gt,reg10,30),
(jump_to_scene, "scn_callejon"),
(else_try),
(jump_to_scene, "scn_callejon_b"),
(else_try),
(jump_to_scene, "scn_callejon_c"),
(else_try),
(jump_to_scene, "scn_callejon_d"),
(end_try),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
en la ultima parte del codigo abajo del todo es donde elijo el escenario, ese else_try no funciona, solo elige un escenario siempre, el primero supongo xD
lo primero es neq, lo cual dedusco que es "no igual" al terreno 2, ahi se da la batalla normalmente en el campo, y el segundo ese eq, lo cual dedusco que es igual a territorio 2 (estepa) XD y manda a peleas en las calles. Saque ese codigo del q se usa para las batallas maritimas, pero no se como poner para que sea mas de un escenario posible al azar. tengo entendido que no es muy dificil pero no se como se pone! help