Minimap mod?

Users who are viewing this thread

awkwarrd

Veteran
I hope im posting this in the correct forum, im sorry if it's not.

I have hunted on google and all over these forums for a single mod, just 1 mod.. with 1 thing in it.
I eventually gave up and created this forum account just to ask this one question.

Are there any mods out there that only have the minimap as a permanent thing for combat? without me having to hit backspace.
That's all i want to add to my game, it's the only thing i feel is missing from the badass game that it already is.
So if anyone can point me in the right direction, i would very much appreciate it.


I have downloaded and tested i think all of the mods that use the minimap, and i don't like them.
Because they all add way too much content for me, i don't care for all the bells and whistles.. for now anyway..
I really wanted to like the Floris Mod, but i started with a 1handed sword in that game and right off the bat.. the wrist flick animation just made me not keen, and the rest of it with all of it's options to do things that i needed their wiki for just killed my drive to keep playing, i mean i haven't even conquered the map yet.
Although it had the minimap but didn't have the minimap in the basic version.
And the other mods were cool but still the same problem, and lots of them had missing screenshots and broken download links.
I tried to get a bunch of cubiks mods, but they were apparently out of date.
 
For as long as you are fine with being unable to attack during battle thanks to mouse cursor being locked by the permanently running presentation, this can be done fairly easily I guess.
 
Lav said:
For as long as you are fine with being unable to attack during battle thanks to mouse cursor being locked by the permanently running presentation, this can be done fairly easily I guess.
Im not sure what you mean.
The other addons that have the minimap did't have this problem, they just added more stuff to the game ontop of the minimap, and all i want is the minimap

Somebody said:
Check out custom commander, it has that persistent minimap.
I have, which is done by cubik, and seems to be the creator of the original mod that allows the minimap to be presistant without the need for backspace.
But it seems the addon adds extra gimmicks to the game other than the minimap, which is all im after.


There doesn't appear to be an addon anywhere, that is minimap only, nothing else, just minimap.
There was one, done by a guy named "Sphere" but all his links are dead.
 
Hmm, indeed, with the right flags presentation will quietly run in the background. Forgot that nifty fact. :smile:

Okay, it's pretty easy then:

Add this script at the end of module_scripts.py:

Code:
  # script_update_battle_map
  # Input: none
  # Output: none
  ("update_battle_map", #TODO: Call this in every battle mission template, once per second
   [(set_fixed_point_multiplier, 1000),

    (get_scene_boundaries, pos2, pos3),

    (try_for_agents,":cur_agent"),
      (agent_is_human, ":cur_agent"),
      (agent_get_party_id, ":agent_party", ":cur_agent"),
      (agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id),
      (try_begin),
        (eq, ":agent_party", "p_main_party"),
        (try_begin),
          (agent_is_alive, ":cur_agent"),
          (call_script, "script_update_agent_position_on_map", ":cur_agent"),          
        (else_try),
          (overlay_set_alpha, ":agent_overlay", 0),
        (try_end),
      (else_try),
        (agent_is_ally, ":cur_agent"),
        (try_begin),
          (agent_is_alive, ":cur_agent"),
          (call_script, "script_update_agent_position_on_map", ":cur_agent"),
        (else_try),
          (overlay_set_alpha, ":agent_overlay", 0),
        (try_end),
      (else_try),
        (try_begin),
          (agent_is_alive, ":cur_agent"),
          (call_script, "script_update_agent_position_on_map", ":cur_agent"),
        (else_try),
          (overlay_set_alpha, ":agent_overlay", 0),
        (try_end),
      (try_end),
    (try_end),
    
    (call_script, "script_update_order_flags_on_map"),
  ]),

Add this presentation at the end of module_presentations.py:

