Page 1 of 1
hard to click on enemies
Posted: 16 Aug 2005, 01:42
by Chaaalle
It?s hard sometimes to click on one enemy to attack it?s happens all the time i click and walk forward and got attacked instead i was suppose to klick on the enemie!
please fix it
Posted: 16 Aug 2005, 08:03
by ElvenProgrammer
We're working on it, anyway you can still press shift to avoid moving toward enemies
Posted: 10 Sep 2005, 01:07
by xand
I had a patch from ados that enabled my to assign a key to "target nearest monster"
but I lost that...
That worked well, especially when using bow.
I don't think I can reproduce it, but maybe someone else has it or knows if ados will be back ?
Posted: 10 Sep 2005, 06:21
by ElvenProgrammer
Maybe I have it somewhere, did you take a look at sourceforge patch tracker?
Posted: 10 Sep 2005, 09:54
by Matt
Code: Select all
void select_nearest_enemy()
{
// Find monster to attack
std::list<Being*>::iterator i;
int mindist = INT_MAX;
Being *minmonster;
for (i = beings.begin(); i != beings.end(); i++) {
Being *being = (*i);
// Check if is a MONSTER that is alive
int rx, ry;
if ((being->getType() == Being::MONSTER || being->getType() == Being::PLAYER) && ((being->action == Being::STAND) || (being->action == Being::WALK)))
{
int a = (being->x - player_node->x);
int b = (being->y - player_node->y);
int curdist = (a*a + b*b);
if (mindist > curdist && curdist != 0) {
mindist = curdist;
minmonster = being;
//strcat(logstring, tempstring);
//chatWindow->chat_log(logstring, BY_OTHER);
}
}
}
// If Monster found
if (mindist != INT_MAX)
{
//char tempstring[100];
//sprintf(tempstring,"monster found: (%d|%d)", minmonster->x, minmonster->y);
//chatWindow->chat_log(tempstring, BY_OTHER);
autoTarget = minmonster;
}
}
Posted: 10 Sep 2005, 10:55
by xand
Nice
But it seems a bit much code...
Posted: 03 Oct 2005, 21:51
by xand
OK I modified it that one version only targets monsters and the other
one should target players. But it doesn't work....
Note: your version only works for standing/walking players and monsters.
Sitting Players can't be targeted.
that:
if ((being->getType() == Being::PLAYER) && ((being->action == Being::STAND) || (being->action == Being::WALK)))
always targets myself...
Posted: 04 Oct 2005, 14:34
by Matt
if ((being->getType() == Being::PLAYER && being != player_node) && ((being->action == Being::STAND) || (being->action == Being::WALK) || (being->action == Being::SIT)))
Posted: 04 Oct 2005, 19:20
by xand
Thx that works nicely.
I'll try to post my version soon