Search results for query: *

  1. Is it possible to add or remove trigger(s) for different scenes?

    Hello there, Forgive me if this has already been asked, example; Game is in Team Deathmatch, Scene 1 is selected = load trigger "triggers_for_scene_1", Scene 2 is selected = load trigger "triggers_for_scene_2", The Triggers each use try for Players and Agents, so I am trying to avoid...
  2. OSP MP Troops Retreat / Pseudo Skirmish

    Hello all, my 1st released OSP, but it won't let me post it in OSP section though (insufficient privileges), hope someone can make use of it, if it sounds right for your mod. Here are codes for making your Multiplayer AI Troops Retreat from the battlefield and to Stand Ground (cancels...
  3. Integrating Native Presentations into Napoleonic Wars

    Premature Posted above.

    Added below into Presentations, by following above link, AI Page 1 and 2 both can call the multiplayer_ai_select, search for troop_select_type_artillery

    Code:
            (else_try),
              (eq,":object","$g_presentation_obj_select_artillery"),# also does Sappers, Surgeon, Marines and Field Marshall
              (assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_artillery),
              (presentation_set_duration, 0),
              (start_presentation,"prsnt_multiplayer_item_select"),
              #Regiment Select
    ########################### FC added for new Troop Select - Select Player's Troop page
            (else_try),
              (eq,":object","$g_presentation_obj_select_bydanders"),
              (assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_bydanders),
              (presentation_set_duration, 0),
              (start_presentation,"prsnt_multiplayer_item_select"),
    ########################### FC added -------------    Select Bots Wanted 1 page
            (else_try),
              (eq,":object","$g_presentation_obj_select_ai_page_1"),
              (assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_bots1),
              (presentation_set_duration, 0),
              (start_presentation,"prsnt_multiplayer_ai_select"),
              # (start_presentation,"prsnt_multiplayer_item_select"),
    ########################### FC added -------------    Select Bots Wanted 2 page
            (else_try),
              (eq,":object","$g_presentation_obj_select_ai_page_2"),
              (assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_bots2),
              (presentation_set_duration, 0),
              # (start_presentation,"prsnt_multiplayer_item_select"),
              (start_presentation,"prsnt_multiplayer_ai_select"),
    ############################################# FC added for new Troop Select - END
            (else_try),#
              (assign,":continue",0),
              (player_get_team_no, ":my_team_no", ":my_player_no"),
              (team_get_faction, ":my_faction_no", ":my_team_no"),
              (assign, ":selected_troop_no", -1),
              (assign, ":end_cond", multi_data_troop_button_indices_end),
              (try_for_range, ":i_button", multi_data_troop_button_indices_begin, ":end_cond"),

    Taken from Native multiplayer_item_select, renamed to multiplayer_ai_select (Napo Wars already has own multiplayer_item_select), called by above's New Buttons, and commented out else_try block containing npc_kingdoms_begin


    Code:
      ("multiplayer_ai_select", prsntf_manual_end_only, 0, [
        (ti_on_presentation_load,
         [(set_fixed_point_multiplier, 1000),
          (multiplayer_get_my_player, ":my_player_no"),
    
          (assign, "$g_presentation_obj_item_select_1", -1),# item 1
          (assign, "$g_presentation_obj_item_select_2", -1),# item 2
          (assign, "$g_presentation_obj_item_select_3", -1),# item 3
          (assign, "$g_presentation_obj_item_select_4", -1),# item 4
          (assign, "$g_presentation_obj_item_select_5", -1),# gloves
          (assign, "$g_presentation_obj_item_select_6", -1),# hat
          (assign, "$g_presentation_obj_item_select_7", -1),# armor
          (assign, "$g_presentation_obj_item_select_8", -1),# boots
          (assign, "$g_presentation_obj_item_select_9", -1),# horse
          (assign, "$g_presentation_obj_item_select_10", -1),# reset equipment
          (assign, "$g_presentation_obj_item_select_11", -1),# done
          (assign, "$g_presentation_obj_item_select_12", -1),# Back / Cancel ? Money thing ?
          (assign, "$g_presentation_obj_item_select_13", -1),# bot 1
          (assign, "$g_presentation_obj_item_select_14", -1),# bot 2
          (assign, "$g_presentation_obj_item_select_15", -1),# bot 3
          (assign, "$g_presentation_obj_item_select_16", -1),# bot 4
          
          (try_begin),
            (neq, "$g_current_opened_item_details", -1),
            (close_item_details),
            (assign, "$g_current_opened_item_details", -1),
          (try_end),
    
          (store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 0),
          (player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
          (try_begin),
            (ge, ":selected_item_id", 0),
            (create_image_button_overlay, "$g_presentation_obj_item_select_1", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),

    Thanks again for your time advising on this
  4. Integrating Native Presentations into Napoleonic Wars

    Hello there sorry for late reply and injuries though Direct X7 pitcures,

    The main problem is spawning and then controling the AI bots, I think all codes related (Templates/Scripts/Presentation) to slot_player_bot_type_wanted used by Napo Wars rather than Native's slot_player_bot_type_1_wanted or lack of is causing the problem.

    f8mI3.png
    TIaSa.png
    HDpKN.png
    zWm0O.png
    4OMM4.png
    gn2vG.png
  5. Integrating Native Presentations into Napoleonic Wars

    Hello all, I am trying to integrate Native's Battle Mode screen (the part where you select your Player's Armours, Items and Troops wanted to command) into Napoleonic Wars, either into Battle or Commander Battle Mode (I am currently using edited / custom Native Battle mission template imported...
  6. Client Unable to Execute Code, pre O.S.P

    Hi all, This is concerning Lan matches in Battle Mode, I believe it is possible over dedicated servers if wanted but would need code change. In Lan Multiplayer, the bots' Non Default Groups can be given orders, by the Server and Clients. Default Groups - 1,2,3 (Infantry, Archers, Cavalry)...
  7. Setting a MP Team Leader

    Look at the original Native code.
    Will do, few attempts ago was calling scripts script_multiplayer_change_leader_of_bot and script_multiplayer_find_player_leader_for_bot but no result, will look into that again, thanks again there.
  8. Setting a MP Team Leader

    So this only works on dedicated servers and fail at the clients
    Thanks for clearing that I had no idea.

    What you basically want is that the bots follow the player even without having to tick any of the boxes at the equipment selection, yes?
    Yes exactly like you just said. Reason is other player (non hosting) cannot key spawn troops into scene (got the "Highlight Selection" problem sorted will post to OSP once got other problems worked out)

    Take a look at the lines which assign the checked bots to the player
    sorry Eärendil do you mean look at my own code or look at original source code? Thanks for your time there.
  9. Setting a MP Team Leader

    Hello again, I remember when LAN closing down was a problem over 2 year back, it has been working again / re-active since late 2020, tested it out few days ago - no problems hosting or joining LAN what so ever - that is why after setting leader by key press. Only problem here is my code chief.
    As for them lines;
    (this_or_next|multiplayer_is_server),
    (neg|game_in_multiplayer_mode),

    I copy pasted straight out off the native MP source codes, they seam to be pretty frequent, to my noob eyes its looks like neg|game_in_MP means "no, not in multiplayer mode you won't do this" but it is in a lot of the MP source code.
  10. Setting a MP Team Leader

    Hello there, I want to make a non/hosting player the team leader of their team ideally by keypress, only for LAN (example, start a LAN battle with bots, NOT tick / checkbox select any to control, Press a key = all bots on your team come under control, same for 2nd player on other team). My...
  11. Add More Controllable Multiplayer Unit Groups ?

    module scripts 3 of 3
    Code:
    # ### Fatcat group 3 of 8 sort out...
      # script_group3_listen
      # Input: Order Type   
      # Output: Nothing
      #
      ("group3_listen", [
          (store_script_param_1, ":agent_id"),
          (store_script_param_2, ":playerteam"),
    
          (try_begin),
    
            (key_clicked, key_numpad_2),### Follow Me , 2
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_follow),#
            (str_store_string, s1, "@Foot 4 Moving to follow Major"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_3),### Charge , 3
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_charge),#
            (team_give_order, ":playerteam", 3, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Foot 4 Charge"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_up),### Forwards , 4
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_advance),#
            (str_store_string, s1, "@Foot 4 Advance 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_down),### Backwards , 5
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_fall_back),#
            (str_store_string, s1, "@Foot 4 Retreating 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_4),### Fire at Will , 6
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_fire_at_will),#
            (str_store_string, s1, "@Foot 4 Fire at Will"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_5),### Command Fire , 7
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_fire_at_my_command),#
            (str_store_string, s1, "@Foot 4 Command Fire"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_6),### Fire Volley , 8
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_all_fire_now),#
            (str_store_string, s1, "@Foot 4 Fire Volley"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_0),### Ready Steel, 9
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Foot 4 Ready Steel"),
            (display_message, "@{s1}"),
         (else_try),
            (key_clicked, key_numpad_period),### Ready Muskets, 10
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_use_ranged_weapons),#
            (str_store_string, s1, "@Foot 4 Ready Muskets"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_slash),###  Mount Horses, 11
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_mount),#
            (str_store_string, s1, "@Foot 4 Mount Horses"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_multiply),###  Dismount, 12
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_dismount),#
            (str_store_string, s1, "@Foot 4 Dismount"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_7),### Form 2 Row , 13
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_form_2_row),#
            (str_store_string, s1, "@Foot 4 Form 2 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_8),### Form 3 Row , 14
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_form_3_row),#
            (str_store_string, s1, "@Foot 4 Form 3 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_9),### Form 5 Row , 15
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_form_5_row),#
            (str_store_string, s1, "@Foot 4 Form 5 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_left),### Formation Tighten , 16
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_stand_closer),#
            (str_store_string, s1, "@Foot 4 Formation Tighten"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_right),### Formation Spread , 17
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 3),#
            (team_give_order, ":playerteam", 3, mordr_spread_out),#
            (str_store_string, s1, "@Foot 4 Formation Spread"),
            (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_right_control),### Navy Load Up ,key_right_alt
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 3),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 3),
                    (agent_set_animation, ":trooper", "anim_kneeling"),#
              (try_end),
                (str_store_string, s1, "@Foot 4 ready for Vessal Travel!"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_right_alt),### Navy Clear For Out ,  key_right_control
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 3),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 3),
                    (agent_set_animation, ":trooper", "anim_surrender_end"),#
              (try_end),
                (str_store_string, s1, "@Foot 4 ready for Unboarding Vessal, unsurrender"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_p),### Navy Clear For Out
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 3),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 3),
                    (agent_set_animation, ":trooper", "anim_surrender"),#
    ###                (agent_set_animation, ":trooper", "anim_surrender_end", 0),#
              (try_end),
                (str_store_string, s1, "@Foot 4 Surrenders, show mercy"),
                (display_message, "@{s1}"),
    
        (try_end),
      ]),
    
    
    
      # script_group4_listen
      ("group4_listen", [
          (store_script_param_1, ":agent_id"),
          (store_script_param_2, ":playerteam"),
          (try_begin),
            (key_clicked, key_numpad_2),### Follow Me , 2
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_follow),#
            (str_store_string, s1, "@Specials 5 Moving to follow Major"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_3),### Charge , 3
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_charge),#
            (team_give_order, ":playerteam", 4, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Specials 5 Charge"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_up),### Forwards , 4
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_advance),#
            (str_store_string, s1, "@Specials 5 Advance 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_down),### Backwards , 5
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_fall_back),#
            (str_store_string, s1, "@Specials 5 Retreating 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_4),### Fire at Will , 6
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_fire_at_will),#
            (str_store_string, s1, "@Specials 5 Fire at Will"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_5),### Command Fire , 7
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_fire_at_my_command),#
            (str_store_string, s1, "@Specials 5 Command Fire"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_6),### Fire Volley , 8
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_all_fire_now),#
            (str_store_string, s1, "@Specials 5 Fire Volley"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_0),### Ready Steel, 9
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Specials 5 Ready Steel"),
            (display_message, "@{s1}"),
         (else_try),
            (key_clicked, key_numpad_period),### Ready Muskets, 10
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_use_ranged_weapons),#
            (str_store_string, s1, "@Specials 5 Ready Muskets"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_slash),###  Mount Horses, 11
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_mount),#
            (str_store_string, s1, "@Specials 5 Mount Horses"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_multiply),###  Dismount, 12
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_dismount),#
            (str_store_string, s1, "@Specials 5 Dismount"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_7),### Form 2 Row , 13
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_form_2_row),#
            (str_store_string, s1, "@Specials 5 Form 2 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_8),### Form 3 Row , 14
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_form_3_row),#
            (str_store_string, s1, "@Specials 5 Form 3 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_9),### Form 5 Row , 15
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_form_5_row),#
            (str_store_string, s1, "@Specials 5 Form 5 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_left),### Formation Tighten , 16
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_stand_closer),#
            (str_store_string, s1, "@Specials 5 Formation Tighten"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_right),### Formation Spread , 17
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 4),#
            (team_give_order, ":playerteam", 4, mordr_spread_out),#
            (str_store_string, s1, "@Specials 5 Formation Spread"),
            (display_message, "@{s1}"),
    
    
          (else_try),
            (key_clicked, key_right_control),### Navy Load Up ,key_right_alt
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 4),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 4),
                    (agent_set_animation, ":trooper", "anim_kneeling"),#
              (try_end),
                (str_store_string, s1, "@Specials 5 ready for Vessal Travel!"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_right_alt),### Navy Clear For Out ,  key_right_control
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 4),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 4),
                    (agent_set_animation, ":trooper", "anim_surrender_end"),#
              (try_end),
                (str_store_string, s1, "@Specials 5 ready for Unboarding Vessal, unsurrender"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_p),### Navy Clear For Out
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 4),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 4),
                    (agent_set_animation, ":trooper", "anim_surrender"),#
    ###                (agent_set_animation, ":trooper", "anim_surrender_end", 0),#
              (try_end),
                (str_store_string, s1, "@Specials 5 Surrenders, show mercy"),
                (display_message, "@{s1}"),
    
          (try_end),
      ]),
    
      # script_group5_listen
      ("group5_listen", [
          (store_script_param_1, ":agent_id"),
          (store_script_param_2, ":playerteam"),
          (try_begin),
            # (key_clicked, key_numpad_1),### Move Here ,
            # (agent_get_team, ":playerteam", ":agent_id"),#
            # (troop_get_class, ":playerteam", 5),#
            # (team_give_order, ":playerteam", 5, mordr_hold),#
            # (str_store_string, s1, "@Cavalry 6 Moving to Major's Position"),
            # (display_message, "@{s1}"),
          # (else_try),
            (key_clicked, key_numpad_2),### Follow Me , 2
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_follow),#
            (str_store_string, s1, "@Cavalry 6 Moving to follow Major"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_3),### Charge , 3
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_charge),#
            (team_give_order, ":playerteam", 5, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Cavalry 6 Charge"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_up),### Forwards , 4
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_advance),#
            (str_store_string, s1, "@Cavalry 6 Advance 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_down),### Backwards , 5
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_fall_back),#
            (str_store_string, s1, "@Cavalry 6 Retreating 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_4),### Fire at Will , 6
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_fire_at_will),#
            (str_store_string, s1, "@Cavalry 6 Fire at Will"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_5),### Command Fire , 7
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_fire_at_my_command),#
            (str_store_string, s1, "@Cavalry 6 Command Fire"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_6),### Fire Volley , 8
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_all_fire_now),#
            (str_store_string, s1, "@Cavalry 6 Fire Volley"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_0),### Ready Steel, 9
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Cavalry 6 Ready Steel"),
            (display_message, "@{s1}"),
         (else_try),
            (key_clicked, key_numpad_period),### Ready Muskets, 10
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_use_ranged_weapons),#
            (str_store_string, s1, "@Cavalry 6 Ready Muskets"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_slash),###  Mount Horses, 11
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_mount),#
            (str_store_string, s1, "@Cavalry 6 Mount Horses"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_multiply),###  Dismount, 12
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_dismount),#
            (str_store_string, s1, "@Cavalry 6 Dismount"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_7),### Form 2 Row , 13
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_form_2_row),#
            (str_store_string, s1, "@Cavalry 6 Form 2 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_8),### Form 3 Row , 14
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_form_3_row),#
            (str_store_string, s1, "@Cavalry 6 Form 3 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_9),### Form 5 Row , 15
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_form_5_row),#
            (str_store_string, s1, "@Cavalry 6 Form 5 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_left),### Formation Tighten , 16
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_stand_closer),#
            (str_store_string, s1, "@Cavalry 6 Formation Tighten"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_right),### Formation Spread , 17
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_spread_out),#
            (str_store_string, s1, "@Cavalry 6 Formation Spread"),
            (display_message, "@{s1}"),
          (else_try),
    
            (key_clicked, key_right_control),### Navy Load Up ,key_right_alt
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 5),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 5),
                    (agent_set_animation, ":trooper", "anim_kneeling"),#
              (try_end),
                (str_store_string, s1, "@Cavalry 6 ready for Vessal Travel!"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_right_alt),### Navy Clear For Out ,  key_right_control
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 5),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 5),
                    (agent_set_animation, ":trooper", "anim_surrender_end"),#
              (try_end),
                (str_store_string, s1, "@Cavalry 6 ready for Unboarding Vessal, unsurrender"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_p),### Navy Clear For Out
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 5),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 5),
                    (agent_set_animation, ":trooper", "anim_surrender"),#
    ###                (agent_set_animation, ":trooper", "anim_surrender_end", 0),#
              (try_end),
                (str_store_string, s1, "@Cavalry 6 Surrenders, show mercy"),
                (display_message, "@{s1}"),
    
        (try_end),
      ]),
    
      # script_group6_listen
      ("group6_listen", [
          (store_script_param_1, ":agent_id"),
          (store_script_param_2, ":playerteam"),
          (try_begin),
            # (key_clicked, key_numpad_1),### Move Here ,
            # (agent_get_team, ":playerteam", ":agent_id"),#
            # (troop_get_class, ":playerteam", 6),#
            # (team_give_order, ":playerteam", 6, mordr_hold),#
            # (str_store_string, s1, "@Artillery 7 Moving to Major's Position"),
            # (display_message, "@{s1}"),
          # (else_try),
            (key_clicked, key_numpad_2),### Follow Me , 2
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_follow),#
            (str_store_string, s1, "@Artillery 7 Moving to follow Major"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_3),### Charge , 3
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_charge),#
            (team_give_order, ":playerteam", 6, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Artillery 7 Charge"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_up),### Forwards , 4
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_advance),#
            (str_store_string, s1, "@Artillery 7 Advance 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_down),### Backwards , 5
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_fall_back),#
            (str_store_string, s1, "@Artillery 7 Retreating 10 paces"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_4),### Fire at Will , 6
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_fire_at_will),#
            (str_store_string, s1, "@Artillery 7 Fire at Will"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_5),### Command Fire , 7
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_fire_at_my_command),#
            (str_store_string, s1, "@Artillery 7 Command Fire"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_6),### Fire Volley , 8
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_all_fire_now),#
            (str_store_string, s1, "@Artillery 7 Fire Volley"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_0),### Ready Steel, 9
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_use_melee_weapons),#
            (str_store_string, s1, "@Artillery 7 Ready Steel"),
            (display_message, "@{s1}"),
         (else_try),
            (key_clicked, key_numpad_period),### Ready Muskets, 10
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_use_ranged_weapons),#
            (str_store_string, s1, "@Artillery 7 Ready Muskets"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_slash),###  Mount Horses, 11
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_mount),#
            (str_store_string, s1, "@Artillery 7 Mount Horses"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_multiply),###  Dismount, 12
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_dismount),#
            (str_store_string, s1, "@Artillery 7 Dismount"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_7),### Form 2 Row , 13
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_form_2_row),#
            (str_store_string, s1, "@Artillery 7 Form 2 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_8),### Form 3 Row , 14
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_form_3_row),#
            (str_store_string, s1, "@Artillery 7 Form 3 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_numpad_9),### Form 5 Row , 15
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_form_5_row),#
            (str_store_string, s1, "@Artillery 7 Form 5 Row"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_left),### Formation Tighten , 16
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_stand_closer),#
            (str_store_string, s1, "@Artillery 7 Formation Tighten"),
            (display_message, "@{s1}"),
          (else_try),
            (key_clicked, key_right),### Formation Spread , 17
            (agent_get_team, ":playerteam", ":agent_id"),#
            (troop_get_class, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_spread_out),#
            (str_store_string, s1, "@Artillery 7 Formation Spread"),
            (display_message, "@{s1}"),
          (else_try),
    
            (key_clicked, key_right_control),### Navy Load Up ,key_right_alt
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 6),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 6),
                    (agent_set_animation, ":trooper", "anim_kneeling"),#
              (try_end),
                (str_store_string, s1, "@Artillery 7 ready for Vessal Travel!"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_right_alt),### Navy Clear For Out ,  key_right_control
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 6),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 6),
                    (agent_set_animation, ":trooper", "anim_surrender_end"),#
              (try_end),
                (str_store_string, s1, "@Artillery 7 ready for Unboarding Vessal, unsurrender"),
                (display_message, "@{s1}"),
    
          (else_try),
            (key_clicked, key_p),### Navy Clear For Out
            (get_player_agent_no, ":agent_id"),
            (agent_get_team, ":playerteam", ":agent_id"),
            (troop_get_class, ":playerteam", 6),#
              (try_for_agents, ":trooper"),
                (agent_is_alive, ":trooper"),
                (agent_is_human, ":trooper"),
                (agent_is_non_player, ":trooper"),
                (agent_get_team, ":team", ":trooper"),
                (eq, ":team", ":playerteam"), #On Player's side?
                (agent_get_division, ":class", ":trooper"),### was ":class" now 3
                    (eq, ":class", 6),
                    (agent_set_animation, ":trooper", "anim_surrender"),#
    ###                (agent_set_animation, ":trooper", "anim_surrender_end", 0),#
              (try_end),
                (str_store_string, s1, "@Artillery 7 Surrenders, show mercy"),
                (display_message, "@{s1}"),
        (try_end),
      ]),
  12. Add More Controllable Multiplayer Unit Groups ?

    Module Scripts, 1 and 2 of 3
    Code:
      # script_majors_divisions_test_4_team1
      ("majors_divisions_test_4_team1", [
            (add_visitors_to_current_scene, 0, "trp_british_ship_marine_ai_3", 20, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_ship_ai", 50, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_ship_captain", 20, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_ship_cannon", 20, 0),###
            (troop_set_class, "trp_british_ship_marine_ai_3", 3),# Group 3 Archers
            (troop_set_class, "trp_british_ship_ai", 4),# Group 3 Archers
            (troop_set_class, "trp_british_ship_captain", 5),# Group 3 Archers
            (troop_set_class, "trp_british_ship_cannon", 6),# Group 3 Archers
            (str_store_string, s1, "@British Navl Crew Ready"),
            (display_message, "@{s1}"),
        ]),
    
    
      # script_majors_divisions_1_spawn_britain_team1, Original code by fatcat
      # Input: Order Type   
      # Output: Nothing
      #
      ("majors_divisions_1_spawn_britain_team1", [
            (add_visitors_to_current_scene, 0, "trp_british_infantry_ai", 37, 0),###(add_visitors_to_current_scene, 32, ":troop_of_spear", 25, 1, grc_spear / 4 / 1),### grc_spear/4/1 invalid,  -15/-3 invalid, -1 non selectable, 0 is DEF INF like NONE / NA
            (add_visitors_to_current_scene, 0, "trp_british_infantry_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry_flute", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_ai", 37, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_flute", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_ai", 37, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_flute", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_light_infantry_ai", 37, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_light_infantry_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_light_infantry_officer", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_light_infantry_horn", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_ai", 37, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_highlander_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_pipes", 1, 0),#
            # (add_visitors_to_current_scene, 0, "trp_british_rifle_ai", 14, 0),###
            # (add_visitors_to_current_scene, 0, "trp_british_hussar_ai", 20, 0),###
            # (add_visitors_to_current_scene, 0, "trp_british_light_dragoon_ai", 20, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_dragoon_ai", 34, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_ai", 12, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_commander", 2, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_alt_commander", 2, 0),###
            (troop_set_class, "trp_british_infantry_ai", 0),# # (troop_set_class, <troop_id>, <value>),### Fatcat - 0 =inf/grp 1, 1 =arc/grp 2, 2 =cav/grp 3, 3 - 8 = others groups 4 - 9
            (troop_set_class, "trp_british_infantry_nco", 0),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry_drum", 0),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry_flute", 0),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry2_ai", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_infantry2_nco", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_infantry2_drum", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_infantry2_flute", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_foot_guard_ai", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_foot_guard_nco", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_foot_guard_drum", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_foot_guard_flute", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_light_infantry_ai", 4),# Group 5 OTHER
            (troop_set_class, "trp_british_light_infantry_nco", 4),# Group 5 OTHER
            (troop_set_class, "trp_british_light_infantry_officer", 4),# Group 5 OTHER
            (troop_set_class, "trp_british_light_infantry_horn", 4),# Group 5 OTHER
            (troop_set_class, "trp_british_highlander_ai", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_nco", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_drum", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_pipes", 2),# Group 3 Archers
            # (troop_set_class, "trp_british_rifle_ai", 4),# Group 5 OTHER
            # (troop_set_class, "trp_british_hussar_ai", 5),# Group 6 OTHER
            # (troop_set_class, "trp_british_light_dragoon_ai", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_dragoon_ai", 5),# Group 6 OTHER
            (troop_set_class, "trp_british_arty_ai", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_arty_commander", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_arty_alt_commander", 6),# Group 7 OTHER
            (str_store_string, s1, "@British Major's Heavy Infantry Division Ready, All Companies Ready"),
            (display_message, "@{s1}"),
        ]),
    
    # script_majors_divisions_2_spawn_britain_team1
      ("majors_divisions_2_spawn_britain_team1", [
            (add_visitors_to_current_scene, 0, "trp_british_infantry_ai", 37, 0),###(add_visitors_to_current_scene, 32, ":troop_of_spear", 25, 1, grc_spear / 4 / 1),### grc_spear/4/1 invalid,  -15/-3 invalid, -1 non selectable, 0 is DEF INF like NONE / NA
            (add_visitors_to_current_scene, 0, "trp_british_infantry_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry_flute", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_ai", 37, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_flute", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_ai", 37, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_foot_guard_flute", 1, 0),#
            # (add_visitors_to_current_scene, 0, "trp_british_light_infantry_ai", 37, 0),#
            # (add_visitors_to_current_scene, 0, "trp_british_light_infantry_nco", 1, 0),#
            # (add_visitors_to_current_scene, 0, "trp_british_light_infantry_officer", 1, 0),#
            # (add_visitors_to_current_scene, 0, "trp_british_light_infantry_horn", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_ai", 37, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_highlander_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_pipes", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_rifle_ai95", 14, 0),###
            # (add_visitors_to_current_scene, 0, "trp_british_hussar_ai", 20, 0),###
            # (add_visitors_to_current_scene, 0, "trp_british_light_dragoon_ai", 20, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_dragoon_ai", 60, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_ai", 12, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_commander", 2, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_alt_commander", 2, 0),###
            (troop_set_class, "trp_british_infantry_ai", 0),# # (troop_set_class, <troop_id>, <value>),### Fatcat - 0 =inf/grp 1, 1 =arc/grp 2, 2 =cav/grp 3, 3 - 8 = others groups 4 - 9
            (troop_set_class, "trp_british_infantry_nco", 0),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry_drum", 0),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry_flute", 0),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry2_ai", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_infantry2_nco", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_infantry2_drum", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_infantry2_flute", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_foot_guard_ai", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_foot_guard_nco", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_foot_guard_drum", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_foot_guard_flute", 3),# Group 4 OTHER
            # (troop_set_class, "trp_british_light_infantry_ai", 4),# Group 5 OTHER
            # (troop_set_class, "trp_british_light_infantry_nco", 4),# Group 5 OTHER
            # (troop_set_class, "trp_british_light_infantry_officer", 4),# Group 5 OTHER
            # (troop_set_class, "trp_british_light_infantry_horn", 4),# Group 5 OTHER
            (troop_set_class, "trp_british_highlander_ai", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_nco", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_drum", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_pipes", 2),# Group 3 Archers
            (troop_set_class, "trp_british_rifle_ai95", 4),# Group 5 OTHER
            # (troop_set_class, "trp_british_hussar_ai", 5),# Group 6 OTHER
            # (troop_set_class, "trp_british_light_dragoon_ai", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_dragoon_ai", 5),# Group 6 OTHER
            (troop_set_class, "trp_british_arty_ai", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_arty_commander", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_arty_alt_commander", 6),# Group 7 OTHER
            (str_store_string, s1, "@British Major's Combined Division Ready, All Companies Ready"),
            (display_message, "@{s1}"),
        ]),
    
      # script_majors_divisions_3_spawn_britain_team1, Original code by fatcat
      # Input: Order Type   
      # Output: Nothing
      #
      ("majors_divisions_3_spawn_britain_team1", [
            (add_visitors_to_current_scene, 0, "trp_british_infantry_ai", 20, 0),###(add_visitors_to_current_scene, 32, ":troop_of_spear", 25, 1, grc_spear / 4 / 1),### grc_spear/4/1 invalid,  -15/-3 invalid, -1 non selectable, 0 is DEF INF like NONE / NA
            (add_visitors_to_current_scene, 0, "trp_british_infantry_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry_flute", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_infantry2_ai", 20, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_ship_marine_ai", 70, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_ship_marine_ai_2", 70, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_highlander_ai", 20, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_highlander_nco", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_drum", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_highlander_pipes", 1, 0),#
            (add_visitors_to_current_scene, 0, "trp_british_dragoon_ai", 34, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_ai", 12, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_commander", 2, 0),###
            (add_visitors_to_current_scene, 0, "trp_british_arty_alt_commander", 2, 0),###
            (troop_set_class, "trp_british_infantry_ai", 0),# # (troop_set_class, <troop_id>, <value>),### Fatcat - 0 =inf/grp 1, 1 =arc/grp 2, 2 =cav/grp 3, 3 - 8 = others groups 4 - 9
            (troop_set_class, "trp_british_infantry_nco", 3),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry_drum", 3),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry_flute", 3),# Group 1 Cavalry
            (troop_set_class, "trp_british_infantry2_ai", 1),# Group 2 Infantry
            (troop_set_class, "trp_british_ship_marine_ai", 3),# Group 4 OTHER
            (troop_set_class, "trp_british_ship_marine_ai_2", 4),# Group 5 OTHER
            (troop_set_class, "trp_british_highlander_ai", 2),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_nco", 4),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_drum", 4),# Group 3 Archers
            (troop_set_class, "trp_british_highlander_pipes", 4),# Group 3 Archers
            (troop_set_class, "trp_british_dragoon_ai", 5),# Group 6 OTHER
            (troop_set_class, "trp_british_arty_ai", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_arty_commander", 6),# Group 7 OTHER
            (troop_set_class, "trp_british_arty_alt_commander", 6),# Group 7 OTHER
            (str_store_string, s1, "@British Major's Shock Division Ready, All Companies Ready"),
            (display_message, "@{s1}"),
        ]),
    
    
    
    
    # script_majors_divisions_1_spawn_france_team2
      ("majors_divisions_1_spawn_france_team2", [
            (add_visitors_to_current_scene, 32, "trp_french_infantry_ai", 37, 1),###(add_visitors_to_current_scene, 32, ":troop_of_spear", 25, 1, grc_spear / 4 / 1),### grc_spear/4/1 invalid,  -15/-3 invalid, -1 non selectable, 0 is DEF INF like NONE / NA
            (add_visitors_to_current_scene, 32, "trp_french_infantry_nco", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry_drum", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry_flute", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry2_ai", 37, 1),###(add_visitors_to_current_scene, 32, ":troop_of_spear", 25, 1, grc_spear / 4 / 1),### grc_spear/4/1 invalid,  -15/-3 invalid, -1 non selectable, 0 is DEF INF like NONE / NA
            (add_visitors_to_current_scene, 32, "trp_french_infantry2_nco", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry2_drum", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry2_flute", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry_vistula_ai", 37, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry_vistula_colours", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry_vistula_drum", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_infantry_vistula_flute", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_old_guard_ai", 37, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_old_guard_nco", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_old_guard_drum", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_old_guard_flute", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_voltigeur_ai", 37, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_voltigeur_officer", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_voltigeur_colours", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_voltigeur_horn", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_grenadier_a_cheval_ai", 34, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_arty_ai", 12, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_arty_commander", 2, 1),#
            (add_visitors_to_current_scene, 32, "trp_french_arty_alt_commander", 2, 1),#
            (troop_set_class, "trp_french_infantry_ai", 0),# # (troop_set_class, <troop_id>, <value>),### Fatcat - 0 =inf/grp 1, 1 =arc/grp 2, 2 =cav/grp 3, 4 = others
            (troop_set_class, "trp_french_infantry_nco", 0),# Group
            (troop_set_class, "trp_french_infantry_drum", 0),# Group
            (troop_set_class, "trp_french_infantry_flute", 0),# Group
            (troop_set_class, "trp_french_infantry2_ai", 1),# #
            (troop_set_class, "trp_french_infantry2_nco", 1),# Group
            (troop_set_class, "trp_french_infantry2_drum", 1),# Group
            (troop_set_class, "trp_french_infantry2_flute", 1),# Group
            (troop_set_class, "trp_french_infantry_vistula_ai", 2),# Group
            (troop_set_class, "trp_french_infantry_vistula_colours", 2),#
            (troop_set_class, "trp_french_infantry_vistula_drum", 2),#
            (troop_set_class, "trp_french_infantry_vistula_flute", 2),#
            (troop_set_class, "trp_french_old_guard_ai", 3),# Group OTHER
            (troop_set_class, "trp_french_old_guard_nco", 3),# Group OTHER
            (troop_set_class, "trp_french_old_guard_drum", 3),# Group OTHER
            (troop_set_class, "trp_french_old_guard_flute", 3),# Group OTHER
            (troop_set_class, "trp_french_voltigeur_ai", 4),# Group OTHER
            (troop_set_class, "trp_french_voltigeur_officer", 4),# Group OTHER
            (troop_set_class, "trp_french_voltigeur_colours", 4),# Group OTHER
            (troop_set_class, "trp_french_voltigeur_horn", 4),# Group OTHER
            (troop_set_class, "trp_french_grenadier_a_cheval_ai", 5),# Group 6 OTHER
            (troop_set_class, "trp_french_arty_ai", 6),# Group 7 OTHER
            (troop_set_class, "trp_french_arty_commander", 6),# Group 7 OTHER
            (troop_set_class, "trp_french_arty_alt_commander", 6),# Group 7 OTHER
            (str_store_string, s1, "@French Major's Heavy Infantry Division Ready, All Companies Ready"),
            (display_message, "@{s1}"),
        ]),
    
    ###command_cursor_minimod_begin### by dstemmer 2009 (scripts)
      # script_cf_shirt_pos1_along_y_axis_to_ground script_cf_shift_pos1_along_y_axis_to_ground
      # Input: max distance to shift before failing
      # Output: pos1 shifted to ground level along forward y-axis
      ("cf_shift_pos1_along_y_axis_to_ground",
        [
          (store_script_param, ":max_distance", 1),
          (assign, reg0, 1), #output value
          (assign, reg10, ":max_distance"),
          (assign, reg11, 0), #distance so far
          (get_scene_boundaries, pos10, pos11),
          (position_get_x, reg12, pos10),
          (position_get_y, reg13, pos10),
          (position_get_x, reg14, pos11),
          (position_get_y, reg15, pos11),
          (call_script, "script_shift_pos1_along_y_axis_to_ground_aux"),
          (eq, reg0, 1), #if max distance or scene boundaries were reached, fail
          (position_set_z_to_ground_level, pos1),
        ]),
        
      ("shift_pos1_along_y_axis_to_ground_aux",
        [
          (val_add, reg2, 100),
          (copy_position, pos2, pos1),
          (position_set_z_to_ground_level, pos2),
          (position_get_x, ":pos1_x", pos1),
          (position_get_y, ":pos1_y", pos1),
          (position_get_z, ":pos1_z", pos1),
          (position_get_z, ":ground_z", pos2),
          (try_begin),                           #IF:
            (this_or_next|ge, reg11, reg10),     #distance so far > max_distance OR
            (this_or_next|le, ":pos1_x", reg12), #pos1 x <= scene min x OR
            (this_or_next|le, ":pos1_y", reg13), #pos1 y <= scene min y OR
            (this_or_next|ge, ":pos1_x", reg14), #pos1 x >= scene max x OR
            (ge, ":pos1_y", reg15),              #pos1 y >= scene max y THEN
            (assign, reg0, -1),                  #the outer function fails
          (else_try),
            (lt, ":ground_z", ":pos1_z"),
            (position_move_y, pos1, 100),
            (call_script, "script_shift_pos1_along_y_axis_to_ground_aux"),
          (try_end),
        ]),
    ###command_cursor_minimod_end###
  13. Add More Controllable Multiplayer Unit Groups ?

    Hello there Veledentella, looking forward to trying your scenes if not aready visited them on a server.

    I've been looking at the codes for modes; Commander, Battle, TDM and their In-Game Tutorials code in both Warband and Napoleonic Wars for a nearly a year, I still do not understand any of it haha.

    Keep in mind that this control system will become completely redundant if code for Unselecting groups can be posted, in another code version I can "Highlight Select" and give orders to the non default groups, but it does not unselect the default or already selected groups.

    The code I believe could be improved on, by somebody who knows what their doing properly, I have basically been throwing muck and seen what's stuck.
    They are awful controls compared to the standard "Orders Menu", but it does prove that more than the 3 default groups can be controlled / ordered in multiplayer.

    Currently works best with Napoleonic Wars MP Commander Battle (at MP set up page put 0 bots in squad size, take a class without musicians, like Marines or Artillery).
    Filler for Napoleonic Wars lack of decent SP Custom Battle mode (AI just sit there), at least they now charge and shoot.

    The code below you can paste straight into your Napoleonic Wars mod sys, got a Warband version nearly ready but the "Tall Smoke Position Maker" for some reason does not work, they will move there but it is hard to guess where they going.
    Groups 3 - 7 in code, groups 8 and 9 can be activated easily by looking at code but I find 7 groups of 250 troops in total more than enough with this command system.

    The code below is sloppy not ready for OSP / Tutorial release (lots of commented out code), but is a Proof of Concept and want to throw it out there.
    I've copy pasted it into a new text doc before posting because it was a mess and needed cleaning up, should still work fine.
    Again, the biggest hurdle now is if can find a way of unselecting groups I will be able to give standard "Orders Menu" to the non default groups, I really do not like this way of control, but it is better than nothing.
    The "move to" code is not ideal compared to the standard "Move There"

    Move to explained at bottom,

    HOLD DOWN one or two of the Groups 3 - 7 and press;

    numpad 2 = Follow Me
    numpad 3 = Charge, group auto switches to melee

    numpad 4 = Fire at will
    numpad 5 = Fire on my Command
    numpad 6 = Fire (Volley)

    numpad 7 = 2 Row
    numpad 8 = 3 Row
    numpad 9 = 5 Row

    numpad 0 = Melee Weapons
    numpad period/decibel = Ranged Weapons
    numpad slash/divide = mount horses
    numpad star/times = dismount horses

    right control = Load them in a Ship first, press this, they stay in position unless hit. I would like Ship Cannon Code if its out there
    right alt = Press this to make them stand again or un surrender
    P = That unit will bravely Surrender

    The "move to"
    1. HOLD DOWN one of the non default Groups,
    2. HOLD DOWN mouse left click, rising smoke will apear as move to maker.
    3. Make sure to RELEASE the mouse click FIRST to move the group
    - Releasing the group button first cancels the move order, but the message will show

    Module_troops.py, this is for 2 extra marine groups, not needed if not wanted.
    Code:
      ["british_ship_marine_ai_2","British Marine","Marines",tf_guarantee_all,0,0,fac_commoners,
       [itm_british_royal_marine,itm_british_coldstream_pants,itm_royal_marine_hat,itm_royal_marine_hat,itm_royal_marine_hat,itm_royal_marine_hat,itm_royal_marine_beret,itm_british_brown_bess,itm_bullets],
       def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
    
      ["british_ship_marine_ai_3","British Marine","Marines",tf_guarantee_all,0,0,fac_commoners,
       [itm_british_royal_marine,itm_british_coldstream_pants,itm_royal_marine_hat,itm_royal_marine_hat,itm_royal_marine_hat,itm_royal_marine_hat,itm_royal_marine_beret,itm_british_brown_bess,itm_bullets],
       def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],


    module_mission_templates, I put them in after pilgrim discuise.

    Code:
    ###command_cursor_minimod_begin### by dstemmer 2009 (scripts), edited by highlander, re-edit by fatcat
    common_init_command_cursor = (
      ti_before_mission_start, 0, 0, [],
      [
        (assign, "$order_move_to_pos43_start", 0),#
          (assign, "$hold_key_1second",0),
      ])
    
    common_command_cursor_countdown = (
      0, 1, 0,
      [
        (try_begin),
    ###      (neg|game_key_is_down, gk_order_halt),
          (neg|key_is_down, key_left_mouse_button), ###key_numpad_1
            (assign, "$hold_key_1second",0),
        (try_end),
    ###    (game_key_is_down, gk_order_halt),
        (key_is_down, key_left_mouse_button),###key_numpad_1
      ],
      [
        (try_begin),
    ###      (game_key_is_down, gk_order_halt),
          (key_is_down, key_left_mouse_button),###key_numpad_1
            (assign, "$hold_key_1second",1),
        (try_end),
      ])
    
     
    common_command_cursor_key_pressed = (
      0.05, 0, 0,
        [
    ###      (game_key_is_down, gk_order_halt),
          (key_is_down, key_left_mouse_button),### key_numpad_1 key_left_control
          (eq, "$hold_key_1second",1),
          (get_player_agent_no, ":agent_id"),###was was player now agent_id
          (agent_get_look_position, pos1, ":agent_id"),###was was player now agent_id
          (position_move_z, pos1, 120),
          (try_begin),
            (call_script, "script_cf_shift_pos1_along_y_axis_to_ground", 30000),
            (assign, "$order_move_to_pos43_start", 1),
    ###        (particle_system_burst, "psys_fat_arrow", pos1, 1),
            (particle_system_burst, "psys_war_smoke_tall", pos1, 1),### psys_war_smoke_tall ### psys_fat_arrow   ### psys_movetoflag
    # (particle_system_burst,<par_sys_id>,<position_no>,[percentage_burst_strength]),
    # (create_mesh_overlay, <destination>, <mesh_id>), #returns overlay id
    # (overlay_get_position, <destination>, <overlay_id>),
            (copy_position, pos43, pos1),
          (else_try),
            (assign, "$order_move_to_pos43_start", 0),
          (try_end),
        ], []
    )
    
    common_order_move_to_pos43 = (
      0, 0, 0,
        [
          (eq, "$order_move_to_pos43_start", 1),
    ###      (neg|game_key_is_down, gk_order_halt),
          (neg|key_is_down, key_left_mouse_button),### key_numpad_1 key_left_control
          (assign, "$order_move_to_pos43_start", 0),
    ###      (particle_system_burst, "psys_fat_arrow_rising", pos43, 1),
          (particle_system_burst, "psys_war_smoke_tall", pos43, 1),### psys_war_smoke_tall ### psys_fat_arrow_rising
          (get_player_agent_no, ":agent_id"),###was was player now agent_id
          (agent_get_team, ":playerteam", ":agent_id"),###was was player_team now playerteam
          (set_show_messages, 0),
          (try_begin),
            # (class_is_listening_order, ":player_team", grc_infantry),
            # (class_is_listening_order, ":player_team", grc_archers),
            # (class_is_listening_order, ":player_team", grc_cavalry),
            # (team_give_order, ":player_team", grc_everyone, mordr_hold),
            # (team_set_order_position, ":player_team", grc_everyone, pos43),
            # (str_store_string, s1, "@Everyone"),
          # (else_try),
            # (class_is_listening_order, ":playerteam", 3),
            # (class_is_listening_order, ":playerteam", 4),
    # ###        (class_is_listening_order, ":player_team", 5),
    # ###        (class_is_listening_order, ":player_team", 6),
            # (team_give_order, ":playerteam", grc_everyone, mordr_hold),
            # (team_set_order_position, ":playerteam", grc_everyone, pos43),
            # (str_store_string, s1, "@Everyone"),
          # (else_try),
          (game_key_is_down, gk_group3_hear),### fatcat added test
            (troop_get_class, ":playerteam", 3),# fatcat added, this alowes unit selection and movement with out Highlight Selection.
    ####        (class_is_listening_order, ":playerteam", 3),# 
            (team_give_order, ":playerteam", 3, mordr_hold),
            (team_set_order_position, ":playerteam", 3, pos43),
            (str_store_string, s1, "@Group 4 Infantry"),
          (else_try),
          (game_key_is_down, gk_group4_hear),### fatcat added test
            (troop_get_class, ":playerteam", 4),# fatcat added,
    ####        (class_is_listening_order, ":playerteam", 4),# 
            (team_give_order, ":playerteam", 4, mordr_hold),
            (team_set_order_position, ":playerteam", 4, pos43),
            (str_store_string, s1, "@Group 5 Specials"),
          (else_try),
          (game_key_is_down, gk_group5_hear),### fatcat added test
            (troop_get_class, ":playerteam", 5),# fatcat added,
    ####        (class_is_listening_order, ":playerteam", 5),#
            (team_give_order, ":playerteam", 5, mordr_hold),
            (team_set_order_position, ":playerteam", 5, pos43),
            (str_store_string, s1, "@Group 6 Cavalry"),
          (else_try),
          (game_key_is_down, gk_group6_hear),### fatcat added test
            (troop_get_class, ":playerteam", 6),# fatcat added,
    ####        (class_is_listening_order, ":playerteam", 6),#
            (team_give_order, ":playerteam", 6, mordr_hold),
            (team_set_order_position, ":playerteam", 6, pos43),
            (str_store_string, s1, "@Group 7 Artillery"),
          # (else_try),
            # (class_is_listening_order, ":player_team", 7),
            # (team_give_order, ":player_team", 7, mordr_hold),
            # (team_set_order_position, ":player_team", 7, pos43),
            # (str_store_string, s1, "@Group 8"),
          # (else_try),
            # (class_is_listening_order, ":player_team", 8),
            # (team_give_order, ":player_team", 8, mordr_hold),
            # (team_set_order_position, ":player_team", 8, pos43),
            # (str_store_string, s1, "@Group 9"),
          # (else_try),
            # (team_give_order, ":player_team", grc_cavalry, mordr_hold),
            # (team_set_order_position, ":player_team", grc_cavalry, pos43),
            # (str_store_string, s1, "@Cavalry"),
    ############     fatcat arty aim at position code
          # (game_key_is_down, BOOMER),### fatcat added test
            # (troop_get_class, ":playerteam", 6),# fatcat added,
    # ####        (class_is_listening_order, ":playerteam", 6),# fatcat removed, unit must be Highlight Selected (under "Others") before moving.
            # (team_give_order, ":playerteam", 6, mordr_hold),
            # (team_set_order_position, ":playerteam", 6, pos43),
            # (str_store_string, s1, "@Group 7 Artillery ajusting aim to"),
    
        # (call_script,"BOOMER",":agent_id",":playerteam"),
          (try_end),
          (set_show_messages, 1),
          (display_message, "@{s1}, move over there!"),
        ], []
    )
    ###command_cursor_minimod_end### by dstemmer 2009 (scripts), edited by highlander ###############################
    
    
    
    
    
    ######################### Groups 4 - 9 (3-8 in code, Infantry, Archer, Cav group id is 0, 1, 2 by default but shown as group 1, 2, 3)
    
    
    # ### fatcat group 3 of 8 start... still awful controll tho
    multiplayer_more_units_group3_orders = (
      0, 0, 0, [],
      [
      (neg|multiplayer_is_dedicated_server), 
      (game_key_is_down, gk_group3_hear),
    ###    (game_key_clicked, gk_view_orders),
        (try_begin),
        (assign,":agent_id"),# 
        (get_player_agent_no,":agent_id"),# (get_player_agent_no,<destination>)### can be agent_id ||| FC added test
        (agent_is_active,":agent_id"),
        (agent_is_alive,":agent_id"),
        (agent_is_human, ":agent_id"),# FC added test
    ###    (agent_get_position, pos10, ":agent_id"),#
        # (get_trigger_object_position,<position_no>),
        (agent_get_team, ":playerteam", ":agent_id"),
    ###    (assign,":playerteam"),
    ###      (try_begin),
        (call_script,"script_group3_listen",":agent_id",":playerteam"),
        (try_end),
      ])
    
    multiplayer_more_units_group4_orders = (
      0, 0, 0, [],
      [
      (neg|multiplayer_is_dedicated_server), 
      (game_key_is_down, gk_group4_hear),
    ###  (neg|is_presentation_active, "prsnt_new_order_stuff"),
    ###  (start_presentation, "prsnt_new_order_stuff"),
        (try_begin),
        (assign,":agent_id"),#
        (get_player_agent_no,":agent_id"),
        (agent_is_active,":agent_id"),
        (agent_is_alive,":agent_id"),
        (agent_is_human, ":agent_id"),# FC added test
        (agent_get_team, ":playerteam", ":agent_id"),
    ###    (assign,":playerteam"),### FC added
        (call_script,"script_group4_listen",":agent_id",":playerteam"),
        (try_end),
      ])
    
    multiplayer_more_units_group5_orders = (
      0, 0, 0, [],
      [
      (neg|multiplayer_is_dedicated_server), 
      (game_key_is_down, gk_group5_hear),
        (try_begin),
        (assign,":agent_id"),
        (get_player_agent_no,":agent_id"),
        (agent_is_active,":agent_id"),
        (agent_is_alive,":agent_id"),
        (agent_is_human, ":agent_id"),# FC added test
        (agent_get_team, ":playerteam", ":agent_id"),
        (call_script,"script_group5_listen",":agent_id",":playerteam"),
        (try_end),
      ])
    
    multiplayer_more_units_group6_orders = (
      0, 0, 0, [],
      [
      (neg|multiplayer_is_dedicated_server), 
      (game_key_is_down, gk_group6_hear),
        (try_begin),
        (assign,":agent_id"),
        (get_player_agent_no,":agent_id"),
        (agent_is_active,":agent_id"),
        (agent_is_alive,":agent_id"),
        (agent_is_human, ":agent_id"),# FC added test
        (agent_get_team, ":playerteam", ":agent_id"),
        (call_script,"script_group6_listen",":agent_id",":playerteam"),
        (try_end),
      ])
    
    
    # ### fatcat group 3 of 8 start... still awful controll tho
    
    
    # ### fatcat spawn troops start.
    
    ### fatcat more MP groups, pre defined armies.
    ### multiplayer_more_troops_order_panel_brit_group
    multiplayer_more_troops_britain_divison_team_1 = (
      0, 0, 0, [],
      [
        (key_is_down, key_f1),
         (try_begin),
            (key_clicked, key_numpad_1),
            (call_script, "script_majors_divisions_1_spawn_britain_team1"),### 5 of 40 infantry, 1 cav, 1 arty crew
         (else_try),
            (key_clicked, key_numpad_2),
            (call_script, "script_majors_divisions_2_spawn_britain_team1"),### 5 of 40 infantry, 1 cav, 1 arty crew
         (else_try),
            (key_clicked, key_numpad_3),
            (call_script, "script_majors_divisions_3_spawn_britain_team1"),### 5 of 40 infantry, 1 cav, 1 arty crew
          (else_try),
            (key_clicked, key_numpad_0),
            (call_script, "script_majors_divisions_test_4_team1"),#
         (try_end),
        ])
    
    
    ### multiplayer_more_troops_france_divison_team_2
    multiplayer_more_troops_france_divison_team_2 = (
      0, 0, 0, [],
      [
        (key_is_down, key_f4),
            (key_clicked, key_numpad_1),
            (call_script, "script_majors_divisions_1_spawn_france_team2"),### 5 of 40 infantry, 1 cav, 1 arty crew
        ])
    
    
    multiplayer_more_troops_order_panel_rus_group = (###fatcat added spawn extra MP Troops
      0, 0, 0, [],
      [
        (key_is_down, key_f7),
    ###     (try_begin),
            (key_clicked, key_numpad_1),
            (add_visitors_to_current_scene, 32, "trp_russian_partizan_ai", 175, 1),###(add_visitors_to_current_scene, 32, ":troop_of_spear", 25, 1, grc_spear / 4 / 1),### grc_spear/4/1 invalid,  -15/-3 invalid, -1 non selectable, 0 is DEF INF like NONE / NA
            (add_visitors_to_current_scene, 32, "trp_russian_opol", 25, 1),#
            (add_visitors_to_current_scene, 32, "trp_russian_opol_nco", 1, 1),#
            (add_visitors_to_current_scene, 32, "trp_russian_opol_officer", 1, 1),#
            (troop_set_class, "trp_russian_partizan_ai", 0),# # (troop_set_class, <troop_id>, <value>),### Fatcat - 0 =inf/grp 1, 1 =arc/grp 2, 2 =cav/grp 3, 4 = others
            (troop_set_class, "trp_russian_opol", 0),# Group 1 Infantry
            (troop_set_class, "trp_russian_opol_nco", 0),# Group 1 Infantry
            (troop_set_class, "trp_russian_opol_officer", 0),# Group 1 Infantry
            (str_store_string, s1, "@Russain Partisains Launch An Attack"),
            (display_message, "@{s1}"),
    ###     (try_end),
        ])

    module_mission_templates, I put them in after Commander/Battle entry point part where call block starts

    Code:
          multiplayer_more_units_group3_orders,#
          multiplayer_more_units_group4_orders,#
          multiplayer_more_units_group5_orders,#
          multiplayer_more_units_group6_orders,#
          common_init_command_cursor,#
          common_command_cursor_countdown,#
          common_command_cursor_key_pressed,#
          common_order_move_to_pos43,#
          multiplayer_more_troops_britain_divison_team_1,#
          multiplayer_more_troops_france_divison_team_2,#
          multiplayer_more_troops_order_panel_rus_group,#

    Credits;
    command cursor minimod, by dstemmer (2009), edited by highlander
  14. Add More Controllable Multiplayer Unit Groups ?

    Hello all,

    I'm still working on MP custom captain/commander code, have made some discoveries and progress, but still require help if possible.
    Currently my new MP control code for groups 4 - 9 is not the best / only 17 commands ( instead of full default 28 ), I would like to post it as Tutorial, OSP or this Page with credits, but before that I want to try to get the regular "Orders Menu" working properly.


    My questions are;

    1. What is the command / operation for unselecting a group. (un highlights / deselects group)
    2. What is the command / operation for opening "Orders". (Not massively important compared to 1st question)

    My notes are;

    Non-default groups in MP can be given full orders, move to, un/selected.
    By spawning troops in (with pre defined Group_no), commands to different non-default are possible.

    Multiplayer non default groups;

    A - can be Highlight Selected individually (groups 4 - 9) in MP, I need a way of unselecting default and non default Groups.

    B - can be controlled individually (groups 4 - 9) in MP without actually Highlight Selecting

    C - can be controlled as 1 large messy group (groups 4 - 9) in MP, by pressing "Infantry" then "All" then "Others"

    D - default name string ("Unnamed Group 1 - 6" (groups 4 - 9)) will be displayed in MP without any work needed.



    A --- this Highlight Selects Groups, but does not clear previous selections

    # team_set_order_listener = 1795 # (team_set_order_listener, <team_no>, <sub_class>, <value>),
    # merge with old listeners if value is non-zero #clear listeners if sub_class is less than zero


    B --- can be contolled individually (groups 4 - 9) in MP without actually Highlight Selecting

    ### this is Group 4 follow me bit of code
    # (key_clicked, key_numpad_2),### Follow Me , 2
    # (agent_get_team, ":playerteam", ":agent_id"),#
    # (troop_get_class, ":playerteam", 3),#
    # (team_give_order, ":playerteam", 3, mordr_follow),#

    ######################## module_mission_templates.py
    multiplayer_more_units_group3_orders = (
    0, 0, 0, [],
    [
    (neg|multiplayer_is_dedicated_server),
    (game_key_clicked, gk_group3_hear),
    (try_begin),
    (assign,":agent_id"),
    (agent_is_active,":agent_id"),
    (agent_is_alive,":agent_id"),
    (agent_get_team, ":playerteam", ":agent_id"),#
    (class_is_listening_order, ":playerteam", 3),
    (call_script,"script_group3_listen",":agent_id",":playerteam"),
    (try_end),
    ])

    ######################## module_scripts.py
    #### script_group3_listen
    ("group3_listen", [
    (store_script_param_1, ":agent_id"),
    (store_script_param_2, ":playerteam"),
    (try_begin),
    (key_clicked, key_numpad_2),### Follow Me , 2
    (agent_get_team, ":playerteam", ":agent_id"),#
    (troop_get_class, ":playerteam", 3),#
    (team_give_order, ":playerteam", 3, mordr_follow),#
    (str_store_string, s1, "@Foot 4 Moving to follow Major"),
    (display_message, "@{s1}"),
    (else_try),
    (key_clicked, key_numpad_3),### Charge , 3
    (agent_get_team, ":playerteam", ":agent_id"),#
    (troop_get_class, ":playerteam", 3),#
    (team_give_order, ":playerteam", 3, mordr_charge),#
    (team_give_order, ":playerteam", 3, mordr_use_melee_weapons),#
    (str_store_string, s1, "@Foot 4 Charge"),
    (display_message, "@{s1}"),
    (else_try),
    (key_clicked, key_up),### Forwards , 4

    #### etc etc

    Thank you for your time, suggestions, help, code welcome.
  15. Add More Controllable Multiplayer Unit Groups ?

    4th M.P Controllable Group, with added jank.

    So far not solved... however, we can add a 4th controllable group, admittedly with janky style control, but I'm not a coder, just a copy pasta king so if somebody can come up with more refined ways or other implementation methods please post.

    This is just a quick example test, spawning single player bots in multiplayer, not yet tested on LAN, also not tested on dedicated sever.

    You have to decide which troops or troop mixes to use before compiling, and team and group order (unless willing to make more spawn button combinations for yourselves), note - spawning troops is not just limited to just key presses, make other ways if you want.

    You can set this up to control any faction, bandits, mercenaries or whatever you want I guess with enough combinations.

    ---To set up the MP game
    Native MP battle, number of bot team 1, set 1, start game, let bot spawn, then admin panel botsto 0, this ONLY has to be done once per MP session, not each round or map change.
    So far works best with Napoleonic Wars - Commander Battle none of above steps needed.


    ---To spawn 4th Group (any troop regardless of tf_guarntee, as long as the troop_id is not already in use by team)
    Hold keypad 0 and press keypad 1, 2 or 9 (team 1)
    Hold keypad / and press keypad 1, 2 or 9 (team 2)

    ---To control 4th Group (any troop regardless of tf_guarntee/ original group)
    After they have spawned,
    1. Press "Everyone Hear Me",
    2. Press "Others Hear Me",
    3. Give orders, (I do not think you will see said orders though)
    3. If keeps selecting or not selecting OTHERS group, press "Infantry Hear Me", then repeat step 1 and 2.

    ------- Add to mission_template.py, after belfry code

    Code:
    ###fatcat spawn extra MP Troops Team 1
    multiplayer_more_troops_order_panel_swadia_team_1 = (###fatcat team 1 (game reads as team 0)
      0, 0, 0, [],
      [
        (key_is_down, key_numpad_0),
        (key_clicked, key_numpad_9),
        (add_visitors_to_current_scene, 0, "trp_swadian_crossbowman", 20, 0),#(add_visitors_to_current_scene, Entrypoint,"trp_XX", Amount,Team, group not used?)
        (troop_set_class, "trp_swadian_crossbowman", 4),###(troop_set_class, <troop_id>, <value>),### Inf=0, Arc=1, Cav=3, Other or ???=4
        ])
    
    ###fatcat spawn extra MP Troops Team 2
    multiplayer_more_troops_order_panel_rhoduk_team_2 = (###fatcat team 2 (game as team 1)
      0, 0, 0, [],
      [
        (key_is_down, key_numpad_slash),
        (key_clicked, key_numpad_9),
        (add_visitors_to_current_scene, 32, "trp_rhodok_veteran_spearman", 20, 1),
        (troop_set_class, "trp_rhodok_veteran_spearman", 4),###(troop_set_class, <troop_id>, <value>),### Inf=0, Arc=1, Cav=3, Other or ???=4
        ])

    -------To spawn 4 pre defined unit groups, into team 1 or 2, if someone can help make the display message work properly

    Code:
    ###fatcat added spawn extra MP Troops Team 1
    multiplayer_more_troops_order_panel_swad_group_team_1 = (
      0, 0, 0, [],
      [
        (key_is_down, key_numpad_0),
         (try_begin),
            (key_clicked, key_numpad_1),### EXAMPLE of set Field Army 4 groups, 210 swadians, Knights controlled under OTHERS
            (add_visitors_to_current_scene, 0, "trp_swadian_footman", 100, 0),
            (add_visitors_to_current_scene, 0, "trp_swadian_infantry", 50, 0),
            (add_visitors_to_current_scene, 0, "trp_swadian_skirmisher", 25, 0),
            (add_visitors_to_current_scene, 0, "trp_swadian_man_at_arms", 25, 0),#
            (add_visitors_to_current_scene, 0, "trp_swadian_knight", 10, 0),#
            (troop_set_class, "trp_swadian_footman", 0),# Group 1 Infantry
            (troop_set_class, "trp_swadian_infantry", 0),# Group 1 Infantry
            (troop_set_class, "trp_swadian_skirmisher", 1),# Group 2 Archers
            (troop_set_class, "trp_swadian_man_at_arms", 2),# Group 3 Cavalry
            (troop_set_class, "trp_swadian_knight", 4),# Group OTHER
            (str_store_string, s1, "@Swadia War Party Ready"),
            ###(display_message, "@{s1}"),
         (else_try),
            (key_clicked, key_numpad_2),### EXAMPLE 75 swadians, swadian_infantry controlled under Cav, Knights controlled under OTHERS
            (add_visitors_to_current_scene, 0, "trp_swadian_footman", 25, 0),
            (add_visitors_to_current_scene, 0, "trp_swadian_skirmisher", 25, 0),#
            (add_visitors_to_current_scene, 0, "trp_swadian_infantry", 25, 0),#
            (add_visitors_to_current_scene, 0, "trp_swadian_knight", 10, 0),#
            (troop_set_class, "trp_swadian_footman", 0),# Group 1 Infantry
            (troop_set_class, "trp_swadian_skirmisher", 1),# Group 2 Archers
            (troop_set_class, "trp_swadian_infantry", 2),# Group 3 Cavalry
            (troop_set_class, "trp_swadian_knight", 4),# Group OTHER
            (str_store_string, s1, "@Swadia Village Party Ready"),
            ###(display_message, "@{s1}"),
         (try_end),
         (display_message, "@{s1}"),
        ])
    
    ###fatcat added spawn extra MP Troops Team 2
    multiplayer_more_troops_order_panel_nord_group_team_2 = (###fatcat added spawn extra MP Troops
      0, 0, 0, [],
      [
        (key_is_down, key_numpad_slash),
         (try_begin),
            (key_clicked, key_numpad_1),### EXAMPLE of set War Party 4 groups, 185 angry nords, Huscarls controlled under OTHERS
            (add_visitors_to_current_scene, 32, "trp_nord_footman", 100, 1),
            (add_visitors_to_current_scene, 32, "trp_nord_archer", 25, 1),#
            (add_visitors_to_current_scene, 32, "trp_nord_trained_footman", 25, 1),#
            (add_visitors_to_current_scene, 32, "trp_nord_warrior", 25, 1),#
            (add_visitors_to_current_scene, 32, "trp_nord_champion", 10, 1),#
            (troop_set_class, "trp_nord_footman", 0),# Group 1 Infantry
            (troop_set_class, "trp_nord_archer", 1),# Group 2 Archers
            (troop_set_class, "trp_nord_trained_footman", 2),# Group 3 Cavalry
            (troop_set_class, "trp_nord_warrior", 2),# Group 3 Cavalry
            (troop_set_class, "trp_nord_champion", 4),# Group OTHER
            (str_store_string, s1, "@Nord War Party Ready"),
            ###(display_message, "@{s1}"),
         (else_try),
            (key_clicked, key_numpad_2),### EXAMPLE of set Raider Party 4 groups, 75 hungry nords, Archers controlled under OTHERS
            (add_visitors_to_current_scene, 32, "trp_nord_trained_footman", 25, 1),#
            (add_visitors_to_current_scene, 32, "trp_nord_warrior", 25, 1),#
            (add_visitors_to_current_scene, 32, "trp_nord_champion", 10, 1),#
            (add_visitors_to_current_scene, 32, "trp_nord_archer", 15, 1),#
            (troop_set_class, "trp_nord_trained_footman", 0),# Group 1 Infantry
            (troop_set_class, "trp_nord_warrior", 1),# Group 2 Archers
            (troop_set_class, "trp_nord_champion", 2),# Group 3 Cavalry
            (troop_set_class, "trp_nord_archer", 4),#  Group OTHER
            (str_store_string, s1, "@Nord Raider Party Ready"),
            ###(display_message, "@{s1}"),
         (try_end),
         (display_message, "@{s1}"),
        ])

    add these to the battle templates you want them in, I've put them under: common_battle_init_banner,

    Code:
          multiplayer_more_troops_order_panel_swadia_team_1,
          multiplayer_more_troops_order_panel_rhoduk_team_2,
          multiplayer_more_troops_order_panel_swad_group_team_1,
          multiplayer_more_troops_order_panel_nord_group_team_2,
  16. Add More Controllable Multiplayer Unit Groups ?

    Thank you very much for explaining the mtef_ flags, I will have a go at making alternating team controller, one problem I've already seen with this way though is Player Secondary Team will probably spawn all bot types rather than the ones selected in Primary Team, ahh modding. Will post any success or questions.

    Thanks again and any inputs welcome.
  17. Add More Controllable Multiplayer Unit Groups ?

    Thank for your time, reply and looking into this matter Eärendil, forgive my late reply.

    Hmmm, it's a shame nobody has been able to crack this, I know that the repliers to the links you provided are very skilled in Warband coding so it must be hard to figure out.

    Side note in MP Groups, Classes 1-3, Everybody, OTHER and AND (default Shift Key, not in options) work / are recognised
    Classes 4-9 and NEARBY are not MP recognised


    I have been looking around in my mod sys:

    header_mission_templates.py,
    # filter flags

    mtef_team_member_2 = 0x00008000
    mtef_infantry_first = 0x00010000
    mtef_archers_first = 0x00020000
    mtef_cavalry_first = 0x00040000
    mtef_no_auto_reset = 0x00080000

    1. Notice the mtef_xxxxx_first, could it be that no more classes are defined here and is it possible to edit/reorder these? (I have not learnt hex/binary voodoo)


    2. If not would this be a possible Workaround to start on?

    I think this is Oldschool's idea (at end of the post), but rework it for Multiplayer,

    Basic Example,

    Create more than 2 teams fighting, team 1 and 3 Vs team 2 and 4,
    Team 1 and 3 are controlled by MultiplayerP1, (using team_set_relation),
    MultiplayerP1 controls all 3 unit of team 1 as normal, button press changes control, MultiplayerP1 controls all 3 unit of team 3 instead, (using agent_set_team), team 1 follows last received orders,
    Same for MultiplayerP2 (team 2 and 4).

    Thanks again for any input.
  18. Add More Controllable Multiplayer Unit Groups ?

    Hi all, I am trying to add more units to command in Lan Multiplayer (M.P) Battle, in the regular mode you can control 3 units and in Single Player (S.P) you can control up to 9 units. This is mainly for Multiplayer historical / custom battles or board game battle / mission stages. 1. Does...
Back
Top Bottom