[PosChengband 3.3.4] Changing Weapon Proficiencies

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • riftor_77
    Rookie
    • May 2014
    • 13

    [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
    PosChengband Maintainer
    • Jan 2008
    • 702

    #2
    Originally posted by riftor_77
    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().

    Comment

    • riftor_77
      Rookie
      • May 2014
      • 13

      #3
      *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.

      Comment

      • chris
        PosChengband Maintainer
        • Jan 2008
        • 702

        #4
        (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?

        Comment

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