Jump to content
The Dark Mod Forums

Recommended Posts

Posted

After fixing a crash when showing the Difficulty editor, I noticed that the difficulty setting names on the tabs were set to meaningless placeholder strings:

readableeditor.png.a3bf36adb156c1a1efc83f2e982c3030.png

I first though this was another bug, but it seems these strings come directly from the mod data. DarkRadiant looks for an entity def called difficultyMenu, which can be found in def/tdm_difficulty.def. In this entity def, we have:

	"diff0default"			"#str_03000"		// Easy
	"diff1default"			"#str_03004"		// Medium
	"diff2default"			"#str_03011"		// Difficult

So the user-friendly default names are commented out, and the actual names that DarkRadiant sees are placeholder strings (presumably intended to be translated, but AFAIK DarkRadiant does not handle translation of mod resources).

I wonder if this is by design? Does anybody see user-friendly default difficult names in the Difficulty editor, or is this only happening on my system?

If this is a problem for everyone, I can see two possible solutions:

  • Fix the names in the entity def (less work for me, but might mess up mod translation, if that is actually a thing).
  • Move the default names somewhere else. For example, they could go directly in the DarkRadiant .game file. This does mean they would not be tightly bound with the mod data, so they would need to be updated manually if a decision was made to change the default names, but since they are only defaults (map authors can override them) maybe this does not matter.
  • Like 1
Posted

I think I see the problem here. There are three possible configurations, but all of them have significant drawbacks:

  • The current solution: default difficulty names are translatable, but DarkRadiant doesn't parse the mod-specific translation data, so they show in the interface as string table entries rather than useful text.
  • Default difficulty names are translatable, and DarkRadiant does parse the mod-specific translation data. Presumably ideal from a user perspective, but it's a huge amount of work. DarkRadiant supports translation already of course, but it's using GNU Gettext, whereas this all.lang appears to be entirely a mod-specific custom format that will need its own parsing code, and then we have to map DarkRadiant's language (specified by the standard country codes like de) into the English name for the language (!) in order to load german.lang, then possibly do something with the character mapping in the associated .map file...
  • Default difficulty names are untranslated. They will show correctly in the interface, but DR will then write the untranslated name into the map data (so the map will just specify "Easy" instead of "str_03000"), which means that the actual difficulty names shown in game will never be translated correctly even if every other part of the map is.

So there isn't really an easy solution, especially when considering that any changes must not break existing maps.

In fact I'd be tempted to go with the following nasty hack: DarkRadiant contains hard code to map the particular string table entries into English names. So when we read "str_03000" we just map it to "Easy" at the GUI level, leaving the original string table entry in the map file. Not an elegant solution but it's probably better than having useless placeholder strings in the UI for years, and I assume the placeholder is at least stable (i.e. guaranteed not to change) because this would break all existing maps.

  • Like 1
  • 5 weeks later...
Posted

Seeing as I was poking around in the Difficulty editor anyway, I went ahead and implemented editing of difficulty names, which is apparently supported by the mod but hadn't yet made it into the DR interface.

The layout is slightly changed to use a dropdown instead of tabs, which makes it possible to add a custom edit button:

diff1.png.c2de9da37f0375f0228c66fe8111512d.png

Clicking on the edit button shows a simple dialog in which you can edit the current name:

diff2.png.bd935129c33b083235d83d13296a43f6.png

The changes are then reflected in the dialog and saved into the current map:

diff3.png.d1738618b1475fa8fbc4e725c5137a59.png

I haven't tested it in game but I assume it should work because I'm writing the changes to the spawnargs specified by the wiki (and already used by DR to display the difficulty names, even if you couldn't edit them).

  • Like 2
Posted

Should be working ok, but you have to type in the #strNNNN number yourself. The id will get written to worldspawn just as if you typed it in manually in the Entity Inspector. You need to use different string IDs than the ones used by the mod, of course, otherwise it won't make much sense.

Posted

Nothing has changed regarding the translation behaviour.

If you leave the difficulty names at their defaults, they will be translated by the mod as before. DarkRadiant does not write anything into the map in this case.

If you use a custom name, that name will be written into the map and used exactly as written, as Greebo says. If you use a completely new name, like "Wakka wakka", I assume the mod is not going to be able to translate that because it won't have a string table entry, but you are free to enter a suitable string table ID if you want to use a modified name that is already recognised by the mod.

These are the strings I could find in the mod definitions, which suggest (although I have not tested) that all of these string table entries could be used for appropriate translated difficulty names:

	"#str_03000"	"Easy"
	"#str_03001"	"Casual"
	"#str_03002"	"Novice"
	"#str_03003"	"Beginner"
	"#str_03004"	"Medium"
	"#str_03005"	"Normal"
	"#str_03006"	"Challenging"
	"#str_03007"	"Expert"
	"#str_03008"	"Master"
	"#str_03009"	"Veteran"
	"#str_03010"	"Hardcore"
	"#str_03011"	"Difficult"
	"#str_03012"	"Hard"
	"#str_03013"	"Apprentice"
	"#str_03014"	"Professional"
	"#str_03015"	"Braggard"

 

 

  • Like 2

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

×
×
  • Create New...