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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnonymousHero
    Veteran
    • Jun 2007
    • 1393

    Originally posted by Derakon
    You can't do that anyway; you don't have permissions. About the worst you can do is pester Nick with pull requests, which he (and you) can freely cancel.
    Oh, I thought that was the problem. I actually do have upstream permisson to a few GitHub repositories and I'm already used to the "force-push-everywhere-and-clean-up-later" style workflow, so... I'm a bit paranoid about accidents.

    Comment

    • Elfin Jedi
      Adept
      • Mar 2013
      • 102

      Originally posted by Derakon
      About the worst you can do is pester Nick with pull requests, which he (and you) can freely cancel.
      I knew that, but I can cancel them too? That is nice.

      Comment

      • Elfin Jedi
        Adept
        • Mar 2013
        • 102

        I am actually thinking maybe I will try to use this to merge my VarAngband directory with my up to date development fork of Angband instead of Angband directly. I'm not sure it will let me create a second fork anyway. It doesn't on the website. I still don't know where to find the path directory though.

        Originally posted by Elfin Jedi
        "If you want to merge project-a into project-b:

        cd path/to/project-b
        git remote add project-a path/to/project-a
        git fetch project-a
        git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge
        git remote remove project-a"

        So, if project-a = Angband and project-b = my variant (VarAngband), first I will need to ignore the final line "git remote remove project-a", because that is assuming that mine is project-a.

        Next, where do I find the path folder/directory/thingy? It doesn't seem to be in my Documents/GitHub folder or any of its subfolders.
        Edit: It says it doesn't exist, is there a way to create a path?
        Last edited by Elfin Jedi; April 14, 2017, 20:45.

        Comment

        • Elfin Jedi
          Adept
          • Mar 2013
          • 102

          Also how do I convert the spells form FAangband into the Vanilla format. The first one I need to do is Resist Magic (Mage Book#1), I hope to be able to figure out how to do them on my own, but will probably need some help with the first few.

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9647

            Originally posted by Elfin Jedi
            Also how do I convert the spells form FAangband into the Vanilla format. The first one I need to do is Resist Magic (Mage Book#1), I hope to be able to figure out how to do them on my own, but will probably need some help with the first few.
            OK, here's a fairly general plan:
            1. Find the FA spell you want to change in src/x-spell.c; in this case it's called SPELL_RESIST_MAGIC
            2. Look at what it's doing; in this case, it's a timed effect, TMD_INVULN
            3. Look (in V) for the appropriate effect to translate that into. The master list of these is in src/list-effects.h, and the actual code for the effects is in src/effects.c. In this case, you want the TMD_INC effect, which needs also to be told which timed effect you're increasing, and for how long. Easy, right?
            4. Wrong. Next, you need to check what the timed effect actually does, and a search for INVULN will show you that the actual effect is defined in player-calcs.c in V, and play-calcs.c in FA. The V one is just increased AC, the FA one also gives pConf and pBlind. Happily your search has also told you that the INVULN effect is never actually used in V, so you can put some extra code in player-calcs.c to give pConf and pBlind without breaking anything else.
            5. Once you've done that, you simply need to add a spell record in class.txt; copy an example and change what you need to.
            6. Also note that you need to edit the book: line for the book the spell appears in, so that it has the right number of spells.


            Hope that is helpful.
            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

              Originally posted by Nick
              OK, here's a fairly general plan:
              1. Find the FA spell you want to change in src/x-spell.c; in this case it's called SPELL_RESIST_MAGIC
              2. Look at what it's doing; in this case, it's a timed effect, TMD_INVULN
              3. Look (in V) for the appropriate effect to translate that into. The master list of these is in src/list-effects.h, and the actual code for the effects is in src/effects.c. In this case, you want the TMD_INC effect, which needs also to be told which timed effect you're increasing, and for how long. Easy, right?
              4. Wrong. Next, you need to check what the timed effect actually does, and a search for INVULN will show you that the actual effect is defined in player-calcs.c in V, and play-calcs.c in FA. The V one is just increased AC, the FA one also gives pConf and pBlind. Happily your search has also told you that the INVULN effect is never actually used in V, so you can put some extra code in player-calcs.c to give pConf and pBlind without breaking anything else.
              5. Once you've done that, you simply need to add a spell record in class.txt; copy an example and change what you need to.
              6. Also note that you need to edit the book: line for the book the spell appears in, so that it has the right number of spells.


              Hope that is helpful.
              Ooh... Now I'm excited! Thanks!

              Next is Telekinesis. Basically target object, get command. Default targeting system is for monsters... Will look at concurrently.

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9647

                Originally posted by Elfin Jedi
                Next is Telekinesis. Basically target object, get command. Default targeting system is for monsters... Will look at concurrently.
                That will take considerable work, but good luck. If you get the mechanics working, I'll probably steal the code
                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

                  Ok, Resist Magic spell is now uploaded and working. Has correct AC and save bonuses, protection from confusion and blindness, and even displays a "RConf/RBlind" message.

                  GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

                  Comment

                  • Pete Mack
                    Prophet
                    • Apr 2007
                    • 6883

                    What's the point of status attacks if a spell can resist them? I can understand mushrooms working, since they're a limited resource. But this seems too strong.

                    Comment

                    • Elfin Jedi
                      Adept
                      • Mar 2013
                      • 102

                      Originally posted by Pete Mack
                      What's the point of status attacks if a spell can resist them? I can understand mushrooms working, since they're a limited resource. But this seems too strong.
                      Well, one thing I notice is that Resist Magic and Strengthen Defenses (from a rare spellbook) are the only spells from FAangband that grant confusion or blindness resistance, and they are mage spells only. Not even rogues have them. I imagine mages are probably affected more by confusion/blindness than any of the other classes except for the necromancer. Just my take on it. Nick would know for sure.

                      Comment

                      • Elfin Jedi
                        Adept
                        • Mar 2013
                        • 102

                        About Telekinesis. And targeting.

                        Originally posted by Nick
                        That will take considerable work, but good luck. If you get the mechanics working, I'll probably steal the code
                        I looked at the code and found the targeting rules in cmd-core.c. Is this unused?

                        /**
                        * Set argument 'n' to 'item'
                        */
                        void cmd_set_arg_item(struct command *cmd, const char *arg, struct object *obj)
                        {
                        union cmd_arg_data data;
                        data.obj = obj;
                        cmd_set_arg(cmd, arg, arg_ITEM, data);
                        }

                        Is this where it handles targeting a monster? (From ui-target.c)

                        /**
                        * Display targeting help at the bottom of the screen.
                        */
                        void target_display_help(bool monster, bool free)
                        {
                        /* Determine help location */
                        int wid, hgt, help_loc;
                        Term_get_size(&wid, &hgt);
                        help_loc = hgt - HELP_HEIGHT;

                        /* Clear */
                        clear_from(help_loc);

                        /* Prepare help hooks */
                        text_out_hook = text_out_to_screen;
                        text_out_indent = 1;
                        Term_gotoxy(1, help_loc);

                        /* Display help */
                        text_out_c(COLOUR_L_GREEN, "<dir>");
                        text_out(" and ");
                        text_out_c(COLOUR_L_GREEN, "<click>");
                        text_out(" look around. '");
                        text_out_c(COLOUR_L_GREEN, "g");
                        text_out(" moves to the selection. '");
                        text_out_c(COLOUR_L_GREEN, "p");
                        text_out("' selects the player. '");
                        text_out_c(COLOUR_L_GREEN, "q");
                        text_out("' exits. '");
                        text_out_c(COLOUR_L_GREEN, "r");
                        text_out("' displays details. '");

                        if (free)
                        {
                        text_out_c(COLOUR_L_GREEN, "m");
                        text_out("' restricts to interesting places. ");
                        }
                        else
                        {
                        text_out_c(COLOUR_L_GREEN, "+");
                        text_out("' and '");
                        text_out_c(COLOUR_L_GREEN, "-");
                        text_out("' cycle through interesting places. '");
                        text_out_c(COLOUR_L_GREEN, "o");
                        text_out("' allows free selection. ");
                        }

                        if (monster || free)
                        {
                        text_out("'");
                        text_out_c(COLOUR_L_GREEN, "t");
                        text_out("' targets the current selection.");
                        }

                        /* Reset */
                        text_out_indent = 0;
                        }

                        Also, this is from player-spell.c.

                        bool spell_needs_aim(int spell_index)
                        {
                        const struct class_spell *spell = spell_by_index(spell_index);
                        return effect_aim(spell->effect);
                        }

                        And about Telekinesis, where would I copy this into? I don't know if it needs to be changed yet.

                        {
                        s16b ty, tx;
                        if (!target_set_interactive(TARGET_OBJ, -1, -1))
                        return FALSE;
                        target_get(&tx, &ty);
                        if (!py_pickup(1, ty, tx))
                        return FALSE;
                        break;
                        }

                        Comment

                        • Elfin Jedi
                          Adept
                          • Mar 2013
                          • 102

                          I also found in ui-object.c

                          /**
                          * Display an object. Each object may be prefixed with a label.
                          * Used by show_inven(), show_equip(), show_quiver() and show_floor().
                          * Mode flags are documented in object.h
                          */
                          static void show_obj(int obj_num, int row, int col, bool cursor,
                          olist_detail_t mode)
                          {
                          int attr;
                          int label_attr = cursor ? COLOUR_L_BLUE : COLOUR_WHITE;
                          int ex_offset_ctr;
                          char buf[80];
                          struct object *obj = items[obj_num].object;
                          bool show_label = mode & (OLIST_WINDOW | OLIST_DEATH) ? TRUE : FALSE;
                          int label_size = show_label ? strlen(items[obj_num].label) : 0;
                          int equip_label_size = strlen(items[obj_num].equip_label);
                          etc.

                          As well as the "static void store_display_entry" from ui-store.c.

                          I still haven't got the nature and necromancy spellbooks to display text in their inventory and store entries. I am not sure why, do they need a kind added somewhere? I also can't get the game to display a section for them in the debug option 'create an object' menu.

                          I added them to object.txt and object-base.txt, and all the TV lists that contained both magic and prayer books. And they work fine except for displaying their names in those lists. (And having the correct spells. Mage and rogue copies currently.) I am missing something, somewhere.

                          Edit: Using 4.0.5 release.
                          Last edited by Elfin Jedi; April 16, 2017, 22:48.

                          Comment

                          • Nick
                            Vanilla maintainer
                            • Apr 2007
                            • 9647

                            Originally posted by Elfin Jedi
                            I still haven't got the nature and necromancy spellbooks to display text in their inventory and store entries. I am not sure why, do they need a kind added somewhere? I also can't get the game to display a section for them in the debug option 'create an object' menu.

                            I added them to object.txt and object-base.txt, and all the TV lists that contained both magic and prayer books. And they work fine except for displaying their names in those lists. (And having the correct spells. Mage and rogue copies currently.) I am missing something, somewhere.

                            Edit: Using 4.0.5 release.
                            You will need to add nature and necromancy realms to realm.txt, and that may do it.

                            As for telekinesis, my guess is that there are two things to do:
                            1. Look at where TARGET_OBJ occurs in FA, and compare it to how TARGET_KILL is used, then try to mirror that in V
                            2. Write an effect handler for effects.c - to do this, you'll have to work out how to put the item in the player's inventory; in FA I did it by changing the pickup command to be able to pick up items not on the player grid, but there may be better ways.
                            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

                              From lots earlier in this thread.

                              Originally posted by Pete Mack
                              There is no reason for slays of low-HP or never-move classes like insects and plants. Slay-human has limited use as well--Slay Dragon is simply so much more useful, I would never choose the former. The result of too much slay dilution will be an excess of junk, and yet more weak randart weapons with lots of meaningless flags. This has been tried before. It is not generally successful.
                              I just combined Slay Orc, Giant, Troll, and Humanoid into Slay Humanoid by giving them all the HUMANOID monster flag, and combined Slay Animal and Slay Plant into Slay Nature. I also dropped Slay Insect.

                              Edit: Also, realm.txt doesn't exist yet in 4.0.5. It would probably make things a lot easier, but I don't have it yet.

                              Edit: How do macros work? Example:

                              } summon_info[] = {
                              #define S(a, b, c, d, e, f, g, h) { #a, b, c, d, e, f, g, h },
                              #include "list-summon-types.h"
                              #undef S
                              };

                              The effects.c one is very similar.
                              Last edited by Elfin Jedi; April 17, 2017, 04:12.

                              Comment

                              • Derakon
                                Prophet
                                • Dec 2009
                                • 9022

                                Originally posted by Elfin Jedi
                                Edit: How do macros work? Example:

                                } summon_info[] = {
                                #define S(a, b, c, d, e, f, g, h) { #a, b, c, d, e, f, g, h },
                                #include "list-summon-types.h"
                                #undef S
                                };
                                This is a bit of trickery to convert the data in list-summon-types.h into a convenient format (the summon_info array). list-summon-types.h has a bunch of entries of the form S(...) with 8 items in-between the parentheses; here we're defining a macro that says "Intepret ''S(...)'' as creating an 8-element array out of the contents of the parentheses, with a comma at the end." Since we're already in an array context (we're defining what summon_info is), these arrays become the contents of summon_info, making it into an array of arrays.

                                Comment

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