Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 29, 2013, 16:23   #1
Elfin Jedi
Adept
 
Join Date: Mar 2013
Posts: 102
Elfin Jedi is on a distinguished road
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.)
Elfin Jedi is offline   Reply With Quote
Old March 29, 2013, 16:30   #2
chris
PosChengband Maintainer
 
Join Date: Jan 2008
Posts: 702
chris is on a distinguished road
Quote:
Originally Posted by Elfin Jedi View Post
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.
chris is offline   Reply With Quote
Old March 29, 2013, 16:46   #3
Elfin Jedi
Adept
 
Join Date: Mar 2013
Posts: 102
Elfin Jedi is on a distinguished road
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?
Elfin Jedi is offline   Reply With Quote
Old March 29, 2013, 17:13   #4
chris
PosChengband Maintainer
 
Join Date: Jan 2008
Posts: 702
chris is on a distinguished road
Quote:
Originally Posted by Elfin Jedi View Post
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.
chris is offline   Reply With Quote
Old March 30, 2013, 16:50   #5
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,846
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by chris View Post
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.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forking Hengband? chris Variants 35 March 31, 2018 11:00
Manga in Hengband Yogalover Idle chatter 0 August 25, 2011 13:56
Hengband vs Entroband? Orrus Variants 7 June 25, 2008 05:14
hengband 1.70? Citybob Variants 2 June 5, 2008 16:18
Entroband / Hengband xxitheworld Variants 3 April 3, 2008 20:37


All times are GMT +1. The time now is 01:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.