Author Topic: [SUG] Custom Lemming names on level preview  (Read 1220 times)

0 Members and 1 Guest are viewing this topic.

Offline Kingshadow3

  • Posts: 91
    • View Profile
[SUG] Custom Lemming names on level preview
« on: May 03, 2023, 03:45:50 PM »
So on level previews, The lemming count would always say "X Lemmings". This suggestion would allow people to change what custom lemmings are described as on level preview screens.

One way that this could be implemented is for the game to check the scheme.nxmi file in the lemmings folder of a style to check whether it has lines like this (I'll use Lemminas as an example):

Code: [Select]
$LEMMING_STATS
 NAME LEMMINAS
$END

This feature would make it so that if it finds this line when using a specific theme; It would change "X Lemmings" to "X Lemminas". If it doesn't find a line like this, it will remain as "X Lemmings".

Offline WillLem

  • Moderator
  • Posts: 3473
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #1 on: May 03, 2023, 04:24:59 PM »
Yes, great idea. This one's on the to-do list.

I'll likely need help with implementing this one, but I'm sure that the codebase already has ways of supporting this sort of thing.

(Note to self: it might make more sense to do it from theme.nxtm rather than scheme.nxmi - use LemNeoTheme to set the info to a string, then call it from anywhere that displays "lemming(s)")
« Last Edit: May 03, 2023, 04:32:57 PM by WillLem »

Offline kaywhyn

  • Global Moderator
  • Posts: 1857
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #2 on: May 04, 2023, 06:28:11 AM »
Recently, when I was LPing Lemminas II, I remember at some point thinking to myself how I thought it was strange to see "50 Lemmings" instead of "50 Lemminas" on the level preview screen, so this is a great suggestion. Similarly, with Millas sprites, with the word Lemmings replaced with Millas instead, etc.

Along with this, there's probably nothing that can be done about it, but I'll just bring it up anyway: On levels where there's only 1 lemming, I know Lemmings isn't an English game, but it annoys the heck out of me that the preview screen says "1 Lemmings" instead of the grammatically correct "1 Lemming" since one of something means the noun should be singular, not plural. However, I'm being very pendantic here, and again probably nothing can be done about this, so it's fine if this can't be fixed. Let's say that even though I'm a math person and English isn't my strong point despite it being my native language, I still make every effort to correct them in my own writing/posts, so grammatical errors apparently still bother me enough for me to go over what I write.
https://www.youtube.com/channel/UCPMqwuqZ206rBWJrUC6wkrA - My YouTube channel and you can also find my playlists of Lemmings level packs that I have LPed
kaywhyn's blog: https://www.lemmingsforums.net/index.php?topic=5363.0

Offline WillLem

  • Moderator
  • Posts: 3473
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #3 on: May 04, 2023, 02:48:04 PM »
On levels where there's only 1 lemming ... it annoys the heck out of me that the preview screen says "1 Lemmings" instead of the grammatically correct "1 Lemming"

If we allow different "names" for the Lemmings (Lemminas, Millas, etc), then there's nothing stopping someone from renaming their set to "Sheep" or "Mice", for example. Then, it would look silly the other way around: "40 Sheeps", "40 Mices", etc.

So, it's a case of one or the other, really. I can either correct the grammar and have it display "1 Lemming", "2 Lemmings" ... or allow renaming the lems to something else: "1 Millas", "2 Millas" ...

However, there may be another way to address this. I could print "Number of XXX: YY" instead. For example, "Number of Lemmings: 1" is not as grammatically wonky as "1 Lemmings". But, then we have the issue of when levels contain Neutrals and Zombies as well...

Offline Proxima

  • Posts: 4573
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #4 on: May 04, 2023, 03:28:37 PM »
It would require a bit more code to check whether the number is 1 and read from the file accordingly, but you could make the singular form separately definable:

Code: [Select]
$LEMMING_STATS
  NAME Lemminas
  SINGULAR Lemmina
$END

Offline WillLem

  • Moderator
  • Posts: 3473
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #5 on: May 04, 2023, 04:25:53 PM »
It would require a bit more code to check whether the number is 1 and read from the file accordingly, but you could make the singular form separately definable:

Hmm.

That could work :)

One thing at a time, though. I'll see if I can get the name changes done, and from there see how doable it is to implement a singular variant.
« Last Edit: May 06, 2023, 02:29:40 AM by WillLem »

