Author Topic: NeoLemmix QuickMod tool (for quickly changing entire pack stats / skillsets)  (Read 3806 times)

0 Members and 1 Guest are viewing this topic.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
I made this in particular with the Save-Em-Up challenge in mind, but this could be useful in general for various challenges (and perhaps some other uses) so uploading here.

This tool allows you to quickly apply the following modifications to an entire pack in one go:
- Changing the lemming count
- Changing the save requirement
- Changing the RR (including whether or not it's locked)
- Changing the time limit
- Changing the skillset
- Removing talismans
- Removing preplaced lemmings
- Removing special properties on lemmings / entrances / exits (ie: removes zombie / neutral status, as well as lemming count caps)*
- Modifying level IDs**

* this one mostly exists for Save-Em-Up contest purposes
** note that it derives the new one from the existing one, rather than outright generating a new one at random


To use:

1. Download and put in your base NL folder.
2. Run the app.
3. Select the pack you want to modify from the list (you might want to create a copy of it rather than modifying the original version).
4. In the "level stats" section, for each thing you want to change, check the checkbox and type in the amount you want to set it to. Time limit is in seconds; enter zero for unlimited. (If you want to leave the RR's locked/unlocked status unchanged, don't tick either the "Lock RR" or "Unlock RR" box. For everything else, leave the checkbox unticked to leave unchanged.)
5. If you want to replace the skillset, check the "Apply Custom Skillset" checkbox then enter your skillset; enter 100 (or higher) for unlimited. Note that this is not validated - it will not ensure that you only have 10 skills, nor will it account for pickups in any way.
6. Click "Apply".

The output NXLV files will have the original lines for modded stats / skillsets commented out (rather than erased altogether), with the new ones added at the end of the file. This makes no difference to how NL interprets the file, but makes it possible to recover the original values if need be. If you are using this for actual to-be-released levels (rather than just challenges / personal experiments), it is strongly recommended that you run the output through Cleanse Levels before releasing it, to tidy this up.

If it is not working correctly on any given level / pack, please try running the pack / level in question through Cleanse Levels first, before reporting any issues. If the issue persists after this, report it.

Note that there is currently no way to make this app take spawn intervals instead of release rates - I can add that later if there's demand. To convert a spawn interval to a release rate, subtract it from 103.

Source code is in the NL source code repo, under the "Tools" folder.
« Last Edit: March 13, 2021, 06:34:57 AM by namida »
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Nice! It would be good if this could also generate random ID's for every level as well.

Offline Proxima

  • Posts: 4562
    • View Profile
I know it's rather presumptuous to ask for more features when you are already doing so much development work, but I had a couple more ideas for things it would be great to be able to mass-change:

* Remove all backgrounds, or set all backgrounds to a particular one
* Set all objects of a chosen type to no-overwrite (I know I've brought this idea up before, but I can't remember whether anything came of it)
* Remove all talismans.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
This is mostly designed for use in challenges, not as a general-use tool.

ID change and talisman removal are a good idea given the intended use case of this tool. I do wonder if the ID should be derived from the existing one in a consistent way, rather than outright random...

Background changing not so much (though this is pretty easily done with a find-in-files Regex, let me know on Discord if you need some help with how to put it together). Setting objects of a certain type - if you mean "a certain type" as in exits vs water etc, this tool doesn't load any information about objects so it wouldn't be able to tell the type. If you mean more like "set all instances of the object called "water" from the graphic set "orig_marble" to no overwrite", that's a bit more practical, though I still feel it's beyond the scope of this tool.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
* Set all objects of a chosen type to no-overwrite

There's a RegEx for this using Notepad++

Objects appear as $GADGET in .nxlv files, so the way to do it would be to choose Find in Files, go to Replace, and enter the following:

Find what: \$GADGET

Replace with: \$GADGET\n  NO_OVERWRITE

And make sure that Regular Expression is checked. It should look like this:



N.B. This will insert "NO_OVERWRITE" for all objects, including those that already specify it. I'm not sure what happens in this instance, but I'd guess that the double entry would just be ignored.



Alternatively, if you want to specifically change a particular object (for example, an exit), but within any style, try the following:

Find what: \$GADGET(.*?)PIECE exit\r?\n

Replace with: \$GADGET\1PIECE exit\n  NO_OVERWRITE\n
« Last Edit: January 20, 2021, 03:42:06 AM by WillLem »

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
I've uploaded a new version which adds two new features - removing talismans, and altering level IDs. Note that unless it is unable to load a level's existing ID for some reason, it won't generate one at random - rather, it derives a new one from the existing one. This is so that, if you were to run the tool again on the same level, the resulting level would have the same ID as last time. I feel that the benefit of this, outweighs the negative side of that two different derivatives via this tool would end up with the same IDs (if you're using this for your own, serious projects, make sure to set completely new IDs altogether).

Additionally, it now displays a version number in the lower-right corner. The new update has been labelled v0.02.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
unless it is unable to load a level's existing ID for some reason, it won't generate one at random - rather, it derives a new one from the existing one. This is so that, if you were to run the tool again on the same level, the resulting level would have the same ID as last time

Just so I understand this...

So, say you have level ID ABCDEF123456, and you run the ID changer on it once, you might end up with (for example): ABCDEF123457

Have I understood correctly that running it again on this level would revert it to ABCDEF123456 (i.e. "the same ID as last time")?

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
unless it is unable to load a level's existing ID for some reason, it won't generate one at random - rather, it derives a new one from the existing one. This is so that, if you were to run the tool again on the same level, the resulting level would have the same ID as last time

Just so I understand this...

So, say you have level ID ABCDEF123456, and you run the ID changer on it once, you might end up with (for example): ABCDEF123457

Have I understood correctly that running it again on this level would revert it to ABCDEF123456 (i.e. "the same ID as last time")?

No. It means that let's say you have an original level, "Level A". You run the quickmod tool on it, to create Level B. You then run the quickmod tool on the original level A again (not on level B), to create Level C.

In this case, Level B and Level C will have the same ID as each other.

To be precise - it creates the new ID by taking the old ID, moving the first digit to the end, and subtracting 1 from it. So for example, "8765432187654321" would become "7654321876543217" (the 8 at the start is moved to the end, then 1 is subtracted from it). If you were to do it a second time, it'd then become "6543218765432176" (7 at the start moved to end, then 1 subtracted), etc. In the case that this is a 0, it loops around to become an F but this does not carry over to the previous digit - so eg "0123456789ABCDEF" would become "123456789ABCDEFF", not "123456789ABCDEEF" (the -1 doesn't "carry" to the 2nd-to-last digit).
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Uploaded a new version, which fixes a bug with time limits and adds a couple more options.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline mobius

  • Posts: 2747
  • relax.
    • View Profile
thanks enormously for this :thumbsup:
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain