Starbound

Starbound

Ancient Blade
Azure Fang 29 Jul, 2017 @ 9:08am
Mod Critique + Assistance
So, I unpacked your mod to see if I could find anything to help you on, and I've come up with a few considerations I hope you will look into:

1) Never overwrite vanilla files whenever possible. For example, your mod overwrites monster.treasurepools (among others). By doing so, your mod breaks any other mod relying on monster.treasurepools that was loaded earlier in the load order (such as my 100% Boss Unique Drops mod is someone subscribes to your mod after mine). Whenever possible, use the .patch method to avoid compatibility issues, as you did with player.config.patch. I will add a patch version in a lower post here to help you along, plus some additional considerations, and a couple tools that will make your life a LOT easier.

2) Whenever creating custom assets, devtag your assets and internal names to make them more unique. For example, the itemname of your weapon is "ancientsword" - not especially unique, meaning there's a pretty good chance that another modder with a little less diligence could create another "ancientsword" causing crashes for anyone that installs both mods at once. Instead, consider using "as_ancientsword" (as=Ancient Sword, mod name) or "dl_ancientsword" (dl=DracoLord) to lower the chance of mod overlap, which can cause mismatched graphics or crashes.
Last edited by Azure Fang; 29 Jul, 2017 @ 9:56am
< >
Showing 1-5 of 5 comments
Azure Fang 29 Jul, 2017 @ 9:28am 
Looking at your files, you seem familiar with patching, as shown with player.config.patch. Patching the treasurepools, or any of the JSON-based files for that matter, isn't too dissimilar. For example, a proper patch for your treasurepool would be this:
[ { "op": "add", "path": "/guardianTreasure/0/1/pool/-", "value": { "weight": 0.1, "item": "ancientsword" } } ]
This will alter the pool as you intended, placing the sword at the bottom of the pool with a weight of 0.1, leaving the pool with a total weight of 1.1 - a non-issue since the game (as I have recently learned) takes the total pool weight into account before running probability.

But if you wanted to scale back the pool to 1.0, this can be achieved in an alternate version of the same patch:
[ { "op": "replace", "path": "/guardianTreasure/0/1/pool/0/weight", "value": 0.9 }, { "op": "add", "path": "/guardianTreasure/0/1/pool/-", "value": { "weight": 0.1, "item": "ancientsword" } } ]
In order, this patch will then shift {"weight" : 1.00, "pool" : "microformerTreasure"} down to {"weight" : 0.9, "pool" : "microformerTreasure"}, then append {"weight" : 0.1, "item" : "ancientsword"} to the bottom as intended.

I will leave the patching of /items/buildscripts/weaponabilities.config to you, unless you need help.
Azure Fang 29 Jul, 2017 @ 9:40am 
As to devtagging, this has been common practice for modders for many years. It's not a necessity by any right, but is more a courtesy toward your subscribers as well as other moders to help improve the chance of compatibility between mods.

As stated in the OP, it's as easy as appending a three character prefix to the front of your assets, as well as internal names, to offset the chance that someone else maay use the same name in another mod (I've met a few modders that go so far as generating truly unique hexadecimal hashes to replace asset names - I'm not that hardcore and I don't recommend doing so unless you either plan on keeping a logbook of your asset names or have eidetic memory). For example, your your Ancient Sword, you'd just need to append something like "as_" or "dl_" to the filenames and internal name of the item, and then adjust the code calls accordingly.

It should go without saying, but you only need to do this for "custom assets", new files, folders, and internal names that you introduce. .patch files will only work if they match the path and name of the file they are patching, so never devtag a .patch.
Azure Fang 29 Jul, 2017 @ 9:53am 
There are a few sites that can greatly assist in patch creation (honestly, I doubt I would have ever published half of the mods I have without them.

http://chbrown.github.io/rfc6902/
This will create patches for you, by comparing the base file to how the file should look after the patch has been applied, or will test a patch against the base file and will either output the result or throw a fit error.

http://json.parser.online.fr/
Will parse the input and will either greenlight the code or tell you where it found an error, with approximate highlighting (brackets and commas are the bane of my existence, so this gets a LOT of use from me). The site can be finicky if you run adblockers, so you may need to reload it once or twice on occasion to get the input box to appear.

http://trinithis.awardspace.com/commentStripper/stripper.html
Removes //comments from code, which throw errors when testing code or tossing them into most tools (like those listed above). Very useful for stripping comments from vanilla files before throwing them into the patch generator.

http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/
The | Suit's amazing .patch tutorial, in case you didn't already know about it.
Goober  [developer] 29 Jul, 2017 @ 10:07am 
Thanks a ton for the advice. I'll be sure to go over the mod and make a patch for the monster treasure pool, as well as devtag what I need to in my mod. I have no problem with the criticism and really appreciate it.
Azure Fang 29 Jul, 2017 @ 10:09am 
Originally posted by Dracolord1500:
Thanks a ton for the advice. I'll be sure to go over the mod and make a patch for the monster treasure pool, as well as devtag what I need to in my mod. I have no problem with the criticism and really appreciate it.
No problem. Like I said, don't forget to convert your /items/buildscripts/weaponabilities.config to a patch as well, as not doing so will also cause compatibility issues.
< >
Showing 1-5 of 5 comments
Per page: 1530 50