Vanilla Code Questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • backwardsEric
    Knight
    • Aug 2019
    • 527

    #91
    Originally posted by DavidMedley
    Code:
    checking for i586-mingw32msvc-gcc... no
    checking for gcc... gcc
    configure: WARNING: using cross tools not prefixed with host triplet
    Someone with more experience will likely chime in, but from that message, it used gcc rather than i586-mingw32msvc-gcc as the compiler. If that's the gcc targeting Linux (which would depend on what your path is), then that would explain why it couldn't find windows.h.

    Is the mingw executable directory in your path?

    Comment

    • DavidMedley
      Veteran
      • Oct 2019
      • 1004

      #92
      Yeah, that makes a lot of sense. Seems obvious now that you say it. I'll try again later.
      Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

      Comment

      • moosferatu
        Apprentice
        • Feb 2020
        • 99

        #93
        I don't know what OS you're using, but I was able to build it just now by doing the following on Fedora:

        Code:
        sudo dnf install mingw32-binutils mingw32-gcc
        ./configure --enable-win --disable-curses --build=i686-pc-linux-gnu --host=i686-w64-mingw32
        make
        As the Angband compile instructions say, the value of --host is system dependent. The easiest way to check what that value should be, if yours is different, is just through tab completion. You should have a command like i686-w64-mingw32-gcc on your path.

        Comment

        • DavidMedley
          Veteran
          • Oct 2019
          • 1004

          #94
          OK good stuff. Thanks.
          Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

          Comment

          • DavidMedley
            Veteran
            • Oct 2019
            • 1004

            #95
            I'm back! :-D

            In effects.c effect_handler_MOVE_ATTACK function I wrote a while ago:

            Code:
            	/* Ask for a target */
            	if ((context->dir == DIR_TARGET) && target_okay()) {
            		target_get(&target);
            	}
            
            	/* Should only target known/visible? */
            	if (square_monster(cave, target) == NULL) {
            		msg("This spell must target a monster.");
            		return false;
            	}
            I thought this would allow you to press an direction key and if there's an adjacent monster there, the target would be set and pass the "must target a monster" test. But it doesn't. Any hints here?
            Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

            Comment

            • Nick
              Vanilla maintainer
              • Apr 2007
              • 9637

              #96
              Originally posted by DavidMedley
              I'm back! :-D

              In effects.c effect_handler_MOVE_ATTACK function I wrote a while ago:

              Code:
              	/* Ask for a target */
              	if ((context->dir == DIR_TARGET) && target_okay()) {
              		target_get(&target);
              	}
              
              	/* Should only target known/visible? */
              	if (square_monster(cave, target) == NULL) {
              		msg("This spell must target a monster.");
              		return false;
              	}
              I thought this would allow you to press an direction key and if there's an adjacent monster there, the target would be set and pass the "must target a monster" test. But it doesn't. Any hints here?
              You don't need the second code block. That code is designed to make sure the player has actually formally targeted a monster, and can't just use a direction, as in the Command spell, for example - so it stops precisely what you want to happen.
              One for the Dark Lord on his dark throne
              In the Land of Mordor where the Shadows lie.

              Comment

              • Sideways
                Knight
                • Nov 2008
                • 896

                #97
                Nick can correct me if I'm wrong, since I'm by no means familiar with V's targetting code, but it looks to me like the first code block would specifically handle the situation in which the player specified a target location rather than a target direction (since DIR_TARGET is 5); that part should work, but only if you want to accept location targetting in addition to direction targetting, and only if there's code elsewhere for handling a direction target. (I don't see any such code in effect_handler_MOVE_ATTACK.)
                Last edited by Sideways; June 1, 2020, 22:29.
                The Complainer worries about the lack of activity here these days.

                Comment

                • DavidMedley
                  Veteran
                  • Oct 2019
                  • 1004

                  #98
                  OK, that DIR_TARGET is 5 bit helped. New code seems to work:

                  Code:
                  	if (context->dir == DIR_TARGET) {
                  		target_get(&target);
                  	}
                  	else {
                  		target = loc_sum(player->grid, ddgrid[context->dir]);
                  	}
                  	/* Should only target known/visible? */
                  	if (square_monster(cave, target) == NULL) {
                  		msg("This spell must target a monster.");
                  		return false;
                  	}
                  Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                  Comment

                  • DavidMedley
                    Veteran
                    • Oct 2019
                    • 1004

                    #99
                    Does monster_is_visible return true if you are aware of the monster through ESP, detection, etc? If not, is there something that does? Sorry, being a bit lazy right now because I'm in a rush.

                    EDIT: monster_is_in_view, monster_is_visible, monster_is_obvious look like the leading candidates.
                    Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                    Comment

                    • Nick
                      Vanilla maintainer
                      • Apr 2007
                      • 9637

                      Originally posted by DavidMedley
                      Does monster_is_visible return true if you are aware of the monster through ESP, detection, etc? If not, is there something that does? Sorry, being a bit lazy right now because I'm in a rush.

                      EDIT: monster_is_in_view, monster_is_visible, monster_is_obvious look like the leading candidates.
                      monster_is_visible is the one you want - it corresponds to what is drawn on the screen. Unless you want to rule out mimics, in which case use monster_is_obvious.

                      And don't panic too much
                      One for the Dark Lord on his dark throne
                      In the Land of Mordor where the Shadows lie.

                      Comment

                      • DavidMedley
                        Veteran
                        • Oct 2019
                        • 1004

                        Great, thanks! I think I got it.
                        Please like my indie game company on Facebook! https://www.facebook.com/RatherFunGames

                        Comment

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