• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->

Question - building plugins, where is 2020 info? (1 Viewer)

Joined
Jun 7, 2020
RedCents
648¢
Hello

The very simple question, where is the current (2020) info that details the process of building plugins please?


Scenario

To date, I have VV MQ2 installed and used it.
I've seen the macros, I've seen the plugins.
With macros, I have tinkered a bit and wrote some small basic things.
Now I'd like to tinker with plugins.
People here are doing it, and I'm wondering the how?


Background

Ok, so i saw the PeteSampras thread here titled 'Writing a bot plugin'. That interesting information, but it's a step ahead of the game.
It's authored in 2016 and makes reference to a Macroquest2.com page and assumes you have that set up, yet that is what I'm trying to do.

Somewhere (google?), i found reference to a document file, "MQ2PluginDevelopment.html".
This nicely talks about a couple of options. The first, "MQ2Template" as a basic starting block for plugins, that can copy / rename etc. The second, is the use of "mkplugin" that will automate the first option.

This has then progressed forward, in finding the MQ2 media, "MQ2-20200617(Test).zip", from the macroquest2 website. This has lots of source in it, and that "mkplugin".

One painless command line later: mkplugin MQ2BigDorfPlugin
It delivered a directory named just that, with source and Visual Studio project files etc.

Fire up the VS 2013 i have on this machine, and load the project. Go for a compile, t fails. A number of errors, standing out is data types not defined; PSPAWNINFO.
I think i saw something about requiring VS 2015 or later somewhere.

Taking the plunge, many GB of installs later, VS community 2019 is installed and try again. No, same problem.

It feels like things are missing, and this doesnt work "out of the box".


Battle

Following the breadcrumbs.
The project has one header file, MQ2Plugin, and that references "MQ2Main" and "MQ2Globals".
At the top of the MQ2Main, there is mention of definition for Live, Test and others, default to Live.
This will then lead to if it sources, "eqgame.h" or "eqgame(Test).h".

Looking on the disk, there is no "eqgame.h".
Default config live, yet don't ship files for it.
/salute the genius who came up with that plan.

Back to my plugin source, and before the includes, put in my own pre-process directive to #define TEST.

Well now it "compiles", but it won't "link" to complete the build.

It's looking for "MQ2Main.lib", which isn't there.


No interest in building MQ2, I just wish to build plugins!


I've tried battling with building the MQ2Main, but it's painful and not delivering.



and now

I just desire to get the basic framework there, so can start tinkering with writing my own code.

This has been several hours down a rabbit hole for something that should be so straight forward.

Figure I could keep going, and battle with futility, perhaps reinvent the wheel.
Then also figured, we have people in the RG VV community doing this stuff, so hopefully someone can point me (and others!) in the right direction. Stop using the random fruits of google.


As I asked at the start, where are the current details for the process of building plugins please?


Thanks and Regards.
 
Joined
May 21, 2019
RedCents
716¢
As far as I understand, you cannot build a plugin without building MQ2.

There is an option that you can purchase build access on Macroquest2.com and supply just the plugin.cpp that you're working on (i think it's $10/mo). Probably start with reading: https://www.macroquest2.com/Builders Users Guide.pdf - anyhow. I'm about to start this quest of my own. I'm curious to see how this plays out for you.

-hytiek
 
Joined
May 21, 2019
RedCents
716¢
Out of curiosity I decided to take the plunge, I appreciate you kick-starting my interest!

First build:
1593459716086.png

So a bit of directory listing, and I find MQ2Auth.exe... I run it:

1593459759996.png

Clicked Save:

1593459781157.png

Then I cleaned the solution, rebuilt, and ended up here:

1593460072782.png

I'm assuming that the errors are crystal clear and I just need to figure them out.

I found it interesting to see EQIM ... I thought that was long ago removed

1593460174991.png

I'll update once I figure out my errors, so far, seems straight forward.

One thing to mention, when I loaded the solution file, I did have to update the Platform Toolset to v142. Without doing that, she no workie.

EDIT:

I have no want/need for MQ2Telnet, so I cheated. I disabled it from the build (total cheat right), and was able to compile mq2test:

1593460550553.png

Going to make that plugin now!

-hytiek
 
Last edited:
Joined
Jun 7, 2020
RedCents
648¢
@hytiek thanks for your replies

I had stepped away from the keyboard as was getting frustrated at it all.

One thing that crossed my mind, I don't know why it was looking for MQ2Main.lib.
It doesn't appear logical to statically link in a bulk of code, that should be dynamically picked up from the shared object library at runtime.
Otherwise, everyone's plugins are going to bloat!