Code:
  ("battle_map",prsntf_read_only|prsntf_manual_end_only,0,[
      (ti_on_presentation_load,
       [(set_fixed_point_multiplier, 1000),

        (try_for_agents, ":agent_no"),
          (agent_set_slot, ":agent_no", slot_agent_map_overlay_id, 0),
        (try_end),

        (get_scene_boundaries, pos2, pos3),
        (position_transform_position_to_local, pos4, pos2, pos3),
        (position_get_x, ":map_width", pos4),
        (position_get_y, ":map_height", pos4),
        (store_div, ":map_ratio", ":map_height", 100),
        (store_div, ":map_ratio", ":map_width", ":map_ratio"),
        (try_begin),
          (gt, ":map_ratio", 100),
          (assign, "$g_battle_map_width", 300),
          (store_div, "$g_battle_map_scale", ":map_width", "$g_battle_map_width"),
          (store_div, "$g_battle_map_height", ":map_height", "$g_battle_map_scale"),
        (else_try),
          (assign, "$g_battle_map_height", 300),
          (store_div, "$g_battle_map_scale", ":map_height", "$g_battle_map_height"),
          (store_div, "$g_battle_map_width", ":map_width", "$g_battle_map_scale"),
        (try_end),
        
        (create_image_button_overlay, "$g_battle_map_plane", "mesh_white_plane", "mesh_white_plane"),
        (overlay_set_color, "$g_battle_map_plane", 0),
        (store_add, ":map_bordered_width", "$g_battle_map_width", 20),
        (store_add, ":map_bordered_height", "$g_battle_map_height", 20),
        (store_mul, ":map_scale_x", ":map_bordered_width", 50),
        (store_mul, ":map_scale_y", ":map_bordered_height", 50),
        (position_set_x, pos1, ":map_scale_x"),
        (position_set_y, pos1, ":map_scale_y"),
        (overlay_set_size, "$g_battle_map_plane", pos1),
        (store_sub, ":map_pos_x", 990, ":map_bordered_width"),
        (store_sub, ":map_pos_y", 740, ":map_bordered_height"),
        (position_set_x, pos1, ":map_pos_x"),
        (position_set_y, pos1, ":map_pos_y"),
        (overlay_set_position, "$g_battle_map_plane", pos1),
        (overlay_set_alpha, "$g_battle_map_plane", 0x44),

        (create_mesh_overlay, "$g_battle_map_infantry_order_flag", "mesh_flag_infantry"),
        (create_mesh_overlay, "$g_battle_map_archers_order_flag", "mesh_flag_archers"),
        (create_mesh_overlay, "$g_battle_map_cavalry_order_flag", "mesh_flag_cavalry"),
        (overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0),
        (overlay_set_alpha, "$g_battle_map_archers_order_flag", 0),
        (overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0),

        (call_script, "script_update_battle_map"),

        (presentation_set_duration, 999999),
        ]),
      ]),

In module_mission_templates.py:

1. Find the following code:
Code:
common_battle_order_panel = (
  0, 0, 0, [],
  [
    (game_key_clicked, gk_view_orders),
    (neg|is_presentation_active, "prsnt_battle"),
    (start_presentation, "prsnt_battle"),
    ])

common_battle_order_panel_tick = (
  0.1, 0, 0, [],
  [
    (is_presentation_active, "prsnt_battle"),
    (call_script, "script_update_order_panel_statistics_and_map"),
    ])

2. Add the following trigger definitions:
Code:
common_battle_map_panel = (
  ti_after_mission_start, 0, 0, [],
  [
    (neg|is_presentation_active, "prsnt_battle_map"),
    (start_presentation, "prsnt_battle_map"),
    ])

common_battle_map_panel_tick = (
  0.1, 0, 0, [],
  [
    (is_presentation_active, "prsnt_battle_map"),
    (call_script, "script_update_battle_map"),
    ])

3. For all missions templates where you want permanent minimap instead of the full version, find the following within the mission template definition:
Code:
      common_battle_order_panel,
      common_battle_order_panel_tick,

4. And replace with:
Code:
      common_battle_map_panel,
      common_battle_map_panel_tick,

Compile your module and voila.
 
Lav said:
Hmm, indeed, with the right flags presentation will quietly run in the background. Forgot that nifty fact. :smile:

Okay, it's pretty easy then:

Add this script at the end of module_scripts.py:

