Adding Oangband magic realms/spellbooks. What changes do I need to make?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elfin Jedi
    Adept
    • Mar 2013
    • 102

    #91
    Ok that sounds useful. So I can make it crash with the Memory moss and see where it was in the code.

    Comment

    • Elfin Jedi
      Adept
      • Mar 2013
      • 102

      #92
      Updated github:

      Contribute to Elfin-Jedi/VarAngband-old development by creating an account on GitHub.


      Though now I am worried about this (from mon-util.c):

      /* Handle "invisible" monsters */
      if (rf_has(mon->race->flags, RF_INVISIBLE) || mon->m_timed[MON_TMD_INVISIBLE]) {
      /* See invisible */
      if (player_of_has(player, OF_SEE_INVIS))
      {
      /* Easy to see */
      easy = flag = TRUE;
      }

      That is looking for "mon->m_timed[MON_TMD_INVISIBLE]" under race flags (rf_has) isn't it?

      Edit: I've never tested whether see invisible lets me see an invisible Memory moss...

      Edit:It works perfectly, saw Memory moss until it wore off, then couldn't see it anymore; but now I am really suspicious of the invisibility effect end timer (because 2 moves later it crashed).
      Last edited by Elfin Jedi; July 18, 2016, 22:31.

      Comment

      • Pete Mack
        Prophet
        • Apr 2007
        • 6883

        #93
        Yes . Instructions are (replace Makefile.win with your makefile name in the following)
        # remove build files:
        make -f Makefile.win clean
        #Update Makefile.win , replace instance of -O2 with -g
        # rebuild
        make -f makefile.win
        # cd to parent directory
        cd ..
        # run gdb on executable file. This is again platform dependent
        gdb ./angband.exe
        > run
        # examine stack
        > where
        # go to stack frame that crashed (for example. 12)
        > frame 12
        # list code to see exact position
        > list

        All this assumes you are in a unix-like environment, with the compiler tools in your path.

        Comment

        • Elfin Jedi
          Adept
          • Mar 2013
          • 102

          #94
          Signal received: SIGSEGV (Segmentation fault)

          For program angband.exe, pid 25,740

          Do I discard it or forward it?

          Edit: Discarded and paused, crashed on the line the arrow is pointing to (mon-spell.c):

          /* Tell the player what's going on */
          disturb(player, 1);
          ---> spell_message(mon, spell, seen, hits);

          Edit: It's crashing because the player doesn't see either a spell cast or possibly the timer running out, isn't it?

          Comment

          • Elfin Jedi
            Adept
            • Mar 2013
            • 102

            #95
            Apparently the crash was because I didn't give the INVISIBLE spell a message for when it was cast by an invisible monster. I guess those are necessary.

            Everything works now, except Detect Monsters still detects it.

            And I don't know if the Memory moss can become visible again yet because it keeps casting INVISIBLE while still invisible, I think I will turn down the spell-freq.

            Comment

            • takkaria
              Veteran
              • Apr 2007
              • 1951

              #96
              Originally posted by Elfin Jedi
              Apparently the crash was because I didn't give the INVISIBLE spell a message for when it was cast by an invisible monster. I guess those are necessary.

              Everything works now, except Detect Monsters still detects it.

              And I don't know if the Memory moss can become visible again yet because it keeps casting INVISIBLE while still invisible, I think I will turn down the spell-freq.
              Great, glad to hear it's all working now You could also add a bit in the spell filtering so already-invisible monsters don't cast invisibility. (Hint: look at remove_bad_spells() in mon-attack.c.)
              takkaria whispers something about options. -more-

              Comment

              • Elfin Jedi
                Adept
                • Mar 2013
                • 102

                #97
                Ok, I started working on my project again last month after a 7 month break.

                Now I am trying to figure out how to add confusion breaths for giant bronze dragon flies from Unangband. They added fine to my 3.5.0-based version a long time ago, but the code has changed a lot since then. I am currently stuck at line 84 in effects.c (4.0.5 release): "#define ELEM(a, b, c, d, e, f, g, h, i, col) { c, i }," .

                I already edited monster_spell.txt, list-mon-spells.h, and list-elements.h, but the effects.c error is too confusing for me. It specifically doesn't like something about the "i" in the "{ c, i }". If I remove the i, it complains about the "500" I put under the cap section in list-elements.h.

                I will want to add fear breaths too, so any extra insight that would help me understand how to avoid errors when adding that would be useful too. Thanks!

                Comment

                • Pete Mack
                  Prophet
                  • Apr 2007
                  • 6883

                  #98
                  Adding confusion element is much harder, because it's currently a status effect. You'll have to change it everywhere.

                  Comment

                  • Elfin Jedi
                    Adept
                    • Mar 2013
                    • 102

                    #99
                    Drat, would it by any chance be easier to make it so monsters can breathe status effects...?

                    Comment

                    • Derakon
                      Prophet
                      • Dec 2009
                      • 9022

                      Originally posted by Elfin Jedi
                      Drat, would it by any chance be easier to make it so monsters can breathe status effects...?
                      Not likely; status effects can't deal damage. I'd suggest looking at how the sound element is implemented; you'll want something similar for confusion, except that you'd check for confusion protection both for the status effect prevention and for the damage reduction. Basically wherever you see logic dealing with sound, you should add similar logic for dealing with confusion, but replace P_STUN and R_SOUND with P_CONF. The names might not be exactly those; it's been awhile since I dug into the code for elements/statuses.

                      Comment

                      • Nick
                        Vanilla maintainer
                        • Apr 2007
                        • 9647

                        Adding an extra element should not be too hard. Off the top of my head you would need to (as Derakon said) mimic SOUND in list-elements.h and in all the project-*.c files, which is where all the code for dealing with the effects of elements on monsters, player, objects and terrain is.

                        Edit: It might break details like the resist panel in the character screen, and graphics, too, but you can always come back an fix those when you have it basically working.
                        One for the Dark Lord on his dark throne
                        In the Land of Mordor where the Shadows lie.

                        Comment

                        • Elfin Jedi
                          Adept
                          • Mar 2013
                          • 102

                          Thanks! Now how do I add it to/interpret this? It is the same sequence as in effects.c.

                          project-feat.c:578:47: error: 'project_feature_handler_CONF' undeclared here (not in a function)
                          #define ELEM(a, b, c, d, e, f, g, h, i, col) project_feature_handler_##a,

                          Comment

                          • Pete Mack
                            Prophet
                            • Apr 2007
                            • 6883

                            You need to write it, in a similar way as the one for SOUND:
                            static void project_feature_handler_SOUND(project_feature_hand ler_context_t *context)
                            ....

                            You can probably get by with a pure copy of it. (Compare to the ones for DARK and LIGHT to see what kinds of things need to go here.) Damage and side effects to player or monster go elsewhere. You need to write some of that too.

                            Comment

                            • Elfin Jedi
                              Adept
                              • Mar 2013
                              • 102

                              Oops, my bad. I thought the error was in the macro. It was because I hadn't edited the context yet.

                              I have my semi-variant named now btw. It is still incomplete, and a long way from a release, but I find it interesting to play.

                              Comment

                              • Elfin Jedi
                                Adept
                                • Mar 2013
                                • 102

                                How do I change the default preferences for tilesets? Right now I have to turn the graphics off every time I redownload from github, because of the monsters and terrain I've added.

                                I have the Giant bronze dragon flies breathing confusion properly now.

                                And how do I add a TIMED_DEC:CUT message for the FAangband spell "Reduce Cuts and Poison"?
                                Last edited by Elfin Jedi; April 12, 2017, 22:53.

                                Comment

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