How to make or re-texture weapons (I wanna scythe)

Discussion in 'Mods' started by Maelily78, Mar 6, 2017.

  1. Hammurabi

    Hammurabi Big Damn Hero

    As far as I can tell, it does absolutely nothing. There is code for a "dodge" system, where enemies can have a base chance to dodge hits, and equipment has "Precision" which can reduce or increase that chance… but every single monster has a dodge chance of 0%, so it's essentially disabled.

    Yes, but some swords are set to type "3". I don't know what the significance of that is.

    Also, the Scythe is set to type "0" (like most swords), but does not allow you to block like the other swords.
     
      Acerbicon likes this.
    • Hammurabi

      Hammurabi Big Damn Hero

      Hmm... pulling up StardewValley.Tools.MeleeWeapon gives both some more insight and some more questions…

      1) Apparently type=0 is for "StabbingSwords" while type=3 is for "DefenseSwords"… but anything with type=0 is automatically set to type=3.

      2) If you're going to rename a sword to have "Scythe" in its name, it will not have a special ability animation (and likely not be able to block at all). There's a hard-coded check involved:
      if (this.type == 3 && (this.name.Contains("Scythe") || this.parentSheetIndex == 47) || Game1.fadeToBlack) return;

      3) For some strange reason, knockback modifiers are shown as positive values even when they are penalties. A knockback modifier of less than the default knockback for the weapon type (type0 = 1, type1 = 0.5, type2 = 1.5, type3 = 1) results in less knockback, but is still displayed as "+x knockback" due to an absolute-value call. A difference of 0.1 from the base value is shown as +1 in-game.
      This means that the following weapons have incorrect knockback displays:
      Bone Sword: -2 knockback
      Wood Mallet: -2 knockback
      Galaxy Hammer: -5 knockback
      All of the unused character clubs: -5 knockback

      4) Each point of speed in weapons.xnb appears to equal a 10% change reduction in swing time (this also appears to be true of speed buffs to the player, it's worth noting), and is shown 1-to-1 in-game.

      5) The column with lots of "0.02" values is for the critical hit chance, and the display is calculated as (CritChance / 0.02). This is only shown in the description if there is at least a bonus of +2. This ends up being a very poor way to display it, since a "default" value would be +1, and lots of the values are fractional (e.g., +1.5) with the fraction getting dropped. So, I'm instead going to phrase it in terms of percentage changes. Here's all of the critical chances for unmodified weapons:

      Insect Head: +100% crit chance ("+2")
      Dark Sword: +150% crit chance ("+2")
      Lava Katana: -25% crit chance (not normally displayed)
      Carving Knife: +100% crit chance ("+2")
      Iron Dirk: +50% crit chance (not normally displayed)
      Elf Blade: +100% crit chance ("+2")
      Crystal Dagger: +50% crit chance (not normally displayed)
      Burglar's Shank: +100% crit chance ("+2")
      Shadow Dagger: +100% crit chance ("+2")
      Wicked Kris: +200% crit chance ("+3")
      Templar's Blade: Cannot crit -- 0% crit chance (not normally displayed)

      (Edit: Actually, double-checking on the wiki, it looks like critical chance never gets displayed. Huh.)

      6) The next column is the Critical Multiplier, i.e., the damage bonus on a critical hit. The display for this one is calculated as ((CritMult - 3) / 0.02), and is only displayed if it is at least +1. All of the displays are accurate, and are a straight calculation of how much more of the base critical damage (+200%) is being added. So, a +25 critical power is 25% extra critical hit damage = 200% + (25% * 200%) = 250% extra damage on criticals (instead of the standard 200% extra damage).

      In simpler terms, double the displayed crit power, and that's the extra percentage of your non-critical-hit damage that is being added on critical hits.

      7) The column in front of the crit chance (which only has values of 0, 1, or 2) is added area of effect. This is not displayed anywhere in the weapon description. I'm not very clear on exactly how much each point is increasing the area by, though, because of zoom calculations.

      Here's the list of weapons with increased area of effect sizes:
      Rapier: +2
      Tempered Broadsword: +1
      Lava Katana: +2
      Broken Trident: +2
      Wicked Kris: +2
      Lead Rod: +1
      The Slammer: +2

      8) Columns 9 and 10 (lots of "-1"s, and otherwise values ranging from 3 to 150ish) appear to be completely unused. I'm guessing they, like the "stabbingswords" and precision, were relating to something that got cut but which ConcernedApe didn't fully remove from the code.
       
        Acerbicon likes this.
      • Maelily78

        Maelily78 Void-Bound Voyager

        Tried packing it, produced no XNB, even tryed packing from differant locations and to differnet locations and still no XNB.

        @Hammurabi I didnt touch those values, just the damage and crit values, everything else is basic scythe.
         
        • MysticTempest

          MysticTempest Spaceman Spiff

          Hrm, it could be an issue with formatting. You might've missed a quotation mark, or an exclamation mark. If you want to upload the yaml; I can help take a closer look.
           
          • Maelily78

            Maelily78 Void-Bound Voyager

            @MysticTempest, thank you very much for the offer, and I apologize for the delay, work has picked up at my job and will keep me busy till the weekend, possibly beyond :p
            here is the file though, I believe I have put in all my valus, but I do have some trouble navigating notepad sometimes so I wouldn't be surprised If a what should be a higher class weapon has very low stats.


            Sorry wouldent let me attahc the file and am in a hurry
            (

            xnbData:
            target: "w"
            compressed: true
            hiDef: true
            readerData:
            -
            type: "Microsoft.Xna.Framework.Content.DictionaryReader`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"
            version: 0

            -
            type: "Microsoft.Xna.Framework.Content.Int32Reader"
            version: 0

            -
            type: "Microsoft.Xna.Framework.Content.StringReader"
            version: 0


            numSharedResources: 0

            content: #!Dictionary<Int32,String>
            0: "Rusty Sword/A rusty, dull old sword./2/5/1/0/0/0/3/-1/-1/0/.02/3" #!String
            1: "Silver Saber/Plated with silver to deter rust./8/15/1/0/1/1/0/50/45/0/.02/3" #!String
            2: "Dark Sword/It's glowing with a mysterious energy./10/30/1/0/0/0/0/-1/-1/0/.05/3.5" #!String
            3: "Holy Blade/It feels hopeful to wield./18/24/1.2/0/5/0/3/-1/-1/0/.02/3" #!String
            4: "Galaxy Sword/It's unlike anything you've ever seen./60/80/1/8/0/0/0/-1/-1/0/.02/3" #!String
            5: "Bone Sword/A very light piece of sharpened bone./20/30/.8/8/5/0/0/74/50/0/.02/3" #!String
            6: "Iron Edge/A heavy broadsword./12/25/1.2/-4/0/1/3/44/-1/0/.02/3" #!String
            7: "Templar's Blade/It once belonged to an honorable knight./22/29/1/0/10/1/3/90/50/0/0/3" #!String
            8: "Obsidian Edge/It's incredibly sharp./30/45/1/-2/0/0/0/121/100/0/.02/3.2" #!String
            9: "Lava Katana/A powerful blade forged in a pool of churning lava./55/64/1.2/0/0/3/0/-1/-1/2/.015/3.5" #!String
            10: "Claymore/It's really heavy./20/32/1.3/-8/0/2/3/86/50/0/.02/3" #!String
            11: "Steel Smallsword/A standard metal blade./4/8/1/4/0/0/0/26/-1/0/.02/3" #!String
            12: "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3" #!String
            13: "Insect Head/Not very pleasant to wield./10/20/1/4/9/0/0/-1/-1/0/.04/3" #!String
            14: "Neptune's Glaive/An heirloom from beyond the Gem Sea./18/35/1.4/-2/6/2/3/-1/-1/0/.02/3" #!String
            15: "Forest Sword/Made powerful by forest magic./8/18/1/4/5/1/0/-1/-1/0/.02/3" #!String
            16: "Carving Knife/A small, light blade./1/3/.5/0/0/0/1/18/-1/0/.04/3" #!String
            17: "Iron Dirk/A common dagger./2/4/.5/0/0/0/1/62/50/0/.03/3" #!String
            18: "Burglar's Shank/A weapon of choice for the swift and silent./7/12/.5/0/5/0/1/114/100/0/.04/3.5" #!String
            19: "Shadow Dagger/When you hold the blade to your ear you can hear 1,000 souls shrieking./10/20/.5/0/0/0/1/80/50/0/.04/3" #!String
            20: "Elf Blade/Only the nimble hands of an elf could craft this./3/5/.5/0/5/0/1/-1/-1/0/.04/3" #!String
            21: "Crystal Dagger/The blade is made of purified quartz./4/10/1/0/10/0/1/-1/-1/0/.03/4" #!String
            22: "Wind Spire/A swift little blade./1/5/1/0/0/0/1/-1/-1/0/.02/3.2" #!String
            23: "Galaxy Dagger/It's unlike anything you've seen./30/40/1/3/0/0/1/-1/-1/0/.02/3" #!String
            24: "Wood Club/A solid piece of wood, crudely chiseled into a club shape./9/16/1.5/-8/0/0/2/32/-1/0/.02/3" #!String
            25: "Alex's Bat/The sweet spot is dented from Alex's famous Grand Slam./1/3/1/-8/0/0/2/-1/-1/0/.02/3" #!String
            26: "Lead Rod/It's incredibly heavy./18/27/1.5/-16/0/0/2/56/50/1/.02/3" #!String
            27: "Wood Mallet/The solid head packs a punch. Relatively light for a club./15/24/1.3/-4/1/0/2/68/50/0/.02/3" #!String
            28: "The Slammer/An extremely heavy gavel that'll send foes flying./40/55/1.5/-12/0/0/2/128/100/2/.02/3" #!String
            29: "Galaxy Hammer/It's made from an ultra-light material you've seen before./70/90/1/-4/0/0/2/-1/-1/0/.02/3" #!String
            30: "Sam's Old Guitar/It's seen better days./1/3/1/-6/0/0/2/-1/-1/0/.02/3" #!String
            31: "Femur/An old, heavy bone caked in centuries of grime./6/11/1.5/-4/0/0/2/10/-1/0/.02/3" #!String
            32: "Slingshot/Requires stones for ammo./1/3/1/308/0/0/4/-1/-1/0/.02/3" #!String
            33: "Master Slingshot/Requires stones for ammo./1/3/1/308/0/0/4/-1/-1/0/.02/3" #!String
            34: "Galaxy Slingshot/It looks really powerful./1/3/1/308/0/0/4/-1/-1/0/.02/3" #!String
            35: "Elliott's Pencil/Elliott used this to write his book. It's sharp!/1/3/1/308/0/0/1/-1/-1/0/.02/3" #!String
            36: "Maru's Wrench/A big, metal wrench. It smells like Maru./1/3/1/308/0/0/2/-1/-1/0/.02/3" #!String
            37: "Harvey's Mallet/It brings back memories of Harvey's clinic./1/3/1/308/0/0/2/-1/-1/0/.02/3" #!String
            38: "Penny's Fryer/Penny's favorite frying pan. There's some rubbery gunk stuck to the inside./1/3/1/308/0/0/2/-1/-1/0/.02/3" #!String
            39: "Leah's Whittler/Leah's favorite tool for shaping driftwood./1/3/1/308/0/0/1/-1/-1/0/.02/3" #!String
            40: "Abby's Planchette/It's made from fine marblewood./1/3/1/308/0/0/1/-1/-1/0/.02/3" #!String
            41: "Seb's Lost Mace/One of Sebastian's medieval replicas./1/3/1/308/0/0/2/-1/-1/0/.02/3" #!String
            42: "Haley's Iron/It's searing hot and smells like Haley's hair./1/3/1/308/0/0/0/-1/-1/0/.02/3" #!String
            43: "Pirate's Sword/It looks like a pirate owned this once./8/14/1/4/0/0/3/40/-1/0/.02/3" #!String
            44: "Cutlass/A finely crafted blade./9/17/1/4/0/0/0/-1/-1/0/.02/3" #!String
            45: "Wicked Kris/The blade is made of an iridium alloy./24/30/.5/0/8/0/1/-1/-1/2/.06/3" #!String
            46: "Kudgel/A brute's companion./27/40/1.6/-10/0/0/2/107/100/0/.02/3.1" #!String
            47: "Scythe/It can cut grass into hay, if you've built a silo./1/3/1/0/0/0/0/-1/-1/0/.02/3" #!String
            48: "Yeti Tooth/It's icy cold to the touch./26/42/1/0/0/4/0/-1/-1/0/.02/3.2" #!String
            49: "Rapier/An elegant blade./15/25/1/4/0/0/0/100/95/2/.02/3" #!String
            50: "Steel Falchion/Light and powerful./26/38/1/8/5/0/0/142/100/0/.02/3.4" #!String
            51: "Broken Trident/It came from the sea, but it's still sharp./15/26/.5/0/8/0/1/-1/-1/2/.02/3" #!String
            52: "Tempered Broadsword/It looks like it could withstand anything./29/44/1.2/-6/0/3/0/135/100/1/.02/3" #!String
            53: "Field Scythe/From a time where farmers had huge fields to harvest, now it harvest something else./5/9/1/0/0/0/0/-1/-1/0/.02/3" #!String 54: "Farmers Gaurdian /Grandfather’s trusty scythe./10/13/1/0/0/0/0/-1/-1/0/.02/3" #!String
            55: "Life’s Bane /Once wielded by an unholy creature, now you use this blade./11/14/1.6/0/0/0/0/-1/-1/0/.02/3" #!String 56: "Vengeance /This weapon has one purpose and one purpose alone, AND IT SHAL BE FULFILLED IN BLOOD!./15/22/1/6/0/0/0/-1/-1/0/.015/4" #!String 57: "Monster Scythe/This scythe is almost as monsterly as the monsters it was made from./20/33/1/0/0/0/0/-1/-1/0/.02/3" #!String 58: "Blood Moon Scythe /crafted in blood and ritual on the night of a blood moon, it glows faintly./46/63/1/0/0/0/0/-1/-1/0/.025/3.5" #!String 59: "Soul Eater /This scythe is said to have one been a boy that transformed into a weapon but could not change back./20/29/1/0/0/0/0/-1/-1/0/.02/3" #!String 60: "Demon Scythe/The weapon of a fallen demon./10/13/1/0/0/0/0/-1/-1/0/.02/3" #!String 61: "Reaper’s Favourite Scythe/Someone very powerful lost their favourite weapon./44/66/1/0/0/0/0/-1/-1/0/.02/4" #!String 62: "Sinner Harvester/The holly weapon of a being that harvested sinners./55/77/1/0/0/0/0/-1/-1/0/.02/3" #!String 63: "Galaxy Scythe/Unlike any scythe or weapon you’ve wielded before./5/9/1/0/0/0/0/-1/-1/0/.02/3" #!String 64: "Bone Scythe/More like a club then a scythe./78/85/1.6/-2/0/0/0/-1/-1/0/.015/3.5" #!String 65: "Tsunami Scythe/Hits almost as strong as the natural disaster its named after./50/69/1.8/0/0/0/0/-1/-1/0/.02/3" #!String 66: "Forest Scythe/A scythe grown from and the forest itself, infused with nature magic./18/25/1/0/0/0/0/-1/-1/0/.02/3" #!String 67: "Noxious Scythe /A relic from the 3rd era./68/84/1/0/0/0/0/-1/-1/0/.02/3" #!String 68: "Blue Rose Scythe /Scythe adorned in vines and unnaturally blue roses./52/66/1/4/0/0/0/-1/-1/0/.02/3" #!String 69: "Butterfly Scythe /It’s has two extra blades, making it 3x’s as deadly, and 3x’s as pretty./8/29/1/8/0/0/0/-1/-1/0/.02/3" #!String 70: "Strait War Scythe /Standard issued long range melee weapon of the republic soldier./10/19/1/0/0/0/0/-1/-1/0/.02/3" #!String 71: "Strait Galaxy Scythe /Unlike anything, blah blah blah./50/65/1/0/0/0/0/-1/-1/0/.02/3" #!String 72: "Sickle /basically a hand held scythe./20/33/1/0/0/0/0/-1/-1/0/.02/3" #!String 73: "Pole axe /a medieval tool of war./10/16/1/0/0/0/0/-1/-1/0/.02/3" #!String 74: "Undyne the Undying’s Spear /A spear made of magic by Captain of the royal guard, Undyne the Undying./50/64/1/0/0/0/0/-1/-1/0/.04/3.5" #!String
            )
             
              MysticTempest likes this.
            • MysticTempest

              MysticTempest Spaceman Spiff

              No wories, Maelily78! ^-^

              I've been taking a look, and yea there were a few formatting issues. I fixed those, and it packed. Then I did a quick test on loading them(SMAPI & the CJBitemspawner can still load them even without artwork) in-game, and after some minor issues I found a few more formatting issues. But, they should all be cleared up now.

              The issues for reference under the spoiler:

              There were some extra, unneeded parentheses in the yaml. And, I realigned your new items to be in line with the others.
              That allowed me to pack the file.
              But, there were a few weapons that crashed while spawning them in-game.

              Namely these ones:
              Descriptions cause error:
              54: "Farmers Gaurdian /Grandfather’s trusty scythe./10/13/1/0/0/0/0/-1/-1/0/.02/3" #!String
              63: "Galaxy Scythe/Unlike any scythe or weapon you’ve wielded before./5/9/1/0/0/0/0/-1/-1/0/.02/3" #!String
              69: "Butterfly Scythe /It’s has two extra blades, making it 3x’s as deadly, and 3x’s as pretty./8/29/1/8/0/0/0/-1/-1/0/.02/3" #!String

              Names cause error:
              55: "Life’s Bane /Once wielded by an unholy creature, now you use this blade./11/14/1.6/0/0/0/0/-1/-1/0/.02/3" #!String
              61: "Reaper’s Favourite Scythe/Someone very powerful lost their favourite weapon./44/66/1/0/0/0/0/-1/-1/0/.02/4" #!String
              74: "Undyne the Undying’s Spear /A spear made of magic by Captain of the royal guard, Undyne the Undying./50/64/1/0/0/0/0/-1/-1/0/.04/3.5" #!String

              It took a bit, but after careful testing. It appears that the curly single quote was the issue. All other weapons, use straight single quotes. I fixed the quotes, and these weapons all load fine now.

              I'd recommend using something like Notepad++ to edit code if you're on Windows: https://notepad-plus-plus.org/download/v7.3.3.html
              And, get the XMLTools plugin; someone made a short guide here: https://notepadhelper.com/notepad-plus-plus/xml-tools-plugin/

              Or Geany; which is what I use on Linux with XML Pretty Printer: https://www.geany.org/Download/Releases
              (It has Windows/OSX binaries too.)


              Anyway, I'm uploading your fixed yaml file, and the packed version I tested. But, feel free to repack it yourself.
               

                Attached Files:

              • Maelily78

                Maelily78 Void-Bound Voyager

                OK! I've got the the xnb. edited and the png adjusted. and still cant pack the data file :)
                I've downloaded Notepad++ and the XMLTools plugin (no idea how to work it) but even with trying to keep it as close to the file MysticTempest's gave me (but I did rearrange some lines, which is the only thing I haven't tried to change since I arranged them to match the png and just really don't want it to be the problem), I've been unable find the problem to pack it.
                Could someone link me to an instruction manual for XMLtools or just anything to help figure out how to find the problem?
                 
                • Maelily78

                  Maelily78 Void-Bound Voyager

                  Also big thanks to @MysticTempest for your help and the files :)
                   
                  • MysticTempest

                    MysticTempest Spaceman Spiff

                    For XMLTools; http://www.systemcentercentral.com/...ools-plug-in-for-notepad-to-format-messy-xml/
                    It's pretty helpful for formatting savefiles when testing, and other large xml data files that need to be formatted.

                    Right now, Notepad++ should be good enough. If you've opened your file in it. It should look somewhat similar to this, and you should notice that a lot of the data is highlighted.
                    weapons.png
                    A few things to note. First the yellow star at the bottom; that white line acting like a giant bracket for the data needs to be one past your own weapons. In the same way, it's one below #52. That's achieved by hitting enter after your final entry; so it'll generate a new line.

                    Now, if you notice the 4 yellow circles on #49. Those represent spaces; in this case 4. And, the yellow square on the preceding line is useful. That square right after the 'g' is where you hit enter to start a new line for your data.
                    So, for instance say you modified #64. Put your cursor just before the blue 6, in #64. Then backspace all the way back to the yellow square, at the end of line #63; and hit enter. That should properly line it up, and advance the white bracket. Comb over your data, and update as necessary.
                    Hopefully that helps explain some of the formatting nuances of the data files.

                    Also, since you've been able to pack everything else fine; it shouldn't be an issue with XNBnode, but just in case. Try packing the weapons.yaml file I uploaded for you the other day. If that packs; then XNBnode is working correctly, and it's just some new formatting issues on the new file.
                     
                      Acerbicon, Maelily78 and Hammurabi like this.

                    Share This Page