Target Nearest Player

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
Trinexx
Peon
Peon
Posts: 27
Joined: 26 Dec 2007, 19:46
Location: Florida
Contact:

Target Nearest Player

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

Post 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.)
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

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

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

Post 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.
  • 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: 26 Dec 2007, 19:46
Location: Florida
Contact:

Post by Trinexx »

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: 16 Jan 2008, 21:09

Re: Target Nearest Player

Post by Landon »

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: 02 Dec 2007, 03:29
Location: Austin, TX, USA

Re: Target Nearest Player

Post by Sertraline »

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