Target Nearest Player

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
Trinexx
Peon
Peon
Posts: 27
Joined: Wed Dec 26, 2007 8:46 pm
Location: Florida
Contact:

Target Nearest Player

Post by Trinexx » Sat Dec 29, 2007 7:54 pm

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.
Quiche_on_a_leash
Novice
Novice
Posts: 221
Joined: Fri Oct 20, 2006 5:44 pm

Post by Quiche_on_a_leash » Sat Dec 29, 2007 11:48 pm

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.)
User avatar
Jaxad0127
TMW Adviser
TMW Adviser
Posts: 4209
Joined: Thu Nov 01, 2007 6:35 pm
Location: Internet

Post by Jaxad0127 » Sat Dec 29, 2007 11:57 pm

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.
User avatar
Trinexx
Peon
Peon
Posts: 27
Joined: Wed Dec 26, 2007 8:46 pm
Location: Florida
Contact:

Post by Trinexx » Sun Dec 30, 2007 12:29 am

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.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: Thu Aug 25, 2005 5:08 pm
Location: Germany

Post by Crush » Sun Dec 30, 2007 1:02 am

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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Trinexx
Peon
Peon
Posts: 27
Joined: Wed Dec 26, 2007 8:46 pm
Location: Florida
Contact:

Post by Trinexx » Sun Dec 30, 2007 2:03 am

Oh, thank God for Crush. Now I can get back to work on making the alt+* keys configurable.
User avatar
Landon
Novice
Novice
Posts: 136
Joined: Wed Jan 16, 2008 10:09 pm

Re: Target Nearest Player

Post by Landon » Fri Mar 14, 2008 12:07 am

where can I get this patch? the link is dead
Landon
"Life is like one big screwed up Merry-Go-Round, I get thrown off but I get right back on"
User avatar
Sertraline
Novice
Novice
Posts: 128
Joined: Sun Dec 02, 2007 4:29 am
Location: Austin, TX, USA

Re: Target Nearest Player

Post by Sertraline » Fri Mar 14, 2008 3:05 am

I believe it's in the latest subversion client.
Post Reply