[MOD] Tactical Map

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

[MOD] Tactical Map

Post by MegaJohnny »

Overview
This is a mod I've been making for a while, spurred on by the X4 announcement, that adds a new map menu with a bunch of changes. I like the new holomap in XR, especially with its mouse controls, but the actual map menu leaves a lot to be desired... Not to mention that the workflow for applying a new order is the same as in X3, where you have to lose sight of the map.

Tactical Map is a total replacement of the vanilla map from scratch. It has all of the same features as the vanilla map, but also lets you select your ships and give commands to them with quick and easy mouse-based controls. You can give any number of commands to your ships without closing the menu. It also features a whole boatload of UI differences with the vanilla map, designed to make it more compact, pretty, and informative!

Images
Using multi-select mode
Looking at a crowded zone
Reviewing assets in the sector view

Download
Nexus Mods
When installing, make sure you get both main files, as there are no built-in commands in the map! Each zip contains a folder containing a game extension, so just drop it into your extensions folder in each case.

Also view the source code at Github

Changes

Tactical Map 1.5
Major Changes:
  • Switch to a pure-Lua way of replacing the vanilla map, removing the save-game dependency
  • Add support for selection modes, and replace the vanilla map for selection modes
    • In a selection mode, invalid choices on the object list are grey
    • Command functionality is completely disabled when in a selection mode
  • Add middle click as a way to give orders
    • Middle click only works in zone or sector mode, and selects a position for giving a command, ignoring any objects under the mouse
    • Handy for telling ships to go somewhere when a station or ship is in the way
    • Keep the middle mouse button held down and drag the mouse up and down to specify a vertical offset from the ecliptic
    • The vertical offset, when middle mouse dragging, is shown over the holomap
  • Station sequences and modules are in from the vanilla map
    • Modules are ordered by their module type (production, storage, etc)
    • Each sequence has its letter code (A, B, C, ...) on display as well as its current stage
    • Module types have their own little icon - any replacements would be gratefully accepted!
Minor Changes:
  • Display the player's current ship (Skunk or docked capital) in a different colour
  • Gates are displayed under their zone/sector in the appropriate view
  • Implement the vanilla Shift+A, F1 and F3 hotkeys
Tactical Map 1.3
  • Larger font is used for small HUD detailmonitor mode, fixes debug output produced by this (only tested on 1920x1080)
  • In multi-select mode, the "X" button for clearing selection now has hotkey 6/RB
Vanilla Commands 1.3
  • Add grid commands for "stop order", "join squad", and "leave squad"