In another project I'd been involved with a couple years ago, the DLLs were added as some kind of reference in Visual Studio.
I've found similar window here, but it doesn't give any option to add DLLs at all.


With regards macroquest "builder" service, I've no interest in that at all.
Similar, I've no interest in changing or poking around the inner workings of MQ2. I just look to use it, from plugin view point, as would use it from a macro view point.
 
Joined
Oct 5, 2012
RedCents
151¢
Good read, keep it up man.
I've been curious about a lot of MQ2 things over the years. Compiling my own MQ2 build, trying to get MQ2Nav (and the mesh builder) to work with older clients, and things like that. I never knew were to even start so I more or less gave up. It's refreshing to see someone pursue and make strides towards a goal like this.
 
Joined
May 21, 2019
RedCents
716¢
Chat is that not done by mkplugin? When I check the External Dependencies; I see MQ2Main among a whole lot of other things.

I did get to here:

1593461886077.png

Found dependencies for the new project:

1593462046700.png

Linked it, cleaned, busy rebuilding...

and voila!

1593462136779.png

My new plugin built.

Damn that was fun!
 

ChatWithThisName

⚔️🛡️🗡️
Moderator
Joined
Dec 29, 2017
RedCents
2,290¢
Setting up the external dependencies means only to tell it that it needs MQ2Main.lib, and where it should look to find it. Right clicking the project, dependencies, and setting MQ2Main as a dependency will alter the order that the plugins build. With the change I suggested it will build main first instead of at the same time as the new plugin. Because it completely builds first, MQ2Main.lib should be available where it's expected, and the new plugin will find the .lib
 

ChatWithThisName

⚔️🛡️🗡️
Moderator
Joined
Dec 29, 2017
RedCents
2,290¢
1593462228520.png

1593462259538.png

Setting the requirement above, will force it to build MQ2Main by itself (assuming all plugins require MQ2Main) before it tries to build anything else.
1593462281543.png

If you're using a library that doesn't use anything at all from MQ2Main then you can forego setting them as having a requirement for MQ2Main.

In the case of my plugins I have CWTNCommons, which depends on MQ2Main, and then all of my plugins depend on the library CWTNCommons

This makes the build order (for these specific items)
MQ2Main.dll Full build by itself.
CWTNCommons.lib Full build by itself
Class Plugins all at once.

Setting a dependency is basically the same as.

Build just MQ2Main manually. Then once that is done, build your plugin. Except it automates it so that it can be done all at once. You should be able to build the entire solution, and it will fail the new plugin, then build again and it will build the new plugin if this is the case. Since MQ2Main will already be up to date, it won't need to be rebuilt. Also, since Main has been built, MQ2Main.lib will have been created and can now be found.
 
Last edited:
Joined
May 21, 2019
RedCents
716¢
Makes perfect sense man, thank you for the education lesson !! Truly appreciated! I ninja updated my reply as I was proceeding; found what you described after looking where it made sense.
 
Joined
Jun 7, 2020
RedCents
648¢
I've loaded the MQ2 "project" instead, and see a list of 15 sub-projects.

My plugin wasn't in that list so have added it.

Now I see some "build dependencies" stuff.

Will continue to hammer head on the wall....
 
Joined
Jun 7, 2020
RedCents
648¢
zip extracted.
used the mkplugin tool.
used the mq2auth tool
saved the file it made.

launched visual studio 2019
opened the mq2 project
added my plugin to it.

set the dependencies for my plugin, to mq2main

tried to build, mq2main.

Fails.
 
Joined
May 21, 2019
RedCents
716¢
Something to try:

Close VS2019
Go to MQ2 folder where you extracted the ZIP
Double click on the Macroquest.sln file

Then:

1593465787039.png

Follow that navigation and add your plugin from the Existing Item.

You want to build the solution, not just MQ2Main. (this is how I did it...)

