V randarts using hengband weapons acting wierd

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elfin Jedi
    Adept
    • Mar 2013
    • 102

    V randarts using hengband weapons acting wierd

    I added hengband weapons to my version of Vanilla, and now the Artifact Spoilers file and Artifact Knowledge think that a Sickle is a Trident and that a Wakizashi is an Executioner's Sword. It wasn't much of a problem until I found I was too weak to wield the Wakizashi because it thinks it weighs 29 lbs. (It should weigh 9 lbs.)
  • chris
    PosChengband Maintainer
    • Jan 2008
    • 702

    #2
    Originally posted by Elfin Jedi
    I added hengband weapons to my version of Vanilla, and now the Artifact Spoilers file and Artifact Knowledge think that a Sickle is a Trident and that a Wakizashi is an Executioner's Sword. It wasn't much of a problem until I found I was too weak to wield the Wakizashi because it thinks it weighs 29 lbs. (It should weigh 9 lbs.)
    I haven't looked at vanilla code in a while, but it sounds like Executioner's Sword and Wakizashi use the same tval/sval pair (Ditto with Sickle and Trident). In Hengband, lookup_kind(tval, sval) returns the first k_idx it finds. I imagine Vanilla is doing something similar.

    Comment

    • Elfin Jedi
      Adept
      • Mar 2013
      • 102

      #3
      They do have the same tval and sval. I don't know much about how tvals and svals work though. Do I just change the sval to the first unused one I find? Or is it more complicated then that?

      Comment

      • chris
        PosChengband Maintainer
        • Jan 2008
        • 702

        #4
        Originally posted by Elfin Jedi
        They do have the same tval and sval. I don't know much about how tvals and svals work though. Do I just change the sval to the first unused one I find? Or is it more complicated then that?
        Every object should have a unique tval/sval pair. The tval gives the type of object (sword, wand, potion, etc) and is used by the code for obvious purposes (can I wield this? aim this? quaff this?). So you need to pick the correct tval for the type of new object you are adding. Having done that, the sval should just use the next highest available number. There might also be a #define someplace in code as well (or an enum) that you should keep up to date. Somebody with more experience with the Vanilla codebase (quite different from Hengband these days) could probably help out more.

        Comment

        • takkaria
          Veteran
          • Apr 2007
          • 1951

          #5
          Originally posted by chris
          Every object should have a unique tval/sval pair. The tval gives the type of object (sword, wand, potion, etc) and is used by the code for obvious purposes (can I wield this? aim this? quaff this?). So you need to pick the correct tval for the type of new object you are adding. Having done that, the sval should just use the next highest available number. There might also be a #define someplace in code as well (or an enum) that you should keep up to date. Somebody with more experience with the Vanilla codebase (quite different from Hengband these days) could probably help out more.
          There's no sval constants to keep up-to-date in V's code anymore, FWIW.
          takkaria whispers something about options. -more-

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