Code:
  # script_update_battle_map
  # Input: none
  # Output: none
  ("update_battle_map", #TODO: Call this in every battle mission template, once per second
   [(set_fixed_point_multiplier, 1000),

    (get_scene_boundaries, pos2, pos3),

    (try_for_agents,":cur_agent"),
      (agent_is_human, ":cur_agent"),
      (agent_get_party_id, ":agent_party", ":cur_agent"),
      (agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id),
      (try_begin),
        (eq, ":agent_party", "p_main_party"),
        (try_begin),
          (agent_is_alive, ":cur_agent"),
          (call_script, "script_update_agent_position_on_map", ":cur_agent"),          
        (else_try),
          (overlay_set_alpha, ":agent_overlay", 0),
        (try_end),
      (else_try),
        (agent_is_ally, ":cur_agent"),
        (try_begin),
          (agent_is_alive, ":cur_agent"),
          (call_script, "script_update_agent_position_on_map", ":cur_agent"),
        (else_try),
          (overlay_set_alpha, ":agent_overlay", 0),
        (try_end),
      (else_try),
        (try_begin),
          (agent_is_alive, ":cur_agent"),
          (call_script, "script_update_agent_position_on_map", ":cur_agent"),
        (else_try),
          (overlay_set_alpha, ":agent_overlay", 0),
        (try_end),
      (try_end),
    (try_end),
    
    (call_script, "script_update_order_flags_on_map"),
  ]),

Add this presentation at the end of module_presentations.py:

Code:
  ("battle_map",prsntf_read_only|prsntf_manual_end_only,0,[
      (ti_on_presentation_load,
       [(set_fixed_point_multiplier, 1000),

        (try_for_agents, ":agent_no"),
          (agent_set_slot, ":agent_no", slot_agent_map_overlay_id, 0),
        (try_end),

        (get_scene_boundaries, pos2, pos3),
        (position_transform_position_to_local, pos4, pos2, pos3),
        (position_get_x, ":map_width", pos4),
        (position_get_y, ":map_height", pos4),
        (store_div, ":map_ratio", ":map_height", 100),
        (store_div, ":map_ratio", ":map_width", ":map_ratio"),
        (try_begin),
          (gt, ":map_ratio", 100),
          (assign, "$g_battle_map_width", 300),
          (store_div, "$g_battle_map_scale", ":map_width", "$g_battle_map_width"),
          (store_div, "$g_battle_map_height", ":map_height", "$g_battle_map_scale"),
        (else_try),
          (assign, "$g_battle_map_height", 300),
          (store_div, "$g_battle_map_scale", ":map_height", "$g_battle_map_height"),
          (store_div, "$g_battle_map_width", ":map_width", "$g_battle_map_scale"),
        (try_end),
        
        (create_image_button_overlay, "$g_battle_map_plane", "mesh_white_plane", "mesh_white_plane"),
        (overlay_set_color, "$g_battle_map_plane", 0),
        (store_add, ":map_bordered_width", "$g_battle_map_width", 20),
        (store_add, ":map_bordered_height", "$g_battle_map_height", 20),
        (store_mul, ":map_scale_x", ":map_bordered_width", 50),
        (store_mul, ":map_scale_y", ":map_bordered_height", 50),
        (position_set_x, pos1, ":map_scale_x"),
        (position_set_y, pos1, ":map_scale_y"),
        (overlay_set_size, "$g_battle_map_plane", pos1),
        (store_sub, ":map_pos_x", 990, ":map_bordered_width"),
        (store_sub, ":map_pos_y", 740, ":map_bordered_height"),
        (position_set_x, pos1, ":map_pos_x"),
        (position_set_y, pos1, ":map_pos_y"),
        (overlay_set_position, "$g_battle_map_plane", pos1),
        (overlay_set_alpha, "$g_battle_map_plane", 0x44),

        (create_mesh_overlay, "$g_battle_map_infantry_order_flag", "mesh_flag_infantry"),
        (create_mesh_overlay, "$g_battle_map_archers_order_flag", "mesh_flag_archers"),
        (create_mesh_overlay, "$g_battle_map_cavalry_order_flag", "mesh_flag_cavalry"),
        (overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0),
        (overlay_set_alpha, "$g_battle_map_archers_order_flag", 0),
        (overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0),

        (call_script, "script_update_battle_map"),

        (presentation_set_duration, 999999),
        ]),
      ]),

