Integrating Native Presentations into Napoleonic Wars

Users who are viewing this thread

Fat Cat

Recruit
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 into Napo Wars, it works but nothing much changed from regular Napo Battle Mode).

When I use this custom mission template in Native Battle, Clients and I can select up to 35 different bot troop types per faction/team rather than Native's 3 Default Groups.

I have followed this link https://forums.taleworlds.com/index.php?threads/nw-creating-a-new-unit-section.317945/ for adding new Troop Type Button, it works no problems, I have copy-pasted and edited code (Presentations and Scripts, etc) from Native into Napoleonic Wars, combined it with goKiller's codes so when you click new added Button it brings up Native's Item and Troop Selection screen -

Copied multiplayer_item_select from Native Presentations into Napoleonic Wars, renamed it to multiplayer_ai_select (commented out else_try block
containing npc_kingdoms_begin), called by the new Button.

1. Original Napoleonic Wars Troop Selection (plus Rank and Select Equipment) still fully works with no conflicts - no problems
2. Click new button, Native's Items and Troops Selection screen displayed - no problems
3. item, clothes and horse Names are shown, and mouse hover displays the Item's stats information - no problems
4. Mouse Right Click clears inventory / item slot - no problems
5. Done and Reset Buttons work - no problems
6. Select Bots Types' Troop checkbox / tick box (to spawn and control) - have problems;
- can tick / check wanted bots like in Native Battle - no problems, however...
- all bot types spawn as usual, not the ones Tick Selected by player (only ticked bot types should spawn like Native),
- and no control over them is given.

script_multiplayer_calculate_cur_selected_items_cost
script_multiplayer_display_available_items_for_troop_and_item_classes
cf_multiplayer_is_item_default_for_troop
multiplayer_set_default_item_selections_for_troop
multiplayer_get_item_value_for_troop -------- (commented out else_try block containing npc_kingdoms_begin)
multiplayer_update_cost_labels
multiplayer_get_item_value_for_troop
str_total_item_cost_reg0 given a Name (Total cost) in Strings

Does anyone know how to make the link between ticking selected troops wanted and them spawning work?

Thank you for your time reading this, any help, advice or answers appreciated.
 
Python:
ti_on_presentation_event_state_change = -62.0 # Some overlay has changed it's state (button clicked, checkbox switched state, slider moved, list has it's active element changed etc).
    # trigger param 1 = overlay_id of the object that initiated the event
    # trigger param 2 = new overlay value (if appropriate)
You question is abstract. If you need to solve concrete problem nobody can help you without source code.
 
Upvote 0
I have followed this link https://forums.taleworlds.com/index.php?threads/nw-creating-a-new-unit-section.317945/ for adding new Troop Type Button, it works no problems, I have copy-pasted and edited code (Presentations and Scripts, etc) from Native into Napoleonic Wars, combined it with goKiller's codes so when you click new added Button it brings up Native's Item and Troop Selection screen -
Presenations are complex. You cannot simply copy paste a presentation, you need to check which changes you will need to make at the constants, scripts, triggers and mission templates too.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
Back
Top Bottom