Tactical Map 1.2
  • New multi-select mode
  • Ships selected for commands now have very obvious yellow arrows on the right-hand list, so they pop out a bit more
  • In the sector view, only commandable ships are displayed now
  • Reveal percentage display as in vanilla map, except for ships
  • Shield and hull condition alerts on player-owned ships. If hull is below 70% a yellow alert is shown, which turns red if the hull is below 40% - if shield is below half then a cyan alert is shown
  • Adjusted command accept text on bottom left, added colouration
  • Removed Sidebar Extender file (it's just renamed, so you can get it back if you like)
  • Jumpgates and jump beacons now shown in light grey, more in keeping with map colour
  • Fixed bug causing map -> object menu -> plot course to have no effect (and produce debug log error)
  • Fixed bug where zooming out wouldn't select the space you just zoomed out of
  • Fixed bug where trying to return from the map to a previous section would close out instead
Vanilla Commands 1.2
  • All commands are valid in multi-select mode, with the following exceptions:
    • Stop Task: If you right-click one of the selected ships on itself, the other ships are still being clicked onto a different ship, so it doesn't really work.
    • Refuel: Opens a menu pertaining to one ship, so doesn't make sense for multi-select.
    • Transfer Wares: Ditto.
Tactical Map 1.1
  • Now replaces vanilla map by default (the opposite applies - you can rename/remove MainMenu.xml to revert this)
  • Now mimics the history behaviour of the vanilla map
  • Now includes economy stats button as in vanilla map
  • Now lists jump beacons as in vanilla map
  • Rudimentary (and untested!) jumpdrive support, but not for jumpdrive kickstarter - feedback appreciated
  • Command selection displays above grid buttons (previously was directly above the right-hand list)
  • Clicking a ship in sector view highlights the zone it's in (previously would clear map highlight)
  • Stations are now valid right-click targets (previously would just select a position if you right-clicked a station)
  • Changes to API: Issuable orders can have a priority number now, and the filter function can return a number to override the priority instead of a boolean. The map accepts more than one order being applicable at once, and takes the one with the highest priority.
  • Removed unnecessary debug.log output from MainMenu.xml
Vanilla Commands 1.1
  • Added ware exchange grid command
  • Added "force attack" grid command
  • Now properly signals "stop order" followed by command-specific order, as in vanilla gameplay - this fixes a bug where sometimes commands needed to be issued twice
Last edited by MegaJohnny on Tue, 16. Oct 18, 00:34, edited 9 times in total.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

just curious how difficult it would be to suppress your default options in favour of mod-defined options for certain Objects? i have been working on a Script Rewrite for some time now, and because i did everything from Scratch the Command-giving is diffrent from Vanilla - diffrent enough that the Vanilla Orders are simply ignored in most cases ^^ (i have included workarunds for some orders, but thats nothing i want to keep forever)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Ah, interesting point - I hadn't considered it. Currently if you added your new commands, the map would complain if you did a right-click and both a new command and a built-in command were applicable (and issue neither of them). But I'll let each command have a priority number, and just tell the map to pick the one with the highest.

As for commands in vanilla which have no equivalent in the rewrite, I've been tempted on and off to separate the map and its standard "command pack" into two mods, just for this eventuality - but now I'll definitely go ahead with that.
quarren
Posts: 128
Joined: Sat, 9. Nov 02, 12:40
x4

Post by quarren »

This looks really cool! Looking forward to a download link. :)
Ezarkal
Posts: 1610
Joined: Wed, 22. Apr 15, 02:27
x4

Post by Ezarkal »

oooohhhhh, I think this mod will be in my "must have" stuff.

Thank you for the effort, and please keep us posted!

:)
Humans are deuterostomes, which means that when they develop in the womb the first opening they develop is the anus.
This means that at one point you were nothing but an asshole.

Some people never develop beyond this stage.
User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Thanks, guys. :)

I've been able to add some finishing touches and I think it's now ready enough to be uploaded. The link's in the OP. Let me know how you find it!
Ezarkal
Posts: 1610
Joined: Wed, 22. Apr 15, 02:27
x4

Post by Ezarkal »

Many thanks. Download in progress. I will have time to test it tomorrow.
Humans are deuterostomes, which means that when they develop in the womb the first opening they develop is the anus.
This means that at one point you were nothing but an asshole.

Some people never develop beyond this stage.
User avatar
Informer
Posts: 283
Joined: Wed, 3. Jul 13, 23:10
x4

Post by Informer »

This looks great, gonna have a go with this mod.

Thanks m8
Information is power. But like all power, there are those who want to keep it for themselves (Aaron Swartz you will live forever)
User avatar
Informer
Posts: 283
Joined: Wed, 3. Jul 13, 23:10
x4

Post by Informer »

Hello MegaJohnny,

I did download and try this mod. Both files are in my extension folder.
But I don't get a right click on my ships. Also I don't get the extra sidebar what is showing in your example pictures.

Can it be a problem with other mods? I did start a save game, were I use other mods to.

Thanks,

Informer
Information is power. But like all power, there are those who want to keep it for themselves (Aaron Swartz you will live forever)
User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Informer wrote:Hello MegaJohnny,

I did download and try this mod. Both files are in my extension folder.
But I don't get a right click on my ships. Also I don't get the extra sidebar what is showing in your example pictures.

Can it be a problem with other mods? I did start a save game, were I use other mods to.

Thanks,

Informer
Just to be clear - are you opening the tactical map via Sidebar Extender (or the optional method described in the readme)? I have a feeling you may be looking at the vanilla map menu, whereas the tactical map is a new menu altogether. Conflict with another mod I would say is very unlikely right now.
birdtable
Posts: 2102
Joined: Sat, 7. Feb 04, 20:42
x4

Post by birdtable »

