ValheimMods icon indicating copy to clipboard operation
ValheimMods copied to clipboard

Custom Equipment

Open HumbleSage0 opened this issue 3 years ago • 7 comments

Loving this mod. Thanks for all your hard work. I was playing with the json files and was able to get custom legendary equipment working to a point. Can't seem to find a way to create a custom set of legendary claws (couldn't find identifiers or anything related to variable related to them, tried default wiki ID's no go). Guessing you don't have them in your mod? My request would be:

  1. Can we get a tutorial on adding our own custom legendaries? Searched around nothing was really clear or couldn't find a definitive way to do it.
  2. How to set a legendary item to be a specific item ie "AllowedItemTypes": [ "FistFenrirClaw" ] (I know that AllowItemTypes is not correct here, hoping you get my drift).
  3. Can you add claws? (if this is required in your code).

Thanks. :)

HumbleSage0 avatar Nov 10 '22 02:11 HumbleSage0

I am not sure there is currently a good tutorial for what you are looking for explicitly. Though if you check the info.md file, there is some information for what you are looking for...

  1. You should be able to do this by editing the JSON files as you outline above, just make certain you link the IDs as required
  2. "AllowedItemName": ["$fist_fenrir_claws"] would be the pattern but allowed though I don't think this is the correct ID from the info.md file: * **AllowedItemNames:** This effect may only be rolled on an item with one of these names. Use the unlocalized shared name, i.e.: '$item_sword_iron'
  3. you should be able to accomplish this using the unarmed type, though I have not tested it. See below

NOTE I have not tested this (yet)

for example, consider Mjolnir here

 {
      "ID": "Mjolnir",
      "Name": "$mod_epicloot_l_mjolnir",
      "Description": "$mod_epicloot_l_mjolnir_desc",
      "EquipFx": "LightningAuraSledge",
      "EquipFxMode": "EquipRoot", 
      "Requirements": {
        "AllowedItemNames": [ "$item_sledge_iron" ]
      },
      "GuaranteedEffectCount": 6,
      "GuaranteedMagicEffects": [
        { "Type": "ModifyPhysicalDamage", "Values": { "MinValue": 36, "MaxValue": 44, "Increment": 1 } },
        { "Type": "AddLightningDamage", "Values": { "MinValue": 25, "MaxValue": 30, "Increment": 1 } },
        { "Type": "Throwable" },
        { "Type": "RecallWeapon" }
      ]
    },

For your example it would be:

ID": "ClawsOfDoom",
      "Name": "$mod_epicloot_l_cod",
      "Description": "$mod_epicloot_l_cod_desc",
      "EquipFx": "LightningAuraUnarmed",
      "EquipFxMode": "EquipRoot", 
"Requirements": {
        "AllowedItemTypes": [ "TwoHandedWeapon" ],
        "AllowedSkillTypes": [ "Unarmed" ]
      },
{"etc"}

Also note, you will need to pass your file to other players if you are playing on a server

DSMTurboAWD avatar Nov 16 '22 21:11 DSMTurboAWD

I'll give this a try, thanks!

HumbleSage0 avatar Nov 16 '22 22:11 HumbleSage0

I have tested this and it does work: image

DSMTurboAWD avatar Nov 17 '22 21:11 DSMTurboAWD

Wow! Sweet, can you share your code and what files you changed so I can play around more? Would make my life easier. :)

HumbleSage0 avatar Nov 18 '22 00:11 HumbleSage0

Wow! Sweet, can you share your code and what files you changed so I can play around more? Would make my life easier. :)

Make certain you match the pattern in the JSON I can add the full files, but this should cover it:

From the translations.json

 "mod_epicloot_l_harbfist": "Harbinger's Claws of Evicerating", 
  "mod_epicloot_l_harbfist_desc": "Gift from Odin to the Titan Harbinger for the express purpose of punching all simps in the throat", 

