Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old April 9, 2020, 01:51   #91
backwardsEric
Apprentice
 
Join Date: Aug 2019
Posts: 87
backwardsEric is on a distinguished road
Quote:
Originally Posted by DavidMedley View Post
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?
backwardsEric is offline   Reply With Quote
Old April 9, 2020, 02:34   #92
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 774
DavidMedley is on a distinguished road
Yeah, that makes a lot of sense. Seems obvious now that you say it. I'll try again later.
DavidMedley is offline   Reply With Quote
Old April 9, 2020, 02:49   #93
moosferatu
Apprentice
 
Join Date: Feb 2020
Posts: 99
moosferatu is on a distinguished road
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.
moosferatu is offline   Reply With Quote
Old April 9, 2020, 03:33   #94
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 774
DavidMedley is on a distinguished road
OK good stuff. Thanks.
DavidMedley is offline   Reply With Quote
Old June 1, 2020, 19:15   #95
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 774
DavidMedley is on a distinguished road
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?
DavidMedley is offline   Reply With Quote
Old June 1, 2020, 21:43   #96
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,473
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
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.
Nick is offline   Reply With Quote
Old June 1, 2020, 21:55   #97
Sideways
Knight
 
Join Date: Nov 2008
Posts: 675
Sideways is on a distinguished road
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.)
__________________
The Complainer worries about the lack of activity here these days.

Last edited by Sideways; June 1, 2020 at 22:29.
Sideways is offline   Reply With Quote
Old June 2, 2020, 02:00   #98
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 774
DavidMedley is on a distinguished road
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;
	}
DavidMedley is offline   Reply With Quote
Old June 2, 2020, 03:10   #99
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 774
DavidMedley is on a distinguished road
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.
DavidMedley is offline   Reply With Quote
Old June 2, 2020, 03:26   #100
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,473
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
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.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a code? jozmon Development 19 August 4, 2014 00:38
Questions regarding vanilla inscriptions Avenger Vanilla 8 December 13, 2013 21:15
Questions regarding vanilla dungeon design Cazliostro Vanilla 23 October 11, 2010 12:05
code help please will_asher Variants 22 March 15, 2010 19:00
Looking through the code K.I.L.E.R Vanilla 5 July 11, 2007 08:01


All times are GMT +1. The time now is 00:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.