Page 1 of 1

Target Nearest Player

Posted: 29 Dec 2007, 18:54
by Trinexx
QOAL made the button, I reworked it to use the 0.0.24 controls. Default button is 'q', but that can be changed from the keyboard setup dialog.

Put simply, this button allows you to automatically target other players. Useful for the arena, completely useless everywhere else. No more clicking around like mad trying to get a lock on a player who keeps running in a circle like a dork.


Patch files can be found here.


Image


EDIT: Suppose I should explain what the changes in each file do
keyboardconfig.cpp: Defines the button
keyboardconfig.h: Lists the button in enum keyaction
game.cpp: Defines a use for the key.
beingmanager.cpp: Adds a 1 tile deadzone so you don't target yourself with the button.

Posted: 29 Dec 2007, 22:48
by Quiche_on_a_leash
Just a note about the 'deadzone' that was added, although there isn't much of problem using that method, it would be better if instead of having a 'deadzone' it checked that the being id wasn't the same as the players.
But I couldn't figure that out.

(It also used to work fine without having to add a deadzone.)

Posted: 29 Dec 2007, 22:57
by Jaxad0127
Quiche_on_a_leash wrote:Just a note about the 'deadzone' that was added, although there isn't much of problem using that method, it would be better if instead of having a 'deadzone' it checked that the being id wasn't the same as the players.
But I couldn't figure that out.

(It also used to work fine without having to add a deadzone.)
It didn't work at all without dead zone (this is a new feature). ID checking is better because deadzone doesn't work correctly if you are on the same tile as the nearest player.

Posted: 29 Dec 2007, 23:29
by Trinexx
I spent most of last night trying to make an ID check. The deadzone is temporary until I work out a way to make the alternative possible.

Posted: 30 Dec 2007, 00:02
by Crush
Thanks for the patches. I applied them with a small modification. I solved the self-targeting problem by adding another overloaded Version of BeingManager::findNearestLivingBeing that takes a pointer to a being instead of coordinates and excludes the provided being from the result. Excluding a target that is exactly on the provided coordinates might cause unexpected behavior somewhere else.

Posted: 30 Dec 2007, 01:03
by Trinexx
Oh, thank God for Crush. Now I can get back to work on making the alt+* keys configurable.

Re: Target Nearest Player

Posted: 13 Mar 2008, 23:07
by Landon
where can I get this patch? the link is dead

Re: Target Nearest Player

Posted: 14 Mar 2008, 02:05
by Sertraline
I believe it's in the latest subversion client.