Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   [PosChengband 3.3.4] Changing Weapon Proficiencies (http://angband.oook.cz/forum/showthread.php?t=6860)

riftor_77 July 15, 2014 04:45

[PosChengband 3.3.4] Changing Weapon Proficiencies
 
I've been greping and browsing all over the code, but i can't find the array that assigns weapon proficiencies to classes. Where is this array and how do I alter the values?

Thanks.

chris July 15, 2014 12:39

Quote:

Originally Posted by riftor_77 (Post 94106)
I've been greping and browsing all over the code, but i can't find the array that assigns weapon proficiencies to classes. Where is this array and how do I alter the values?

Thanks.

Skills are set in a text file: lib/edit/s_info.txt. This file is read by init_s_info() which is called by init_angband().

riftor_77 July 22, 2014 06:11

*Bangs self on head and completely forgets about Lua scripting*

Thanks. I have another question: The following weapon proficiency list contains many uncommented svals. Are these actual weapons, or something else entirely?

Code:

### RANGER ###
N:4
# Bow
W:0:0:0:4  # 0
W:0:1:0:4  #
W:0:2:0:3  # SLING
W:0:3:0:4  #
W:0:4:0:4  #
W:0:5:0:4  #
W:0:6:0:4  #
W:0:7:0:4  #
W:0:8:0:4  #
W:0:9:0:4  #
W:0:10:0:4  # 10
W:0:11:0:4  #
W:0:12:1:4  # SHORT_BOW
W:0:13:1:4  # LONG_BOW
W:0:14:0:4  #

etc...

Thanks.

chris July 22, 2014 11:21

(There is no lua scripting in poscheng).

You can get svals from defines.h. I would not rely on all of them being commented in s_info.txt. Also, some of the comments are japanese so it is hard to know what they mean without digging in other files. As for the extra svals, I would guess that they were added in case of future weapon additions to make sure baseline skill settings are initialized. This is actually pretty considerate (though I can think of better ways to do this). After all, what maintainer who adds a cool new weapon is going to even know about the cryptic s_info.txt file? What maintainer would be pleased with having to dance through a 15,000 line pref file adding new cryptic info lines for the new type?

As an aside, if you're curious about the whacky bow svals, the old code (and I mean ancient code) used to encode the shooter's multiplier in the sval. You could recover the multiplier with sval % 10. Neat, huh?


All times are GMT +1. The time now is 16:44.

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