(BTW don't forget to re-apply the MQ2Main dependency on your Plugin)
 
Joined
Jun 7, 2020
RedCents
648¢
are you sure thats the route you took?

"add" then "existing item" is inserting a file into the lineup, not the project for the plugin.


While asking that, is there nothing else you changed at all?
You didn't edit any files or any settings?
 
Joined
Jun 7, 2020
RedCents
648¢
I've added the plugin as did before, "add" then "existing project".

To address the MQMain failing to compile, I've edited the MQ2Main.h file.
This was to introduce the directive, #define TEST
 

Knightly

Moderator
Joined
Jun 28, 2014
RedCents
7,199¢
Alright, let's start over. First, the macroquest.zip is set to Live as Hytiek said, but that's also not the best place to get MQ2. You're going to want to start with git. If you want the official repo it's here: https://github.com/macroquest/macroquest2 . If nothing else, that already has TEST set as the define for you.

However, you're quickly going to go "Well, I'm trying to test my plugin and I'm missing all the nice plugins that RG provides, this is terrible. Especially MQ2Nav because WHY DO I HAVE TO WALK PLACES!?"

So then you're going to decide you want that and all of its open source goodness. Now you could add that as as a submodule to your project, or you could just pull the repo where all of that has been done for you: https://gitlab.com/redguides/VeryVanilla

So, how do you get started with this magical repo? We're gonna learn you some git: https://git-scm.com/downloads . Go get that if you don't already have it. Do the install, add it to your path. Now, you can also follow the forking workflow here if you want your very own fork to do whatever you want: https://www.redguides.com/community/threads/git-very-vanilla-forking-x-workflow.70582/ but for most people playing around that's overkill.

These are the commands to get you up and running with VeryVanilla:
# Use git to clone that URL into a folder called VeryVanilla. That last VeryVanilla is optional, it could be VeryChocolate and that would just change the directory name or you could completely leave it off and it would name it after the repo (which happens to be VeryVanilla)
git clone https://gitlab.com/redguides/VeryVanilla.git VeryVanilla
# Now let's go into that directory
cd VeryVanilla
# and we're going to initialize our submodules
git submodule init
# and we're going to update our submodules
git submodule update
# and then we're going to generate our auth and save it
mq2auth
# and then we're going to make a plugin with the RG version of mkplugin:
rgmkplugin.exe MQ2MyAwesomePlugin
# and finally we're going to start our solution and add our plugin
start VanillaDIY.sln

Switch the top part from "Debug" to "Release" if you want to build it all, there are a couple plugins that need to be updated for working in Debug.

Now, when you add in your plugin, you're going to want to add existing project. That's different from the screenshot above where it shows adding an existing item. You're going to want to add existing project and select the vcxproj of the plugin you just created. It's going to be in the subfolder MQ2MyAwesomePlugin (if that's what you called it). Immediately after that, you're probably going to want to update that plugin by right clicking and going to properties. I haven't gotten around to updating the template, so I'm pretty sure it still adds for VS 2017. Right click on it, go to properties, switch it to Visual Studio 2019 and 10-latest.

You probably want to set a dependency on MQ2Main, but that only matters if you clean your solution (once you've built MQ2Main once, it stays built). But it's a good thing to do. So, under the properties screen that shows up in your bottom right hand corner (note, different from the properties in the right click menu) click those dots by "Project Dependencies" and set one for MQ2Main.

These actions are going to modify the solution file (VanillaDIY.sln) and you're going to run into a headache when you go to update if that file changes. So now is a good time to learn about branching and how to properly rebase. But I'm not going to teach you that. When you want to update right now you're going to do this:
# Stash your changes
git stash
# Pull the new changes
git pull
# Unstash your changes
git stash pop

You'll get an error if you changed something at the same time the repo did and that'll be all kinds of crazy to try to figure out, but it's doubtful that's gonna happen frequently. If it does, it's time to learn about branching and rebasing.
 
Last edited:
Joined
Jun 7, 2020
RedCents
648¢
@Knightly now then, those are the instructions we have been looking for!

I was able to use git, and grab the codes and see things in VS 2019.
you're right with regards the retarget stuff, progressing 2017 to current. (think version numbers seen are v141 -> v142?).

The dependency was placed, onto"MQ2MyAwesomePlugin" for "MQ2Main", as you mention and we'd done before. This built.

Nice, clear instructions.
Way less painful than the battle of yesterday, there was not pains.

It almost goes without saying, they should be kept, stickied, or whatever and made clearly available / findable.
 
Joined
Jun 7, 2020
RedCents
648¢
Right click, "MQ2MyAwesomePlugin", in the solution explorer panel.
then left click the "build" at the very top of the huge list of menu options.

It goes away, and does just that.

vv-source-build01.png


2 build succeeded, 0 failed. 😜
 

Knightly

Moderator
Joined
Jun 28, 2014
RedCents
7,199¢
The failures are likely the submodules that need to be updated. If you look at MQ2SQL and MQ2Collections you'll likely see that they need to be retargeted to 142 as well in order for them to build.

The warnings are legitimate warnings, generally about how MQ2 blows the stack.
 
Joined
Jun 7, 2020
RedCents
648¢
Looking at the errors:

vv-source-build04.png


Parsing them out in notepad to make readable....

Error NuGet Package restore failed for project Submodules\MQ2Nav\MQ2Nav_Projects\MQ2Nav_MeshGenerator:
Unable to find version '1.72.0' of package 'boost'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'boost.1.72.0' is not found
on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error NuGet Package restore failed for project Submodules\MQ2Nav\MQ2Nav_Projects\MQ2Nav:
Unable to find version '1.72.0' of package 'boost'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'boost.1.72.0' is not found
on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error NuGet Package restore failed for project Submodules\MQ2Py\MQ2Py:
Unable to find version '1.63.0' of package 'boost'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'boost.1.63.0' is not found
on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error NuGet Package restore failed for project Submodules\MQ2Py\MQ2Py:
Unable to find version '2.7.13' of package 'python2x86'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'python2x86.2.7.13'
is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error NuGet Package restore failed for project Submodules\MQ2Nav\MQ2Nav_Projects\MQ2Nav_Common:
Unable to find version '1.72.0' of package 'boost'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'boost.1.72.0'
is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error NuGet Package restore failed for project Submodules\MQ2Py\MQ2Py:
Unable to find version '1.63.0' of package 'boost_python-vc140'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'boost_python-vc140.1.63.0'
is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error NuGet Package restore failed for project Submodules\MQ2Nav\MQ2Nav_Projects\MQ2Nav_ConsoleTool:
Unable to find version '1.72.0' of package 'boost'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'boost.1.72.0'
is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.


Error This project references NuGet package(s) that are missing on this computer.
Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.
The missing file is C:\development\VeryVanilla\packages\boost.1.72.0.0\build\boost.targets.
MQ2Nav_Common C:\development\VeryVanilla\MQ2Nav\common\MQ2Nav_Common.vcxproj 209


Error This project references NuGet package(s) that are missing on this computer.
Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.
The missing file is C:\development\VeryVanilla\packages\boost.1.72.0.0\build\boost.targets.
MQ2Nav (Submodules\MQ2Nav\MQ2Nav_Projects\MQ2Nav) C:\development\VeryVanilla\MQ2Nav\plugin\MQ2Nav.vcxproj 185


Error C2338 Windows headers require the default packing option. Changing this can lead to memory corruption.
This diagnostic can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined.
MQ2ShellCmd (Submodules\MQ2ShellCmd\MQ2ShellCmd) C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h 2482





Boiling that load of blah blah down.....

Unable to find version '1.72.0' of package 'boost'. Package 'boost.1.72.0' is not found

Unable to find version '1.63.0' of package 'boost'. Package 'boost.1.63.0' is not found

Unable to find version '2.7.13' of package 'python2x86'. Package 'python2x86.2.7.13' is not found

Unable to find version '1.63.0' of package 'boost_python-vc140'. Package 'boost_python-vc140.1.63.0' is not found


Error This project references NuGet package(s) that are missing on this computer.
The missing file is C:\development\VeryVanilla\packages\boost.1.72.0.0\build\boost.targets.
MQ2Nav_Common C:\development\VeryVanilla\MQ2Nav\common\MQ2Nav_Common.vcxproj 209


Error This project references NuGet package(s) that are missing on this computer.
The missing file is C:\development\VeryVanilla\packages\boost.1.72.0.0\build\boost.targets.
MQ2Nav (Submodules\MQ2Nav\MQ2Nav_Projects\MQ2Nav) C:\development\VeryVanilla\MQ2Nav\plugin\MQ2Nav.vcxproj 185


Error C2338 Windows headers require the default packing option. Changing this can lead to memory corruption.
This diagnostic can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined.
MQ2ShellCmd (Submodules\MQ2ShellCmd\MQ2ShellCmd) C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h 2482
 
Last edited:
Joined
Jun 7, 2020
RedCents
648¢
It appears NuGet is in pain.

It has configuration for local only media, it doesn't know about the webs.

I've added a source for it:-

vs-nuget.png


... and now it seems to be doing stuff for the missing packages.

vs-nuget02.png

It's taking time though, hopefully it goes through okay.
 
Joined
Jun 7, 2020
RedCents
648¢
nuget stuff has been automagically downloaded and placed into veryvanilla packages directory

vs-nuget03.png
Now a rebuild of the solution

vv-source-build05.png


113 succeeded, and 1 failure.....

vv-source-build06.png
 
Joined
Jun 7, 2020
RedCents
648¢
Not sure it's the right way forward, but as per the prompt - to define WINDOWS_IGNORE_PACKING_MISMATCH

Right click MQ2ShellCmd, and go for properties. Then drill down to the C/C++ preprocessor and edit to add the statement.



vv-source-mq2shellcmd-preprocdefs.png


Rebuild that one package.

vv-source-build07.png
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top