Sign in to follow this  
lianite

[Alpha] Wurm Tweaker

Recommended Posts

I have found altering base mechanics of Wurm to be an exercise in exasperation. The only way to do so has been to learn Java, Javaassist, and other tools for modifying the code. Coming from a web development background, it has been very strange to me that all the data is hardcoded in java files instead of being read from the database.

 

This is my first attempt to fix those issues. I present to you the first in a series of database driven modifications to Wurm!

 

Currently Implemented

  • Item modifications (itemOverrides table in modsupport.db)
    • This is ID based, and works with any items added to Wurm either from the base game or from other mods
    • "Nearly" everything in the table is currently functional
      • Not currently functional fields: imageNumber, behaviorType, updateExisting

 

Coming Soon

  • updateExisting database field (will update all existing items in the world to the new "standard" as defined by the custom overrides)
  • New Item additions
  • Custom Crafting recipes
  • Creature modifications
  • New Creature additions

 

All of this is designed to help map creators custom tailor the experience they desire without needing to bog themselves down with trying to figure out how to translate the changes they desire into mods.

 

This is also my first attempt at contributing to the Wurm Unlimited modding ecosystem, and I hope to continue well into the future. If there are any suggestions as additions or changes to this, I welcome feedback.

 

Github Download

 

Field Explanations

  • templateId: Required for matching item
  • name: (Optional) String to replace the name
  • plural: (Optional) String to replace the plural name
  • itemDescriptionSuperb: (Optional) Superb item description
  • itemDescriptionNormal: (Optional) Standard item description
  • itemDescriptionBad: (Optional) Moderate damage description
  • itemDescriptionRotten: (Optional) Critical damage description
  • itemDescriptionLong: (Optional) Full description of the item
  • itemTypes: (Optional) String of comma separated numbers to control the behavior of the item
  • imageNumber: (Not currently functional) Changes the icon of the item in an inventory
  • behaviorType: (Not currently functional) Exact effect unknown
  • combatDamage: (Optional) Number for base damage when use in combat
  • decayTime: (Optional) Number for how long it takes for an item to decay
  • centimetersX: (Optional) Number for size in the X dimension
  • centimetersY: (Optional) Number for size in the Y dimension
  • centimetersZ: (Optional) Number for size in the Z dimension
  • primarySkill: (Optional) Number of the primary skill associated with this item
  • bodySpaces: (Optional) String of comma separated numbers to control which body space this can be equipped to
  • modelName: (Optional) String of the model to use for this item when in the game world
  • difficulty: (Optional) Number to set the difficulty of the item (controls creation chance)
  • weightGrams: (Optional) Number for the weight of the item
  • material: (Optional) Number whose exact purpose is not currently known, change at own risk
  • size: (Optional) Number representing the size of the item (1 = tiny, 2 = small, 4 = large, 5 = huge)
  • value: (Optional) Number controlling trade value of the item in irons
  • isPurchased: (Optional) Boolean whos exact value is not known right now
  • dyeAmountGramsOverride: (Optional) Number that controls how much dye the item takes to color
  • updateExisting: (Not currently functional) 1 or 0 controlling on whether to push changes to items database and update existing items in the world

 

Requirements

  • Scriptrunner
  • Basic knowledge of editing sqlite table (modsupport.db)

 

At some point in the future when I finally decide to bite the bullet and get a Java development environment set up and understand the process, I'll convert all of this to a Java based mod instead of javascript, thus allowing some of the fields to function better. But for now, this will be a javascript based implementation as that I what I know the best.

Edited by lianite

Share this post


Link to post
Share on other sites

Great concept, but the download is still all just a foreign language to me. I wonder if it would help if you could give a sample of a tweak that someone might make?  Where and how would they use this mod to tweak it?

Share this post


Link to post
Share on other sites

Completely understandable. Once this is installed on a server, the next startup of that server will initialize a table in the modsupport.db file (I use DB Browser for SQLite to interact with it). Once that is done, any entries you add to the table will get applied on the following restart.

 

As an example, I added a difficulty override for making lumps through alchemy on a challenge map that I am helping manage (The Winter Expanse). So for each of the basic metal lumps, I created a record in the itemOverrides table, where the templateId was the ID for the item I want to override, in my case, we'll use gold lumps for the example, so 44. Then in that same row in the database, I changed difficulty to 25, which would indicate that (I could be wrong on my calculations here), that with 25 skill, you would have approximately 50% chance of making the item.

 

Ultimately, what this does is remove the need for specific mods for item edits, and instead pull them out to the database, which is much easier to edit, and once you understand the table, incredibly easy to make a large quantity of changes. (I'll try to get some images uploaded of the database entries so it is easier to see what I'm talking about)

Edited by lianite
  • Like 1

Share this post


Link to post
Share on other sites

@lianiteI think I get it!  Yes, editing a db is so much easier to understand for a non-coder than making or tweaking a mod.  Thanks!  🙂

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this