Jump to content
The Dark Mod Forums

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.

Screenshot_20221124_162508.png.d362333067e8c47eea8fbac2dceedcf7.png

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.

  • Like 1
Link to comment
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.

 

 

  • Thanks 1
Link to comment
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?

  • Like 1
Link to comment
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.

Link to comment
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!

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 5 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...