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

    #16
    I added a bookstore and now I am getting an assertion failure on cave-map.c line 178. The line with context says:

    178: assert((int) g->f_idx <= FEAT_PASS_RUBBLE);
    179: if (!g->hallucinate)
    180: assert((int)g->m_idx < cave->mon_max);

    I have no idea what this means.

    (Trying to edit the indentations back in.)

    Didn't work though.

    Comment

    • Pete Mack
      Prophet
      • Apr 2007
      • 6883

      #17
      It's a save-file breaking change, in the sense that you will need to start a new character. The game makes assumptions about the order of features, with impassible features listed second. You will need to make the new feature just before or after your home, depending on what number you want to give it.


      Originally posted by Elfin Jedi
      I added a bookstore and now I am getting an assertion failure on cave-map.c line 178.

      Comment

      • Elfin Jedi
        Adept
        • Mar 2013
        • 102

        #18
        Ok thanks a lot!

        Comment

        • Elfin Jedi
          Adept
          • Mar 2013
          • 102

          #19
          Now there are dtrap edge - walls in the town. Is there somewhere else I need to change terrain orders?

          My sister who is helping me over Facebook chat says:

          "Ok, I was wondering about that, but I don't think it's smart programming."

          me-"Ok" "um..." "now there are trap detect borders in town "

          me-"how would you program it? I am sure they would be interested if you found a solution."

          her-"Oh dear. I assume you added the bookstore earlier in the list and bumped all the other feature numbers? It must be making assumptions about those feature numbers somewhere else in the code and is either generating or displaying a different terrain that it thinks."

          her-"I would think that passable should be a property on either terrain type, but that would be a big change."

          me-"yeah, that is what I needed to do."

          me-"mind if I quote you on the forum?"

          her-"lol sure"
          Attached Files

          Comment

          • Elfin Jedi
            Adept
            • Mar 2013
            • 102

            #20
            I assume I needed to change all the numbers...

            Oh, it is solved for a new character though.

            So, it was just the broken savefile that was a problem.
            Last edited by Elfin Jedi; July 11, 2016, 17:33.

            Comment

            • Pete Mack
              Prophet
              • Apr 2007
              • 6883

              #21
              Yes. As it happens, I agree with your sister up to a point. As a maintenance thing, it is good that related features be put close together. And the assigned numbers are necessary, otherwise savefiles could never work.

              But the numbers SHOULD NOT BE DENSE. There should be modest gaps between each set of features, so future edits are easier.

              Comment

              • Elfin Jedi
                Adept
                • Mar 2013
                • 102

                #22
                The bookstore still isn't there in the new file though. It just replaced the magic store with an orange 9, and created a square of wall without a shop in it. Hmm...

                Oh, and my game still doesn't display the new spellbook names in the inventory list, and I assume wouldn't in a store list.

                P.S.

                Mage spells are mostly coordinated with Oangband now with the exception of Hold Monsters and some of the rare spellbook spells. There isn't a way to paralyze monsters that I can see in list-effects.h. Help with making monsters able to turn themselves invisible temporarily would be appreciated too.

                Comment

                • Elfin Jedi
                  Adept
                  • Mar 2013
                  • 102

                  #23
                  Gaps in the terrain list would be nice for editing.

                  Comment

                  • Pete Mack
                    Prophet
                    • Apr 2007
                    • 6883

                    #24
                    Yikes. One trouble is that MAX_STORES is hardcoded as 8 in store.h.
                    (Squares of wall near the edge of the map are quite common, and have to do with ordinary starburst generation, not with creating the stores.)

                    Don't know about why the magic shop would get a new number though.

                    Originally posted by Elfin Jedi
                    The bookstore still isn't there in the new file though. It just replaced the magic store with an orange 9, and created a square of wall without a shop in it. Hmm...

                    Oh, and my game still doesn't display the new spellbook names in the inventory list, and I assume wouldn't in a store list.

                    P.S.

                    Mage spells are mostly coordinated with Oangband now with the exception of Hold Monsters and some of the rare spellbook spells. There isn't a way to paralyze monsters that I can see in list-effects.h. Help with making monsters able to turn themselves invisible temporarily would be appreciated too.

                    Comment

                    • Pete Mack
                      Prophet
                      • Apr 2007
                      • 6883

                      #25
                      Note: If you are only making books available in that shop, it's better to rework the stores so all books show up in the same shop, a la, NPP.

                      Comment

                      • Elfin Jedi
                        Adept
                        • Mar 2013
                        • 102

                        #26
                        Actually fixed MAX_STORES as well as moved all the books to the bookstore (With the unfortunate result that you now can't buy any spellbooks in town lol) before I got the assertion failure that was solved by changing the feature numbers.

                        Also wasn't just 1 square of wall near the wall that I was talking about. It was a 3x3 (normal shop size) square in the middle of the map. I'll get a screenshot.

                        P.S.

                        I removed the books in other stores in store.txt, is that what you meant?
                        Attached Files

                        Comment

                        • Elfin Jedi
                          Adept
                          • Mar 2013
                          • 102

                          #27
                          Uploaded the edited store.h, store.txt, and terrain.txt to github, seemed like a good time for an update since the game currently runs .

                          Though I am putting .txt changes in the user folder still... I suppose I should move them to the gamedata folder.

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

                          Comment

                          • Elfin Jedi
                            Adept
                            • Mar 2013
                            • 102

                            #28
                            I think it probably would be helpful if I list changes I have already made when I ask a question, so...

                            I am trying to make it so monsters can cast a spell to become invisible temporarily. So far I have added this:

                            "name:INVIS
                            hit:100
                            effect:MON_TIMED_INC:INVISIBLE
                            dice:50
                            power:40
                            lore:make self invisible
                            message-vis:{name} disappears."

                            to monster_spell.txt, and this:

                            "RSF(INVISIBLE, RST_TACTIC)"

                            to list-mon-spells.h.

                            What else do I need to do? (It is crashing when it tries to initialize monster spells after I launch.)

                            Right now I am studying lines 391-403 of effects.c, in an attempt to understand what it does. (I am really new to programming, have mostly worked with edit files.)

                            Also is there a message somewhere for when the spell effect ends?
                            Last edited by Elfin Jedi; July 11, 2016, 22:48.

                            Comment

                            • Pete Mack
                              Prophet
                              • Apr 2007
                              • 6883

                              #29
                              You have added store.txt in the user directory, so I can't generate a diff at GitHub.

                              Comment

                              • takkaria
                                Veteran
                                • Apr 2007
                                • 1951

                                #30
                                Originally posted by Elfin Jedi
                                I think it probably would be helpful if I list changes I have already made when I ask a question, so...

                                I am trying to make it so monsters can cast a spell to become invisible temporarily. So far I have added this:

                                "name:INVIS
                                hit:100
                                effect:MON_TIMED_INC:INVISIBLE
                                dice:50
                                power:40
                                lore:make self invisible
                                message-vis:{name} disappears."

                                to monster_spell.txt, and this:

                                "RSF(INVISIBLE, RST_TACTIC)"

                                to list-mon-spells.h.
                                You should choose one name - INVIS or INVISIBLE - and stick with it for both the name: field and the RSF bit. They have to match.

                                What else do I need to do? (It is crashing when it tries to initialize monster spells after I launch.)
                                It is crashing, I think, because the INVISIBLE after MON_TIMED_INC isn't defined anywhere. For it to be recognised you need to add a new monster timd effect in list-mon-timed.h and also corresponding messages to list-mon-message.h.

                                After doing all of that, the game should compile and load fine, and monsters with this spell will case it but it won't do anything. For that you need to search through the code for mentions of INVISIBLE and work out where to add extra checks. 'struct monster' has a field called m_timed where all timed effects are stored, so in theory it should be as simple as working out where the game checks for monster invisibility are and adding '|| mon->m_timed[MON_TMD_INVISIBLE]'.
                                takkaria whispers something about options. -more-

                                Comment

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