Forums » Community Projects


Apr 13, 2012 Pizzasgood link

Normally, the target nearest enemy functionality is based on the GetFriendlyStatus function, which also determines whether an enemy shows up on the radar as a green or red dot. If you want to override that function so that the green/red colors signify other information (such as proximity, priority, or relative velocity), this breaks the "target nearest enemy" deal.

When I started using a plugin that did that a few years ago, I developed my own plugin to restore my lost target nearest functionality. I kept intending to post it but never got around to it until now.

What this plugin does is targets the nearest ship, regardless of hostility. It has options to ignore people in your group or guild, with the group exception enabled by default (but not the guild one).


/targetbutton aggro
/targetbutton group
/targetbutton guild
/targetbutton print

Using no option will target the nearest ship according to its settings. The group and guild options toggle whether it ignores group members and guild members. The aggro option toggles whether it restricts itself to hostile people. The print option shows the current settings.
Apr 14, 2012 Pizzasgood link
Updated to version 1.1, which does save. I also fixed a typo - the 'agro' command is now 'aggro'. Enjoy.
Jun 09, 2012 Woodlander link
Thanks Pizzasgood, gonna give her a try and see what's what.

PS. /me checked the zip files name thoroughly... just in case. ;p
Jun 09, 2012 Keller link
Did you try saving the old function a variable, then calling the old function before performing your own processing?
Jun 10, 2012 Pizzasgood link
No, never tried that. I will try it the next time I play, but I doubt it will work, since the standard target-nearest command seems to be based on the return value of GetFriendlyStatus(). Unless it's actually based on something else and only resorts to the return value as a fallback. But that doesn't seem likely. I'll give it a shot though.

But I prefer this plugin over the target-nearest-enemy anyway, because I prefer targeting the nearest non-group ship more than 95% of the time. The only time I don't is when I'm in a skirmish, and I definitely spend less than 1/20 of my time in skirmishes.
Jul 25, 2012 Woodlander link
Installed targetbutton back in June and haven't looked back, the dogs bollox, thanks Pizzasgood. Only mod I made was to add string.find so it'd ignore the closest friendly bots/npc's and target the closest player instead, not perfect I know but still learning lua.

Thanks again.
Jan 17, 2014 Kierky link
I didn't see this before, this is incredibly useful in NW and botting with a group.