from legendaries.json I put this under the endlessbow item

    {
      "ID": "HarbFist",
      "Name": "$mod_epicloot_l_harbfist",
      "Description": "$mod_epicloot_l_harbfist_desc",
      "Requirements" : {
        "AllowedItemTypes": [ "TwoHandedWeapon" ],
        "AllowedSkillTypes": [ "Unarmed" ]
      },
      "GuaranteedMagicEffects": [
        { "Type": "AddPiercingDamage", "Values": { "MinValue" : 20, "MaxValue" : 25, "Increment" : 1 } },
        { "Type": "ModifyAttackSpeed", "Values": { "MinValue" : 20, "MaxValue" : 22, "Increment" : 1 } },
        { "Type": "ModifyAttackStaminaUse", "Values": { "MinValue" : 20, "MaxValue" : 22, "Increment" : 1 } },
        { "Type": "Indestructible" }
      ]
    },

DSMTurboAWD avatar Nov 18 '22 00:11 DSMTurboAWD

After attempting this it doesn't create fists, it creates a club with those attributes. Are you sure something doesn't need to be added to the iteminfo.json? I had to modify that just to get a custom silver ring for example I had to modify: { "Type": "Utility", "Fallback": "SilverRing", "Items": [ "SilverRing" ] }

Then create the legendary with this code:

  {
  "ID": "HSRing",
  "Name": "HumbleSage's Ring",
  "Description": "description here.",
  "IsSetItem": true, 
  "EquipFx": "WhiteAura", 
  "EquipFxMode": "EquipRoot", 
  "Requirements": {
    "AllowedItemTypes": [ "Utility" ]
  },

HumbleSage0 avatar Nov 22 '22 13:11 HumbleSage0

After attempting this it doesn't create fists, it creates a club with those attributes. Are you sure something doesn't need to be added to the iteminfo.json? I had to modify that just to get a custom silver ring for example I had to modify: { "Type": "Utility", "Fallback": "SilverRing", "Items": [ "SilverRing" ] }

Then create the legendary with this code:

  {
  "ID": "HSRing",
  "Name": "HumbleSage's Ring",
  "Description": "description here.",
  "IsSetItem": true, 
  "EquipFx": "WhiteAura", 
  "EquipFxMode": "EquipRoot", 
  "Requirements": {
    "AllowedItemTypes": [ "Utility" ]
  },

I am not sure I can comment on your specific item case, as I have not tested generic items However, the legendaries.json manage specifically the legendary items. The JSON for the item I laid out above worked when I spawned it.

I only edited the legendaries.json and the translations.json files since I was not editing/creating regular items, just legendaries.

RandyKnapp could comment more specifically on these items, but reading through the docs and knowing the items types in game.

Legendaries can spawn of several different types of items, this is why you can get Skalds finewood bow, or Skalds Crude bow. There is only one item that is classified as two-handed and uses the unarmed skill type. flesh-rippers So if you use that pattern, you should only get flesh rippers.

DSMTurboAWD avatar Nov 22 '22 15:11 DSMTurboAWD

I'm pretty sure that the translations.json are just variable place holders for the text. I just put the text directly into the legendaries.json file to keep it all in one place. I guess I'll have to mess around with it until I can figure out why it's not working for me.

HumbleSage0 avatar Nov 27 '22 00:11 HumbleSage0

So, I am not sure at this point how best to assist, your are correct the translations.json is just for declaring names, however, sticking to the patterns is recommended (or rather that is how most items are handled so, just following the pattern)

I would look at the iteminfo.json file, as the behaviour your are describing indicates that your items are triggering the fallback table. You could use my JSON data above verbatim and see if the item works... if so, that gives you a jumping off point.

Lastly, if it helps, take a peek at the RollMagicItem() method on the LootRoller.cs file as it illustrates how the mod is handling rolling of the legendaries.

Otherwise, yeah, play around with it. We've been pretty successful crafting a variety of items.

DSMTurboAWD avatar Nov 28 '22 02:11 DSMTurboAWD

It's cool. You've given me some good direction. Just wish it was easier to create legendary items. Like, I'd like to create legendary versions of normal tools. Do you know if there is a way to specify the item type so that when it spawns it doesn't default to particular kind? For example, when I create a legendary Cape, it always spawns as a Lox cape. I'd like to make it be barbarian or maybe Odin.

HumbleSage0 avatar Dec 03 '22 01:12 HumbleSage0