Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old May 20, 2013, 21:43   #1
Zambaku
Apprentice
 
Join Date: Dec 2007
Posts: 80
Zambaku is on a distinguished road
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?
Zambaku is offline   Reply With Quote
Old May 20, 2013, 23:06   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Zambaku View Post
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.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old May 21, 2013, 02:15   #3
Zambaku
Apprentice
 
Join Date: Dec 2007
Posts: 80
Zambaku is on a distinguished road
Ah, I see. Hm, sval - can it be any number or does it has to be specific numbers for specific kind items?
Zambaku is offline   Reply With Quote
Old May 21, 2013, 08:40   #4
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Zambaku View Post
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?
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old May 21, 2013, 09:26   #5
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,093
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by takkaria View Post
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).
Timo Pietilš is offline   Reply With Quote
Old May 21, 2013, 12:24   #6
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Timo Pietilš View Post
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.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old May 21, 2013, 14:39   #7
Zambaku
Apprentice
 
Join Date: Dec 2007
Posts: 80
Zambaku is on a distinguished road
Ah, I think I understand. So the first number can be anything and I don't have to touch the second one?
Zambaku is offline   Reply With Quote
Old May 21, 2013, 14:44   #8
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,093
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by takkaria View Post
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:


N:of *Slay* Evil
X:24:20:0
W:0:25:0:5000
C:0:0:0:2
T:hafted:0:99
T:polearm: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.
Timo Pietilš is offline   Reply With Quote
Old May 21, 2013, 17:41   #9
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,552
Derakon is on a distinguished road
Quote:
Originally Posted by Zambaku View Post
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.
Derakon is online now   Reply With Quote
Old May 21, 2013, 22:21   #10
Zambaku
Apprentice
 
Join Date: Dec 2007
Posts: 80
Zambaku is on a distinguished road
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?
Zambaku 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
Z+Angband and ASCII. Something massive in my head changed and I love it! Svladd Cjelik Variants 13 February 19, 2011 16:56
3.2 - monster rarity levels changed? Nile Vanilla 6 January 5, 2011 01:07
char quick restart with changed options PowerDiver Vanilla 5 December 19, 2010 20:37
Should any monsters be changed for 3.1.0? Skyknight Vanilla 6 June 16, 2008 16:35
Nightlies updating even when nothing changed ekolis Vanilla 1 May 26, 2008 16:25


All times are GMT +1. The time now is 20:03.


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