Tried this with Rebirth VR ,, worked fine but not able to access the lower right hand control buttons ( understandable ) .. Looks good..
Tried in Rebirth beta and could not get the option tactical map to display, could be me as I was rushing a little ( had to go out)... but the VR had mods and Rebirth Beta was vanilla .....
Will give a proper testing tomorrow ....
User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

birdtable wrote:Tried this with Rebirth VR ,, worked fine but not able to access the lower right hand control buttons ( understandable ) .. Looks good..
Tried in Rebirth beta and could not get the option tactical map to display, could be me as I was rushing a little ( had to go out)... but the VR had mods and Rebirth Beta was vanilla .....
Will give a proper testing tomorrow ....
Thanks :)

I don't know much about the VR version, so sadly I can't test it properly for usability. Would you say the buttons are too squashed in the corner to be accessible?

As for the beta version, I'm on that as well. If you mean yours is totally vanilla, you'll need Phipsz's Sidebar Extender to get the item to appear. If you have that already, let me know, and I'll see if I forgot anything. Alternatively the readme tells you how to make it replace the vanilla map in some cases.
birdtable
Posts: 2102
Joined: Sat, 7. Feb 04, 20:42
x4

Post by birdtable »

Well I may be not quite accurate with vanilla, did have the sidebar extender or I may well have forgot come to think of it... :roll:

As I said was in a bit of a rush, spent too much time trying out in VR,, could not find key to access that lower right segment, no hassle there as I am sure it is not intended to work with VR.
Will give thorough testing tomorrow (non VR) but first impressions are good..

Edit .. I do have a few saves with different scenarios so will work through them, the buttons do not appear to be to squashed for accessibility ..
User avatar
Informer
Posts: 283
Joined: Wed, 3. Jul 13, 23:10
x4

Post by Informer »

MegaJohnny wrote:
Informer wrote:Hello MegaJohnny,

I did download and try this mod. Both files are in my extension folder.
But I don't get a right click on my ships. Also I don't get the extra sidebar what is showing in your example pictures.

Can it be a problem with other mods? I did start a save game, were I use other mods to.

Thanks,

Informer
Just to be clear - are you opening the tactical map via Sidebar Extender (or the optional method described in the readme)? I have a feeling you may be looking at the vanilla map menu, whereas the tactical map is a new menu altogether. Conflict with another mod I would say is very unlikely right now.
Thanks for your quick responds. But it was my own mistake. Didn't check the installed files. I did unzip the files but had I had the 2 times the same map in my directory. So off course the mod didn't work that way.
Everything works great, and I must say that you did a great job with this mod.
Will also try the mod tomorrow in x-rebirth VR edition. :D :)
Information is power. But like all power, there are those who want to keep it for themselves (Aaron Swartz you will live forever)
birdtable
Posts: 2102
Joined: Sat, 7. Feb 04, 20:42
x4

Post by birdtable »

All working perfectly, no issues.... :)

The following observations are based on a possible not yet implemented feature or lack of understanding on my part of intended action...

1. After using tactical map would prefer to stay with map for zones, sectors etc ...works with zoom out/zoom in but does not feel quite right.
2. Attack ... can give command to attack enemy ships (red) but command rejected if friendly (green).

The movement command works really well,, liked very much.
User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Informer wrote:Thanks for your quick responds. But it was my own mistake. Didn't check the installed files. I did unzip the files but had I had the 2 times the same map in my directory. So off course the mod didn't work that way.
Everything works great, and I must say that you did a great job with this mod.
Will also try the mod tomorrow in x-rebirth VR edition. :D :)
Thanks! Glad to know it's working.
birdtable wrote:All working perfectly, no issues.... :)

The following observations are based on a possible not yet implemented feature or lack of understanding on my part of intended action...

1. After using tactical map would prefer to stay with map for zones, sectors etc ...works with zoom out/zoom in but does not feel quite right.
2. Attack ... can give command to attack enemy ships (red) but command rejected if friendly (green).

The movement command works really well,, liked very much.
Thanks again!

