Vanilla Code Questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DavidMedley
    Veteran
    • Oct 2019
    • 1004

    #61
    That's what I already did, but it didn't work. Thanks.
    Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9647

      #62
      Originally posted by DavidMedley
      That's what I already did, but it didn't work. Thanks.
      Hard to guess exactly where it's failing, but player_inc_check() in player-timed.c is a good place to start.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • wobbly
        Prophet
        • May 2012
        • 2633

        #63
        You could push it to your repository where it'd be easier to see if you've done something strange?

        Comment

        • DavidMedley
          Veteran
          • Oct 2019
          • 1004

          #64
          I think I missed updating something. I made sure all my changes were present, recompiled, and it worked. I'm still a bit baffled how everything the user can see said it was working, but it didn't. Doesn't matter for now. Sorry for the false alarm.
          Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

          Comment

          • DavidMedley
            Veteran
            • Oct 2019
            • 1004

            #65
            Is there an easy way to specify KILL_WALL to be adjacent only?
            Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

            Comment

            • DavidMedley
              Veteran
              • Oct 2019
              • 1004

              #66
              Melee_blows

              Finally wrote my first effect handler. I really don't understand the code too well, but copy and paste served me surprisingly well. Only bug I'm aware of is it crashes if there's not an enemy to use it on. This obviously needs to be fixed. Anything else anyone sees? I'm not confident in the target and grid stuff.

              Code:
              bool effect_handler_MELEE_BLOWS(effect_handler_context_t *context)
              {
              	int blows = effect_calculate_value(context, false);
              	bool fear;
              	int taim;
              	struct loc target = loc(-1, -1);
              	struct loc grid = player->grid;
              
              /* players only for now */
              	if (context->origin.what != SRC_PLAYER)
              		return false;
              
              	/* Ask for a target if no direction given */
              	if (context->dir == DIR_TARGET && target_okay()) {
              		target_get(&target);
              	} else {
              		target = loc_sum(player->grid, ddgrid[context->dir]);
              	}
              
              	taim = distance(grid, target);
              	if (taim > 1) {
              		msgt(MSG_GENERIC, "Distance to target %d", taim);
              		return false;
              	}
              
              	while (blows-- > 0) {
              		if(py_attack_real(player, target, &fear)) {return true;}
              	}
              	return true;
              }
              Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9647

                #67
                Originally posted by DavidMedley
                Is there an easy way to specify KILL_WALL to be adjacent only?
                I think you probably want the project_touch() function in effects.c.

                I don't see anything obviously wrong with your effect handler; I'm guessing the most likely source of problems is whether py_attack_real() plays nicely with being called in this way.
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • DavidMedley
                  Veteran
                  • Oct 2019
                  • 1004

                  #68
                  In player-calcs.c
                  Code:
                  if (player_has(p, PF_EVIL) && character_dungeon) {
                  what does character_dungeon mean?
                  Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9647

                    #69
                    Originally posted by DavidMedley
                    In player-calcs.c
                    Code:
                    if (player_has(p, PF_EVIL) && character_dungeon) {
                    what does character_dungeon mean?
                    It's a hackish global variable that is set to true when a level has been generated and then to false when generation for a new level starts. It gets used quite a bit to enable calculations in the birth process when you don't really have a character but want to pretend you have.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • DavidMedley
                      Veteran
                      • Oct 2019
                      • 1004

                      #70
                      Compiling For Windows

                      Is compiling for Windows pretty easy? I followed the instructions. The compile fails and I'm told I need windows.h, but I'm sure the list doesn't end there. Am I supposed to grab standard windows libraries until the compile goes through?
                      Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                      Comment

                      • wobbly
                        Prophet
                        • May 2012
                        • 2633

                        #71
                        What are you using to compile? I use MINGW & I just edit makefile.win adding the line

                        MINGW=yes

                        then I type:

                        make -f makefile.win

                        & that's it. (except when it throws compiler errors)

                        Comment

                        • DavidMedley
                          Veteran
                          • Oct 2019
                          • 1004

                          #72
                          I just followed these instructions on linux:
                          Code:
                          ./autogen.sh
                          ./configure --enable-win --disable-curses --build=i686-pc-linux-gnu --host=i586-mingw32msvc
                          Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                          Comment

                          • DavidMedley
                            Veteran
                            • Oct 2019
                            • 1004

                            #73
                            When you're testing and want to advance a character in experience (through debug commands), how do you balance equipment? Any rules of thumb?
                            Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                            Comment

                            • DavidMedley
                              Veteran
                              • Oct 2019
                              • 1004

                              #74
                              Originally posted by wobbly
                              What are you using to compile? I use MINGW & I just edit makefile.win adding the line

                              MINGW=yes

                              then I type:

                              make -f makefile.win

                              & that's it. (except when it throws compiler errors)
                              I wasn't able to follow these directions. The closest I could find was src/Makefile.win . But I get errors like this:
                              Code:
                              /bin/bash: no: command not found
                              Makefile:31: recipe for target 'win/angband.res' failed
                              My knowledge of compiling C is close to zero
                              Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                              Comment

                              • Sideways
                                Knight
                                • Nov 2008
                                • 896

                                #75
                                Originally posted by DavidMedley
                                When you're testing and want to advance a character in experience (through debug commands), how do you balance equipment? Any rules of thumb?
                                For testing monster balance, the ideal is to just have a real character of the appropriate level, put aside for testing purposes. (You don't necessarily need to have that many of them - one early-game @, one or two midgame @s and one endgame @ will go a really long way.)

                                If you're testing character balance (e.g. on a new class or a heavily modified one) there's really no shortcuts, you have to play a real @ to know if it's good, or somehow convince a bunch of other people to do it for you

                                If you're testing things unrelated to monster/character balance you generally don't need to worry about niceties like equipment; and if you're testing monsters of really high level and don't have a real endgame character at hand you can just put together a random kit of oppy artifacts.
                                The Complainer worries about the lack of activity here these days.

                                Comment

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