change naval battle scenes

Users who are viewing this thread

I have been trying to change the naval battle scenes, putting a condition in the join_attack and encounter_attack menu, because I will put different ships according to the attacker or defender, but whatever the encounter, it always pulls me to the same scene and it is necessary because to create the boarding ai_mesh, they don't match. The ships have different shapes, so I put a condition in the mission to change the ship type and this works fine.
In the menu already named, there are 3 conditions to change the scene according to the number of soldiers in battle and that worked well, but now I don't care about the number of soldiers, I just want the scene to change depending on who you fight with.
this is what i did ...
I deleted the quantity conditions and put the meeting conditions in both menus,
What am I missing?
Code:
                            (try_begin),
                                    (this_or_next|eq, "$g_encountered_party_faction", "fac_kingdom_1"),
                                    (this_or_next|eq, "$g_encountered_party_faction", "fac_kingdom_2"),
                                    (this_or_next|eq, "$g_encountered_party_faction", "fac_kingdom_4"),
                                    (this_or_next|eq, "$g_encountered_party_faction", "fac_kingdom_5"),
                                    (this_or_next|eq, "$g_encountered_party_faction", "fac_kingdom_6"),
                                    (eq, "$g_encountered_party_faction", "fac_kingdom_7"),
                                     (assign,"$g_my_ship", "spr_frigate1"),
                                     (jump_to_scene, "scn_sea_4"),
                                  (else_try),

                                     (eq, "$g_encountered_party_faction", "fac_outlaws"),
                                     (assign,"$g_my_ship", "spr_ship1"),
                                     (jump_to_scene, "scn_sea_2"),
                                   (else_try),
                                  
                                     (assign,"$g_my_ship","spr_frigate2"),
                                     (assign,"$g_ship2","spr_ship2"),
                                     (jump_to_scene, "scn_sea_1"),
                                 (try_end),
 
Solution
Well, I have solved the problem, thanks to the help of my friend Tocan.
Ruthven's code for naval battles
https://forums.taleworlds.com/index.php?threads/sea-battles-mk-ii-misc-scenes.136095/
in game_menu, plus a trigger to move ships from one point to another shared by frozenpainter.
https://forums.taleworlds.com/index.php?threads/moving-ships.427740/#post-9495702
I share it in case someone wanted to occupy it.
Well the code to move ships basically what it does is put 2 ships in the battle scene and move them from one side to the other and the code of naval battles in game_menu (join_atack and encounter_atack), has a condition of quantity of soldiers in battle, which I replaced to give a different ship to the enemy or my own...
Well, I have solved the problem, thanks to the help of my friend Tocan.
Ruthven's code for naval battles
https://forums.taleworlds.com/index.php?threads/sea-battles-mk-ii-misc-scenes.136095/
in game_menu, plus a trigger to move ships from one point to another shared by frozenpainter.
https://forums.taleworlds.com/index.php?threads/moving-ships.427740/#post-9495702
I share it in case someone wanted to occupy it.
Well the code to move ships basically what it does is put 2 ships in the battle scene and move them from one side to the other and the code of naval battles in game_menu (join_atack and encounter_atack), has a condition of quantity of soldiers in battle, which I replaced to give a different ship to the enemy or my own ship in addition to send it to a different scene.

In ship_battle (mission_template) add this to spawn the ships, the variables $g_mi_barco and $g_barco2 are set in game_menu
Code:
(0, 0, ti_once, [

    (entry_point_get_position, pos0, 45),(set_spawn_position, pos0),(spawn_scene_prop,"$g_mi_barco"),
    (entry_point_get_position, pos13, 46),(set_spawn_position, pos13),(spawn_scene_prop,"$g_barco2"),

    ], []),

(0, 0, ti_once,
    [
    (entry_point_get_position, pos21, 21),
    (scene_prop_get_instance,":prop","$g_mi_barco", 0),
    (prop_instance_get_starting_position, pos1, ":prop"),
    (scene_prop_get_instance,":prop","$g_mi_barco", 0),
    (prop_instance_get_position, pos1, ":prop"),
    (get_distance_between_positions, ":dist_falcon", pos1, pos21),
    (store_div,":falcon_hiz",":dist_falcon",3),
    (prop_instance_animate_to_position, ":prop", pos21, ":falcon_hiz"),

    (entry_point_get_position, pos22, 22),
    (scene_prop_get_instance,":prop2","$g_barco2", 0),
    (prop_instance_get_starting_position, pos2, ":prop2"),
    (scene_prop_get_instance,":prop2","$g_barco2", 0),
    (prop_instance_get_position, pos2, ":prop2"),
    (get_distance_between_positions, ":dist_falcon2", pos2, pos22),
    (store_div,":falcon2_hiz",":dist_falcon2",3),
    (prop_instance_animate_to_position, ":prop2", pos22, ":falcon2_hiz"),
    ], []),

In game_menu in join_atack and encounter_atack, in the (eq, ": terrain", 0) section, replace this
Code:
(try_begin),
        (val_add,reg10,reg11),
        (gt,reg10,60),
        (jump_to_scene, "scn_sea_4"),
       (else_try),
        (val_add,reg10,reg11),
        (gt,reg10,30),
        (jump_to_scene, "scn_sea_2"),
       (else_try),
        (jump_to_scene, "scn_sea_1"),
       (end_try),
with this.
Code:
(try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (eq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (assign, "$g_mi_barco", "spr_mi_barco"),
                                (assign, "$g_barco2", "spr_barco_caravana"),
                                (jump_to_scene, "scn_sea_1"),
                            (try_end),

                            (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_outlaws"),
                                (assign, "$g_mi_barco", "spr_mi_barco"),
                                (assign, "$g_barco2", "spr_barco_pirata"),
                                (jump_to_scene, "scn_sea_2"),
                            (try_end),
                            (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_kingdom_1"),
                                (assign, "$g_mi_barco", "spr_fragata_2"),
                                (assign, "$g_barco2", "spr_fragata1"),
                                (jump_to_scene, "scn_sea_4"),
                            (try_end),
                            (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_kingdom_2"),
                                (assign, "$g_mi_barco", "spr_fragata1"),
                                (assign, "$g_barco2", "spr_fragata2"),
                                (jump_to_scene, "scn_sea_4"),
                             (try_end),
                             (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_kingdom_3"),
                                (assign, "$g_barco2", "spr_fragata3"),#Mapuches
                                (assign, "$g_mi_barco", "spr_fragata_2"),
                                (jump_to_scene, "scn_sea_4"),
                             (try_end),
                             (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_kingdom_4"),
                                (assign, "$g_mi_barco", "spr_fragata_2"),
                                (assign, "$g_barco2", "spr_fragata4"),
                                (jump_to_scene, "scn_sea_4"),
                             (try_end),
                             (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_kingdom_5"),
                                (assign, "$g_mi_barco", "spr_fragata_2"),
                                (assign, "$g_barco2", "spr_fragata5"),
                                (jump_to_scene, "scn_sea_4"),
                             (try_end),
                             (try_begin),
                                (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
                                (neq, ":encountered_party_template", "pt_kingdom_caravan_party"),
                                (eq, "$g_encountered_party_faction", "fac_kingdom_6"),
                                (assign, "$g_mi_barco", "spr_fragata_2"),
                                (assign, "$g_barco2", "spr_fragata6"),
                                (jump_to_scene, "scn_sea_4"),
                             (try_end),

Thus, you can assign to the battle the ship you want and the scenes you want, depending on who you face, either with any of the armies of a faction, with pirates or with caravans.
 
Upvote 0
Solution
Back
Top Bottom