1. I'm afraid I'm not entirely sure what you mean here - would you like to use the tactical map at the zone level, and use the vanilla map at other zoom levels? I think it's possible, but I'd rather improve the tactical map so it's nice to use at every level. Is there anything in particular that makes it feel wrong?
2. Ah! Should be easy to implement - I just forgot about that use case. I'd like to put it as a grid button, just so it's harder to attack a friendly ship by accident.
birdtable
Posts: 2102
Joined: Sat, 7. Feb 04, 20:42
x4

Post by birdtable »

Sorry if I did not explain clearly,,, I admit it is open to confusion.. It would be nice to use your tactical map at all levels ... Not used to using zoom for maps so maybe just a comfort thing... You must have put a lot of work in for the tactical map to work so smoothly... :thumb_up:
Agree about grid button..
Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp »

Just been giving this a go today via the SideBar and it's great :)

Some feedback in case useful:

1. Would it be possible to access the Tactical Map via either the Property Owned or Ship Detail menu? This would support using it with particular ships without needing to find it in the Tactical Map first. Maybe I'm missing something already possible.

2. Would it be possible to select the Skunk in the Tactical Map, and then have the appropriate commands propagate to the Skunk's squad?

Edit: 3. Showing player property in the tactical sector map per zone is a cool idea. I don't have a big empire to test with but it occurred to me that the list of zones and property could become quite long. I'm not sure if making zone property sub-lists collapsible would necessarily be better but I thought I'd mention the topic in case it stimulated ideas.
User avatar
MegaJohnny
Posts: 2216
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Sparky Sparkycorp wrote:Just been giving this a go today via the SideBar and it's great :)

Some feedback in case useful:

1. Would it be possible to access the Tactical Map via either the Property Owned or Ship Detail menu? This would support using it with particular ships without needing to find it in the Tactical Map first. Maybe I'm missing something already possible.

2. Would it be possible to select the Skunk in the Tactical Map, and then have the appropriate commands propagate to the Skunk's squad?

Edit: 3. Showing player property in the tactical sector map per zone is a cool idea. I don't have a big empire to test with but it occurred to me that the list of zones and property could become quite long. I'm not sure if making zone property sub-lists collapsible would necessarily be better but I thought I'd mention the topic in case it stimulated ideas.
Thanks for the feedback ;)

1. The MainMenu.xml thing from the readme will do that for you - I use it myself. The only reason this isn't the default is that the map doesn't implement the player jumpdrive yet, and I didn't want to break it for people who use it routinely. I'll get support for the player jump drive going (should be only a few lines) and make this the default for the next update.

2. Good idea! I can't say it will make it into the next update, but it'll be on the todo list.

3. Yeah, I have the same conundrum - not much property, so I don't know exactly when it becomes "too much". It was originally made for sending commandable ships to other zones straight from sector view, so maybe if only commandable ships were displayed there? Extend/collapse button could work too, but I'd have trouble thinking where to put it.
Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp »

You're welcome!
MegaJohnny wrote: 1. The MainMenu.xml thing from the readme will do that for you - I use it myself. The only reason this isn't the default is that the map doesn't implement the player jumpdrive yet, and I didn't want to break it for people who use it routinely. I'll get support for the player jump drive going (should be only a few lines) and make this the default for the next update.
Ah, of course. I am a while off acquiring the JD components so I will give it a go without the SideBar Extension.
MegaJohnny wrote: 2. Good idea! I can't say it will make it into the next update, but it'll be on the todo list.
Cool 8)
MegaJohnny wrote: 3. Yeah, I have the same conundrum - not much property, so I don't know exactly when it becomes "too much". It was originally made for sending commandable ships to other zones straight from sector view, so maybe if only commandable ships were displayed there? Extend/collapse button could work too, but I'd have trouble thinking where to put it.
Restricting the view to commandable ships sounds like it could be a good idea. As empires grow I'd imagine a lot of games will have stations, and we can assign patrols to their Defence Officers if we'd want those not in the list (or vice versa).

Thinking about this a bit more, could station icons operate as extend/collapse button for their assigned ships in their sector map? A bit like how you neatly re-purposed the "+" icons. Still, if it's a faff, the idea above of just hiding assigned ships still sounds like an improvement.
Post Reply

Return to “X Rebirth - Scripts and Modding”