Dredmor Mod Manager v1.0.1 + 3 Example Mods (Win/Mac 32bit/64bit)

Discussion in 'Modding' started by J-Factor, Aug 5, 2011.

  1. J-Factor

    J-Factor Member

    I've been working on a mod manager as it may be awhile before official support for mods is added.

    Dredmor Mod Manager v1.0.1

    [​IMG]

    - Supports loading mods from .zip files
    - Automatically merges XML
    - Includes 3 example mods

    Currently only XML based mods are supported. This is written in Java so I'm only distributing the .jar file.

    Example Mods
    Better Wand Lore
    - Added ability to smelt burned out wands into Arcane Wands
    - Made Arcane Wands into joke wands that don't cast anything
    - Swapped Wand Hack and Rod Charge order in the skill tree

    Better Potions
    - Changed Spatial Instability Infusion to teleport you more vigorously
    - Changed Potion of Midas to invoke Curse of the Golden Ratio on hit

    Lutefisk Stacks Fix
    - Changed Lutefisk divider to treat stacks the same as individual items when Skoling them

    Download

    Windows 32-bit
    Windows 64-bit
    Mac 32-bit
    Mac 64-bit

    Note: I haven't tested the 64-bit or Mac versions. If you have any problems let me know.

    Changelog

    1.0.0:
    - Initial release

    1.0.1:
    - Added version string to window title
    - Changed craftDB.xml merging rules to insert mod XML at the top of the file. This now allows mod recipes to show up in-game.

    Be sure to read the readme as it explains how to make your own mods.

    Warning: Using mods can mess up your save file! Always use the same mods with the same save file.
     
  2. DavidB1111

    DavidB1111 Member

    - Changed Spatial Instability Infusion to teleport you more vigorously

    That sounds awkward....and slightly wrong...
    But nice to see this.
     
  3. Patchumz

    Patchumz Member

    Isn't Mac support simply adding the correct Mac paths for the files?
     
  4. J-Factor

    J-Factor Member

    @Patch

    Well in theory I just have to rebuild it with the Mac version of the SWT library I'm using for the native-style GUI. Just thought I'd test it on a Mac first before releasing that.

    It already prompts you to select your dredmor folder.
     
  5. Patchumz

    Patchumz Member

    Ah, just shocked that a java app isn't Mac native from the get-go :p.
     
  6. decarthado

    decarthado Member

    It no workey for me.
    ===
    Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SW
    T libraries on 64-bit JVM
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
    at org.eclipse.swt.widgets.Widget.<clinit>(Unknown Source)
    at App.Main.getShell(Main.java:366)
    at App.Main.loadConfig(Main.java:66)
    at App.Main.init(Main.java:631)
    at App.Main.main(Main.java:697)
     
  7. J-Factor

    J-Factor Member

    @decarthado
    Yeah, just realised that I'll also need to include the 64-bit version of the SWT library. Maybe I should've just used Swing...

    I'll try to have some compatible versions up later today. Reading about including all versions of the library in one Jar. Thanks for checking it out though!
     
  8. rmuk

    rmuk Member

    Very cool, thanks for putting this together J-Factor, seems to be working A-Ok for me!

    How did you figure out the directory / file structure etc. for modding? Just experimenting with it or is it documented somewhere?
     
  9. J-Factor

    J-Factor Member

    Just experimenting.

    All of the game's XML files are in the same directory which simplifies things. I started with a general-case for the merging logic: copy the mod's XML into the game's equivalent XML file at the start of the 'main' tag (e.g. just after <code><craftDB></code>). I then specialised depending on the file:

    - tweakDB.xml needed the mod XML to be <i>after</i> the game's XML in order to overrule it.
    - skillDB.xml needed the ability to modify existing skills. In this case I had to actually replace parts of the game's XML instead of just appending to it. Here I replace any skill that has the same skill number (e.g. 30) and level if the mod has defined it. This let me swap Wand Hack and Rod Charge in my example mod. I had to do the same with spellDB.xml to let me change the 'Touch of Midas' effects.

    I imagine I'll need to keep adding tweaks as I try out modding the rest of the XML files. A lot of this depends on various quirks in the way the game loads the XML files.
     
  10. J-Factor

    J-Factor Member

    Alright I've uploaded versions for Win/Mac and 32bit/64bit. Let me know if you have any problems.

    I'm planning on updating the mod "format" to support all of the game's directories instead of just the XML "game" directory. This would allow mods to add custom graphics, sounds, etc.
     
  11. kryft

    kryft Member

    Nice!
     
  12. rusticdog

    rusticdog Member

    Is it known what causes the recipes to show up or not. I cannot see a recipe I made when I load it (and the itemDB) using a mod, but if I shift the recipe to the top of the file it seems to show the recipe just fine.
     
  13. J-Factor

    J-Factor Member

    @rusticdog

    Thanks for the feedback. I've uploaded v1.0.1 which now includes:
    - A version string in the window title so people know which version they're running
    - craftDB.xml now merges the mod XML at the top of the file instead of the bottom

    This should fix the issue for you. I'm not sure why the recipes aren't shown when they're at the bottom (and I'm hoping it's not some kind of hard-coded limit that means new recipes at the top 'push off' recipes at the bottom). I'll try testing some more.
     
  14. kriegshetzer

    kriegshetzer Member

    Won't start for some reason when opening with javaw.exe?
    Am I doing something wrong?
     
  15. rusticdog

    rusticdog Member

    Yeap that's showing all the wands from the example mod as well that weren't there previous. I unhid a few of the lower recipes and they still loaded as well, so I've not noticed any weirdness by placing at the top just yet.


    Unfortunately I didn't realise lockpicks weren't in the item file, so there's no lockpick item type....which probably explains the autoloot bug when they weren't being picked up.....but means no lockpick recipe for me :( ....will have to stick to burglary for the time being.
     
  16. J-Factor

    J-Factor Member

    @kriegshetzer
    Is any error message shown or does it just silently fail to start when you double click the jar? You shouldn't have to manually open it with javaw.exe, although it should work with the command <code>javaw.exe -jar "Dredmor Mod Manager.jar"</code>.

    Did you download the correct version? There's a 32-bit and 64-bit jar depending on your OS. If you're running Windows 7 you can find out if you're 64-bit by going into Control Panel : System.

    Otherwise all I can suggest is updating your Java version.

    @rusticdog
    You could try making a kind of interstitial object, like the Odious Puffball, that when used triggers the Lucky Pick spell.
     
  17. rusticdog

    rusticdog Member

    @J-Factor

    Yeah, that was something I'd fooled around with, it does bother me slightly he eats a chicken to create lockpicks, but it's working none-the-less :)

    My new icon for the 'Thieves Tools' keeps reverting to 4bit and not 8bit. Which is a problem as 4bit PNGs crash DoD when you try to bring up the crafting screen. Will keep tooling around :)
     
  18. This is pretty nice J-Factor.

    Did some mucking about to see the format you used, assuming it just appends the lines to the end of the XML files? Looking to fix a few things myself, like make Blasting damage actually work, so Viking Magic isn't total garbage, along with countless weapons.
     
  19. J-Factor

    J-Factor Member

    @OgreSamanosuke
    It's mostly just appending although I had to do some tweaks for skillDB.xml and spellDB.xml. For these I first remove any of the existing spells/skills that match the ones that have been defined by the mod. For example, with spellDB.xml:

    <code>newGameFileLines = filterOutTagsWithPatterns(
    gameFileLines,
    modFileLines,
    "(<spell name=\"[\\s\\w]+\")",
    "(</spell>)"
    );</code>

    This removes any of the existing spells that have the same <code><spell name="...</code> start tag as one of the mod's spells. I explain some of this <a href="#Comment_5317">here</a>.

    I've uploaded 1.0.1 again except with the source included. Rename the .jar to .zip and you can find it in the App folder. The whole thing is just a single 700 line file called "Main.java".
     
  20. Well, I can fix the spells that use blasting, but no clue where the item enchant modifiers are stored, so any item that gives/resists blasting is still broken. Debating if I should bother posting it as it, does at least make Viking Magic less suck.

    As for the source, you don't need to do that. :p If you right click on a Jar file and select Open with... and pick WinRAR, it'll inherently tear it open for you, no need to rename.