In module_mission_templates.py:

1. Find the following code:
Code:
common_battle_order_panel = (
  0, 0, 0, [],
  [
    (game_key_clicked, gk_view_orders),
    (neg|is_presentation_active, "prsnt_battle"),
    (start_presentation, "prsnt_battle"),
    ])

common_battle_order_panel_tick = (
  0.1, 0, 0, [],
  [
    (is_presentation_active, "prsnt_battle"),
    (call_script, "script_update_order_panel_statistics_and_map"),
    ])

2. Add the following trigger definitions:
Code:
common_battle_map_panel = (
  ti_after_mission_start, 0, 0, [],
  [
    (neg|is_presentation_active, "prsnt_battle_map"),
    (start_presentation, "prsnt_battle_map"),
    ])

common_battle_map_panel_tick = (
  0.1, 0, 0, [],
  [
    (is_presentation_active, "prsnt_battle_map"),
    (call_script, "script_update_battle_map"),
    ])

3. For all missions templates where you want permanent minimap instead of the full version, find the following within the mission template definition:
Code:
      common_battle_order_panel,
      common_battle_order_panel_tick,

4. And replace with:
Code:
      common_battle_map_panel,
      common_battle_map_panel_tick,

Compile your module and voila.
You sir.. deserve +100 moxy, thankyou.
Worked first try, no warnings or errors, which is alot better than my attempts at trying to get the minimap to work the past 2 days.


I don't wanna sound ungrateful, or push my luck.
But is there anyway to scale this minimap? or have control over it's size and be able to shrink or enlarge it?
 
Check the presentation. Namely the lines:
Code:
          (assign, "$g_battle_map_width", 300),
and
Code:
          (assign, "$g_battle_map_height", 300),
 
And the facepalm begins lol.


Thanks again.

1 final question.
How do other mods have this minimap as an on/off option in camp? or a hotkey for it in battle?
Is it too complex to bother with?


BTW, with this minimap, everytime i press "c" in a battle, and open my character page, then click done to get back to battle, the minimap is gone, and backspace does nothing now.
 
awkwarrd said:
1 final question.
How do other mods have this minimap as an on/off option in camp? or a hotkey for it in battle?
Is it too complex to bother with?
Camp menu changes some global variable to remember player's settings for minimap. When starting the battle, ts_after_mission_start trigger checks that variable in addition to checking whether the presentation has already started.

awkwarrd said:
BTW, with this minimap, everytime i press "c" in a battle, and open my character page, then click done to get back to battle, the minimap is gone, and backspace does nothing now.
Modify the common_battle_map_panel_tick trigger. Right now it checks if presentation is running and if it is, updates it. Instead it should check if presentation is running, if it is, update it, and if it's not, start it (same as in ti_before_mission_start trigger does).

Obviously, if you add a configuration global variable to control minimap behavior, you'll need to check for it in both triggers.

With a bit of fiddling, it's perfectly possible to have both minimap variants available: minimap only by default, when player hits Backspace it hides and full version is shown instead, and when it closes minimap restarts once again. To player this will look like minimap is always on screen, and Backspace only activates the stats, orders panel and ability to click on minimap to order your troops.
 
Lav said:
Fixed triggers:

Code:
common_battle_map_panel = (
  ti_after_mission_start, 0, 0, [],
  [
    (neg|is_presentation_active, "prsnt_battle_map"),
    (start_presentation, "prsnt_battle_map"),
    ])

common_battle_map_panel_tick = (
  0.1, 0, 0, [],
  [
    (try_begin),
        (is_presentation_active, "prsnt_battle_map"),
        (call_script, "script_update_battle_map"),
    (else_try),
        (start_presentation, "prsnt_battle_map"),
    (try_end),
    ])

Win.
Thanx again.
 
Back
Top Bottom