New item changed name, what gives?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zambaku
    Apprentice
    • Dec 2007
    • 80

    New item changed name, what gives?

    Okay, the scenario is this, I found one of my custom items, the giant lolipop:
    N:566:& Giant Lollipop~
    G:\:P
    I:21:15
    W:5:2:180:500
    A:20:20 to 100
    P:0:9d1:0:0:0

    But it was a giant lollipop of lightning. That's awesome. So I used a couple of scrolls to enchant it's damage. And then it changed it's name too "great hammer of lightning". What gives?
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by Zambaku
    Okay, the scenario is this, I found one of my custom items, the giant lolipop:
    N:566:& Giant Lollipop~
    G:\:P
    I:21:15
    W:5:2:180:500
    A:20:20 to 100
    P:0:9d1:0:0:0

    But it was a giant lollipop of lightning. That's awesome. So I used a couple of scrolls to enchant it's damage. And then it changed it's name too "great hammer of lightning". What gives?
    The second value in the I line has to be unique for each item. In this case, you have found the lollipop, and then saved and reloaded, and when the game had to look for the item "tval 21, sval 15", the first it found was a great hammer.
    takkaria whispers something about options. -more-

    Comment

    • Zambaku
      Apprentice
      • Dec 2007
      • 80

      #3
      Ah, I see. Hm, sval - can it be any number or does it has to be specific numbers for specific kind items?

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        Originally posted by Zambaku
        Ah, I see. Hm, sval - can it be any number or does it has to be specific numbers for specific kind items?
        Ah, yeah, I wasn't clear. It's the pair of numbers that has to be unique, not just the sval. Beyond that it can be whatever you like (under 255). So you can have a {tval,sval} pair of both {21,15} and {22, 15} fine, but not two lots of {21, 15}. Is that clear enough?
        takkaria whispers something about options. -more-

        Comment

        • Timo Pietilä
          Prophet
          • Apr 2007
          • 4096

          #5
          Originally posted by takkaria
          Ah, yeah, I wasn't clear. It's the pair of numbers that has to be unique, not just the sval. Beyond that it can be whatever you like (under 255). So you can have a {tval,sval} pair of both {21,15} and {22, 15} fine, but not two lots of {21, 15}. Is that clear enough?
          I have always thought that as tval for item type (blade, hafted, shield, boots etc.) and sval as which item from that type it is. Can't quite figure out why it is called sval (val as value, but why s? tval would be type value).

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            Originally posted by Timo Pietilä
            I have always thought that as tval for item type (blade, hafted, shield, boots etc.) and sval as which item from that type it is. Can't quite figure out why it is called sval (val as value, but why s? tval would be type value).
            subtype maybe. There's not any point in having both index numbers and the {tval,sval} pair either - it is quite confusing - so we should work on getting rid of that.
            takkaria whispers something about options. -more-

            Comment

            • Zambaku
              Apprentice
              • Dec 2007
              • 80

              #7
              Ah, I think I understand. So the first number can be anything and I don't have to touch the second one?

              Comment

              • Timo Pietilä
                Prophet
                • Apr 2007
                • 4096

                #8
                Originally posted by takkaria
                subtype maybe. There's not any point in having both index numbers and the {tval,sval} pair either - it is quite confusing - so we should work on getting rid of that.
                You could replace tval using template names from I: lines from artifact txt (and also use that same with object.txt instead of G: -lines), but sval is a lot more difficult to replace with human-readable text.

                Maybe go even other way around, and replace index-number with item type name and its sval in that specific category. Are there any actual use for index number?

                You could then make *slay* evil as such:


                Nf *Slay* Evil
                X:24:20:0
                W:0:25:0:5000
                C:0:0:0:2
                T:hafted:0:99
                Tolearm:0:99
                T:sword:0:99
                F:WIS | SLAY_EVIL | BLESSED


                and long sword like this:

                N:& Long Sword~
                I:sword:8:W
                W:10:0:130:300
                A:20:10 to 100
                P:0:2d5:0:0:0


                combining I: and G: lines, and symbol of that item type should go to object_base.

                Comment

                • Derakon
                  Prophet
                  • Dec 2009
                  • 9022

                  #9
                  Originally posted by Zambaku
                  Ah, I think I understand. So the first number can be anything and I don't have to touch the second one?
                  The index number (566 in your example) just has to be unique. I don't know how Angband allocates memory currently and if the index number is used to index into its arrays, but just to be safe you're probably best off making indices be sequential with no gaps (so don't just jump to 10000; find the biggest current index number in the file and make your item be that number + 1).

                  The tval must match the item type you want to use. For your giant lollipop, that's presumably the tval for blunt weapons, so look up the mace, whip, etc. and see what they use.

                  The sval must be unique for a given tval. So you can't use any sval that is already used by a different blunt weapon.

                  Comment

                  • Zambaku
                    Apprentice
                    • Dec 2007
                    • 80

                    #10
                    Hm, I'm beginning to get the hang of it, quite complicated to make items for me, hehe. I managed to get my custom monsters up and running now, I thought I simply had to add them at the bottom, but no, had to ad them at the correct "dungeon level #" place. Is it the same for items too or can I just have them at the bottom of the textfile?

                    Comment

                    • Zambaku
                      Apprentice
                      • Dec 2007
                      • 80

                      #11
                      Hm, I can't get it to work right, everytime I load my character again the custom item reverts back to another item. I changed the sval to a unique number and placed it correctly in the categories in the textfile. . .

                      Comment

                      • Derakon
                        Prophet
                        • Dec 2009
                        • 9022

                        #12
                        The savefile has the wrong number; fixing the edit files doesn't fix the savefile. You'll have to change the edit files and then find a new giant lollipop; your old one is permanently changed.

                        Comment

                        • Oramin
                          Swordsman
                          • Jun 2012
                          • 371

                          #13
                          Giant Lollipop?

                          Candy-band?

                          Comment

                          • Pete Mack
                            Prophet
                            • Apr 2007
                            • 6883

                            #14
                            Originally posted by Zambaku
                            Ah, I think I understand. So the first number can be anything and I don't have to touch the second one?
                            No! The first number (tval) is the "class" of objects; in this case it is "blunt weapon", since lollypops don't have a sharp edge. (If they did it would be "hafted weapon", which is a blade on the end of a stick: "Giant Scalpel", "spear" etc.)

                            The second value is the sub-type, which identifies Great Hammer, Mace, Whip, Mace of Disruption, Massive Iron Hammer, Giant Lollypop, etc.

                            Comment

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