hard to click on enemies

Got something on your mind about the project? This is the correct place for that.
Forum rules
This forum is for feature requests, content changes additions, anything not a Bug in the software.
Please report all bugs on the Support Forums
Post Reply
Chaaalle
Peon
Peon
Posts: 4
Joined: Tue Aug 16, 2005 2:38 am

hard to click on enemies

Post by Chaaalle » Tue Aug 16, 2005 2:42 am

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
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Post by ElvenProgrammer » Tue Aug 16, 2005 9:03 am

We're working on it, anyway you can still press shift to avoid moving toward enemies
xand
Peon
Peon
Posts: 95
Joined: Tue Jul 19, 2005 7:08 pm

Post by xand » Sat Sep 10, 2005 2:07 am

I had a patch from ados that enabled my to assign a key to "target nearest monster"
but I lost that... :roll:
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 ?
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Post by ElvenProgrammer » Sat Sep 10, 2005 7:21 am

Maybe I have it somewhere, did you take a look at sourceforge patch tracker?
Matt
Knight
Knight
Posts: 1746
Joined: Sat Aug 07, 2004 11:47 am
Location: Germany->Bavaria

Post by Matt » Sat Sep 10, 2005 10:54 am

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;
    }
}
xand
Peon
Peon
Posts: 95
Joined: Tue Jul 19, 2005 7:08 pm

Post by xand » Sat Sep 10, 2005 11:55 am

Nice :D

But it seems a bit much code... :roll:
xand
Peon
Peon
Posts: 95
Joined: Tue Jul 19, 2005 7:08 pm

Post by xand » Mon Oct 03, 2005 10:51 pm

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...
Matt
Knight
Knight
Posts: 1746
Joined: Sat Aug 07, 2004 11:47 am
Location: Germany->Bavaria

Post by Matt » Tue Oct 04, 2005 3:34 pm

if ((being->getType() == Being::PLAYER && being != player_node) && ((being->action == Being::STAND) || (being->action == Being::WALK) || (being->action == Being::SIT)))
xand
Peon
Peon
Posts: 95
Joined: Tue Jul 19, 2005 7:08 pm

Post by xand » Tue Oct 04, 2005 8:20 pm

Thx that works nicely.
I'll try to post my version soon
Post Reply