Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 26, 2020, 03:19   #61
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 588
DavidMedley is on a distinguished road
That's what I already did, but it didn't work. Thanks.
DavidMedley is online now   Reply With Quote
Old March 26, 2020, 03:38   #62
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 8,249
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
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.
Nick is offline   Reply With Quote
Old March 26, 2020, 06:54   #63
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,299
wobbly is on a distinguished road
You could push it to your repository where it'd be easier to see if you've done something strange?
wobbly is offline   Reply With Quote
Old March 26, 2020, 15:44   #64
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 588
DavidMedley is on a distinguished road
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.
DavidMedley is online now   Reply With Quote
Old March 26, 2020, 22:48   #65
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 588
DavidMedley is on a distinguished road
Is there an easy way to specify KILL_WALL to be adjacent only?
DavidMedley is online now   Reply With Quote
Old March 27, 2020, 00:02   #66
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 588
DavidMedley is on a distinguished road
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;
}
DavidMedley is online now   Reply With Quote
Old March 27, 2020, 01:16   #67
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 8,249
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
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.
Nick is offline   Reply With Quote
Old March 29, 2020, 20:35   #68
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 588
DavidMedley is on a distinguished road
In player-calcs.c
Code:
if (player_has(p, PF_EVIL) && character_dungeon) {
what does character_dungeon mean?
DavidMedley is online now   Reply With Quote
Old March 29, 2020, 21:25   #69
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 8,249
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
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.
Nick is offline   Reply With Quote
Old March 31, 2020, 18:05   #70
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 588
DavidMedley is on a distinguished road
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?
DavidMedley is online now   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 20:45.


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