# Automatically select active mission based on the map being edited

## Recommended Posts

Figured I'd ask about this here before posting on the bug tracker, there might be a reason why it hasn't been done yet. Let me explain my reasoning first:

When creators are working on multiple FM's at once, each one will obviously be located in its own directory. Most FM's contain custom assets and definitions, when working with maps in DarkRadiant you need to select their data folder for additional defs. This is done by going to File - Game / Project Setup - Mission and selecting it there.

The issue: Let's say you want to take a break from one FM and work on another. Each time you load a map from a different FM, you also need to go to that menu and select it from there, otherwise custom assets won't be detected and appear as missing in DR. This is quite a bit of an annoyance.

Suggestion: Is it not possible to detect and automatically select the active mission from the path the map is located in? We know every map should be located in "darkmod/fms/name/maps", so why not automatically extract the maps directory and set that to "darkmod/fms/name"? If there's an issue with getting such detection right, we can at worst simply store this information in the map.darkradiant file, so even if the player needs to first select it manually the choice is remembered per map and automatically reverted when you load it.

We could technically do this with the other settings in that menu, such as Game Type and Darkmod Path. Not sure how much we need it for those unless someone is working with multiple installs and wants the convenience. Sounds good if doable but the important one is the mission directory as that must always be changed with the map you're editing.

##### Share on other sites

Changing the project/game setup and paths is a pretty massive change from DR's perspective. Almost everything needs to be re-initialised when setting the paths, which sometimes takes longer than a clean restart. (For similar reasons, the TDM engine itself needs to be restarted completely when you install a FM.) DR is able to make that leap while keeping the same process alive, but it's a very expensive step, and it's better to restart to clean up any resources that are left behind when switching configs (for instance, all defs that have been loaded from another map/project are kept in memory.)

From a design perspective, I'd rather not have loading a map implicitly change the whole project setup. At some points it might not be deducible or even wanted to have the paths changed on map load.

When regularly switching between projects, a possible help might be to create separate DarkRadiant shortcuts, passing the FM project path as argument to DarkRadiant.exe.

##### Share on other sites

28 minutes ago, greebo said:

When regularly switching between projects, a possible help might be to create separate DarkRadiant shortcuts, passing the FM project path as argument to DarkRadiant.exe.

Can you give an example of such shortcut? Or is this still only an idea?

##### Share on other sites

53 minutes ago, greebo said:

Changing the project/game setup and paths is a pretty massive change from DR's perspective. Almost everything needs to be re-initialised when setting the paths, which sometimes takes longer than a clean restart. (For similar reasons, the TDM engine itself needs to be restarted completely when you install a FM.) DR is able to make that leap while keeping the same process alive, but it's a very expensive step, and it's better to restart to clean up any resources that are left behind when switching configs (for instance, all defs that have been loaded from another map/project are kept in memory.)

From a design perspective, I'd rather not have loading a map implicitly change the whole project setup. At some points it might not be deducible or even wanted to have the paths changed on map load.

When regularly switching between projects, a possible help might be to create separate DarkRadiant shortcuts, passing the FM project path as argument to DarkRadiant.exe.

Thanks for the explanation. My only remaining curiosity then: Would it make sense to offer it as an option still (off by default) for those who don't find a performance an issue? I haven't noticed much additional reload time when changing the active FM in DarkRadiant so I could likely use it well. But I can understand why this change might not be possible.

And I'd love to know what that command line parameter for DarkRadiant is! I use Linux but presume they're named the same way as the Windows exe. I already use a custom shortcut to launch TDM for testing my FM without changing the selected FM, via the super helpful "+set fs_currentfm my_fm_name" argument: I take it for DR it's something similar?

##### Share on other sites

The shortcut variant is something like this:

Depending on whether you have spaces in your paths, some quoting might be required.

##### Share on other sites

This works well (tested under Linux), thanks. You do have to specify it for all shortcuts, because the shortcut changes the setting for all future startups of DR (until another shortcut changes it).

##### Share on other sites

6 hours ago, datiswous said:

This works well (tested under Linux), thanks. You do have to specify it for all shortcuts, because the shortcut changes the setting for all future startups of DR (until another shortcut changes it).

Is there also a parameter to load the map in cause? For single-map FM's this would also make the shortcut open exactly the map you need so you don't have to look for it and open separately.

##### Share on other sites

I think you can just pass the map file name along as another argument.

• 1
• 1
##### Share on other sites

11 hours ago, greebo said:

I think you can just pass the map file name along as another argument.

Got it, tested and it works! For anyone else looking to use this trick, these are the full arguments you need to pass to your shortcut and add after darkradiant.exe, obviously for your respective FM and OS:

/home/mircea/Games/Quake/TheDarkMod/darkmod/fms/testing/maps/test.map fs_game=fms/testing

Note that for thedarkmod.exe you need a different format for some reason, it's "+set var val" instead of "var=val".

+set fs_currentfm testing

But you can't use the Recent Files list to jump between editing FM's and have it automatically work: If my suggestion is possible as an option I hope you can keep it in mind. For now I'll add those shortcuts to every FM I'm editing which helps!

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• It's funny how perception changes over the years. I've been replaying Bioshock in its Remastered version, and I'm surprised how bad the level design actually is. It's just a series of abstract corridor mazes that you can't really map out in your head. There's nothing that would ground them in any kind of reality, fictional or otherwise, no sense of place people could live in. It's almost like Wolfenstein 3d with cool art deco assets.
• Anyone here played Inscryption? At first, I was like "no, I am not going to play a stupid card game", but this game is so much more than that. It is so meta, full of 4th wall breaks, and feels so damn spooky and weird because of it. Absolutely recommended, if you can stand the visuals. I recommend not reading up too much on it, as that could easily spoil half the incredible surprises. Just know that what you see in the beginning is by far not everything.
• Tried to make a tdm advertisement commentpost at one of civvie11 youtube videos about T2. Post got marked as spam. His problem (to not discover TDM for himself),..not my problem.
But some help of some fellow TDM yt-videocomment posters would be nice. To ask him and others, to play TDM. To get more players/creators.
• Currently Profile Information has 3 fields, these are shown in forum posts under your avatar:
1. Gender
2. Location
3. Interests
I think that it could be useful to have an extra field called "Operating system" (under location). It can be useful for tech support and to see what people use.
Alternatively it could be a more general term, like PC system, so that you can for example state that you use an AMD gpu.
• Greetings fellow kids.
×