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.)
V randarts using hengband weapons acting wierd
Collapse
X
-
Tags: None
-
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.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.) -
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
-
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
-
There's no sval constants to keep up-to-date in V's code anymore, FWIW.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.takkaria whispers something about options. -more-Comment
Comment