DaJAngband hacking: help with the code (please, I wont ask much!)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roustk
    Adept
    • Dec 2007
    • 167

    #16
    Originally posted by will_asher
    I've been wondering how to add something to a list with this kind of stuff at the end
    0x40000000
    0x80000000..
    If it's too complicated, I probably won't bother.
    If it really ends with 0x80000000L, it will likely be difficult. That is the largest flag that can fit in a flag variable. My suggestion: look for an unused value earlier (for example, 0x40000000L is unassigned in the p_ptr->update set, while PU_PANEL is 0x80000000L).

    I believe that TR1_* is fully assigned, but there are some free items in TR2_* and TR3_*. Similarly RF1 and RF5 seem to be full, but the other RF flags have some free elements. You should be able to replace an RF#_XXX# flag with your new item, and then tie it into the code like the other items with that same RF number.


    Some sequences of definitions end with something other than 0x80000000L -- you should be able to just follow the powers-of-two pattern to add more to the end of those sequences.

    I was also wondering if there was some not-too-complicated way of putting the 3.0.9b changes into DaJAngband. (I definetly won't try to get everything from 3.1.0 when it comes out, but I'd like to have the changes for 3.0.9b.)
    Probably the most reasonable is to generate a diff between your base version (3.0.9, say) and the new base version (3.0.9b), and then try to apply that diff to your patched version. I don't know how much has changed between 3.0.9 and 3.0.9b, but it likely is small enough that you can compensate.

    I dont know how you would generate (or apply) the diff on Windows, but you may have already figured that out in distributing your variant.

    Kevin

    Comment

    • will_asher
      DaJAngband Maintainer
      • Apr 2007
      • 1124

      #17
      thanks
      what's a diff and how to you make/apply it?
      Will_Asher
      aka LibraryAdventurer

      My old variant DaJAngband:
      http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

      Comment

      • roustk
        Adept
        • Dec 2007
        • 167

        #18
        Originally posted by will_asher
        thanks
        what's a diff and how to you make/apply it?
        On unix systems, 'diff' is a command line utility that identifies the differences between two files or directories. Something similar *should* exist in the tools you are using, but I don't know for sure. diff also exists for svn, where a command line like
        Code:
        svn diff \
        [url]http://dev.rephial.org/svn/branches/angband-3.0.8[/url] \
        [url]http://dev.rephial.org/svn/branches/angband-3.0.9b[/url]
        will generate a list of all changes between 3.0.9 (misnamed) and 3.0.9b.

        The output looks like this, for src/defines.h:
        Code:
        Index: src/defines.h
        ===================================================================
        --- src/defines.h       (.../angband-3.0.8)     (revision 836)
        +++ src/defines.h       (.../angband-3.0.9b)    (revision 836)
        @@ -36,7 +36,7 @@
          * Name of the version/variant and its version string
          */
         #define VERSION_NAME   "Angband"
        -#define VERSION_STRING "3.0.9"
        +#define VERSION_STRING "3.0.9b"
         
         
         /*
        @@ -1411,7 +1411,7 @@
         /*
          * Maximum flow depth when using "MONSTER_FLOW"
          */
        -#define MONSTER_FLOW_DEPTH 3
        +#define MONSTER_FLOW_DEPTH 32
        That is, 3.0.9b has a different VERSION_STRING and a different MONSTER_FLOW_DEPTH. (Lines starting with '-' are the old version, '+' are the replacement version.)

        I have attached the output of the 'svn diff' command I noted above. If nothing else, you should be able to read it an manually make the changes indicated to your code.

        You probably want to figure out how to use diff (or its equivalent on your system), so that you can more easily put your changes onto 3.1.0 when it comes out. Other variant maintainers have to deal with the problem, so presumably you can find someone to offer more guidance.

        Kevin
        Attached Files

        Comment

        • will_asher
          DaJAngband Maintainer
          • Apr 2007
          • 1124

          #19
          Thanks, that helps.
          Will_Asher
          aka LibraryAdventurer

          My old variant DaJAngband:
          http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

          Comment

          • Atarlost
            Swordsman
            • Apr 2007
            • 441

            #20
            It's not terribly complicated to add TR4 or RF6 or whatever you've run out of space on if you run out of space. That's how we got to TR3 and RF5 in the first place. Just be sure to handle the extra flagset everywhere the others are referenced and note that it breaks savefile compatability.
            One Ring to rule them all. One Ring to bind them.
            One Ring to bring them all and in the darkness interrupt the movie.

            Comment

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