Offline WillLem

  • Moderator
  • Posts: 3473
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #6 on: May 26, 2023, 10:02:47 PM »
Due to how the codebase is structured, the Preview and Postview screens aren't currently set up to access theme info (and I seem to constantly have problems trying to access stuff that isn't already set up to be accessed, so that route is pretty much a write-off) - they are, however, set up to access Level info.

So, it might be best to do this via the Level info. The input could still be theme.nxtm, and the Editor could "get" the custom names from the theme and auto-populate a dialog, which then in turn writes this info to the level. As convoluted as this sounds, it might actually be easier and make more sense than trying to crowbar theme data into the preview/postview screen logic.
  Never mind, I figured it out :)

Another question is, how far do we want to take this? Should the custom names display wherever they possibly can, or just on preview/postview. Should the levelinfo icons also be customisable? I think yes, but this won't be trivial to implement.

Now's the time to speak up if you have any ideas regarding this.
« Last Edit: May 28, 2023, 10:54:09 PM by WillLem »

Offline Floyd Brannon

  • Posts: 41
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #7 on: May 27, 2023, 05:25:50 PM »
I am for this idea! And probably seems best to display wherever it can be displayed.
I'm guessing levelinfo icons will allow the skill buttons to match the theme? Putting these on the preview screen might be a cool option too.

Offline jkapp76

  • Posts: 388
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #8 on: May 28, 2023, 04:11:27 AM »
This definitely seems like an improvement to me. Better and more proper English is always good too.
I don't understand all the in's and out's of the programming, but it looks good to me to see Lemminas and such here.
The singular name use would be good too someday.
« Last Edit: May 29, 2023, 05:07:45 PM by jkapp76 »
...Jeremy Kapp

Offline WillLem

  • Moderator
  • Posts: 3473
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #9 on: May 28, 2023, 11:32:58 PM »
OK, so we now have this feature implemented as originally suggested! Managed to find a way for the preview/postview screens to access the theme info, so this is how the names can be changed for display on these screens:

In styles/name_of_style/theme.nxtm:

Code: [Select]
  LEMMINGS name_of_style
  NAMES Name_of_Lemmings

   //other style info...

For style creators: Replace 'name_of_style' with the desired style in which the custom sprites live (e.g. willlem_lemminas, gigalem_millas, flopsy_soniclems) and 'Name_of_Lemmings' with the name you wish to appear, in plural form, and preferably with a capital letter (e.g. Lemminas, Millas, Soniclems), and this name will appear on the preview and postview screens of any levels which use these sprites!

I've had a look through the Level Select menu, and I don't think that the names of the lemmings get printed anywhere in there, so there's not any need for the info to be accessed there. However, we may wish to use custom icons for skills info, etc. in the level preview area. This won't be as easy, but is possible in theory. I've created a new topic for this and I'll look into it when I have time.

Also, I'm thinking that it would be good to implement Proxima's suggestion of singular/plural differentiation...



Custom lemming names implemented in commit ae9c42c23, with revisions in commit a61792dea
« Last Edit: May 29, 2023, 08:35:40 PM by WillLem »

Offline WillLem

  • Moderator
  • Posts: 3473
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Custom Lemming names on level preview
« Reply #10 on: May 29, 2023, 08:42:45 PM »
OK, so it turns out that implementing the Singular/Plural forms wasn't as difficult as I thought it might be. Commit 86a480fca sees this fully included; I've done some minimal testing, and it all seems to work as expected!

Style Authors: Here's are some examples of how to modify theme.nxtm to include custom lem names for your sprites sets. Default sets will always read "Lemming / Lemmings" (that's hard-coded), so you don't need to include this if you're using the defaults, I've only done so here as a template/example:

Code: [Select]
LEMMINGS default
NAMES_PLURAL Lemmings
NAMES_SINGULAR Lemming

 //other style info...

Code: [Select]
LEMMINGS willlem_lemminas
NAMES_PLURAL Lemminas
NAMES_SINGULAR Lemmina

 //other style info...

Code: [Select]
LEMMINGS flopsy_soniclems
NAMES_PLURAL SonicLems
NAMES_SINGULAR SonicLem

 //other style info...

Code: [Select]
LEMMINGS hypothetical_geese
NAMES_PLURAL Geese
NAMES_SINGULAR Goose

 //other style info...