MapLoc

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

MapLoc

Post by JudgeD » Sun Apr 10, 2016 3:11 pm

Had some vacation time and decided to work on a feature I've been wanting.

I do lots of random quests and use Alla a lot, and many times it's like "find such and such at loc -2148, 1860" and I have no idea where tf that is.

So I added new commands: /maploc and /clearloc (where [ ] items are optional)

/maploc
Usage: /maploc [[size 10-200] | [width 1-10] | [color r g b] | [yloc xloc]]
This adds a red X marker on your map at the y,x location.
Size = length of each line of the X from the middle point
Width = adds 1 extra line to each side of the cardinal line to make it appear thicker.
Color = pretty obvious.

Supplying only a location will create the marker using your ini's default settings.

Supplying Size / width / Color without supplying a location will update your map's ini file with new default values.

Supplying Size / width / Color with a location will give that location unique settings without updating your default ini settings.

So, if you have 3 X's using default settings, and 2 other X's with their own unique settings, then updating the default settings will only reflect changes to the 3 X's that were already using the defaults.


/clearloc
Usage: /clearloc [yloc xloc]

If used without supplying a location, it removes all current MapLocs.
If used with a location, it removes only that MapLoc.


For both of these commands, I made them pretty smart about the values passed in. You can supply multiple options in any order Also if you try to give a string to an int, it will reject it instead of setting the value to 0. I also updated /highlight to have the same enhanced detection and constraint checking.


Please let me know what you think. I had to learn some new C++ to do this, so if there's code improvements please teach me. I've used it for awhile now and find it pretty helpful for my daily grind. Makes it easy to copy / paste into the map from Alla guides. Also the files I'm including also include the /mapactivelayer command I added recently and mentioned in another thread.
Attachments
MQ2Map.cpp
(17.67 KiB) Downloaded 60 times
MQ2MapCommands.cpp
(23.61 KiB) Downloaded 49 times
MQ2MapAPI.cpp
(42.98 KiB) Downloaded 45 times
MQ2Map.h
(4.6 KiB) Downloaded 44 times
Last edited by JudgeD on Fri Sep 30, 2016 11:27 pm, edited 11 times in total.

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

Re: MapLoc

Post by JudgeD » Sun Apr 10, 2016 3:12 pm

removed source in favor of file attachments in original post.
Last edited by JudgeD on Sun Aug 14, 2016 1:59 am, edited 2 times in total.

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

Re: MapLoc

Post by JudgeD » Sun Apr 10, 2016 10:03 pm

/bump, I made some tweaks and read up on better ways to handle pointer deletion from maps, and so far no crashes. Please try it out and let me know what you think.

I didn't want to scare anyone away from trying this out :)

Wink-
a ghoul
a ghoul
Posts: 122
Joined: Tue Apr 27, 2004 2:41 pm

Re: MapLoc

Post by Wink- » Fri May 20, 2016 11:24 am

Thanks JudgeD. This is a great feature!

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

Re: MapLoc

Post by JudgeD » Sat Aug 13, 2016 11:12 pm

Wink- wrote:Thanks JudgeD. This is a great feature!
Thanks!

This has now been merged with EqMule's latest MQ2Map changes. The attachments on the original post are updated for easy download.

The plugin seems stable and I've been using it since the original post. The only outstanding issue is that the plugin fails to load on entering the game, but doing "/plugin mq2map" after entering the game works just fine. Any help appreciated on that bug, I'll attempt to figure it out though not promising anything :/.

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: MapLoc

Post by dewey2461 » Sun Aug 28, 2016 8:32 pm

Nice utility for doing quests where you are looking to find things by location.

Fixed pre-mature pointer referencing :oops:
Attachments
MQ2Map.cpp
(17.57 KiB) Downloaded 43 times
Last edited by dewey2461 on Sun Aug 28, 2016 9:47 pm, edited 1 time in total.

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

Re: MapLoc

Post by JudgeD » Sun Aug 28, 2016 8:46 pm

Awesome, now bug free thanks Dewey! Updated my attachment in the original post

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

Re: MapLoc

Post by JudgeD » Fri Sep 30, 2016 11:29 pm

Fixed a bug in current live map version where /high pulse, is set to the wrong default size upon plugin initialization. (was fixable by turning pulse off and back on) Should look a little cleaner now.

Any chance for these new features to be added to vanilla map? Attached files include:

1) Maploc / clearloc commands
2) mapactivelayer command (sets which layer map is active on)
3) /high command is more intelligent about valid arguments
4) pulse fix

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: MapLoc

Post by EqMule » Sat Oct 01, 2016 2:10 pm

Get with me on skype and send the files there, it's the fastest way to get me to include stuff.
Skypechat address is EQ.MULE
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.