Staredit Network > Forums > SC1 Mapping Tools > Topic: Chkdraft Plugins
Chkdraft Plugins
Jun 5 2014, 10:53 pm
By: jjf28  

Jun 5 2014, 10:53 pm jjf28 Post #1

Cartography Artisan

So you're looking to make a plugin... first thing's first, you need to decide whether it should be a part of Chkdraft, a standalone program with some of Chkdraft's code to get you started, or a a plugin, each holds advantages and disadvantages.

A Part of Chkdraft: If whatever you're creating has very little abstraction from blizzards map format and is justifiably useful to everyone that might use Chkdraft, pitch it to me, gather a bit of what others think about it, if it seems to fit or has a lot of demand we can work together to get it integrated, the source is included with every official release of Chkdraft so you can look at doing the code yourself if I approve and don't show high enough interest to do it straight away (please track your changes if this is the case).

Advantages: Can use all of Chkdraft's code, no hassle for users, easier distribution of your feature
Disadvantages: Need to get my approval, your code may be altered from time to time

A Standalone Program: If you want to read a map or make some one-time changes a standalone program's the right way to go.

What's provided: Code for opening and saving, almost all code used by Chkdraft to read and make changes to the map
Advantages: Easier and quicker to code than plugins (starts the same way)
Disadvantages: Map may be saved over by this or another program, you're in charge of distribution

A Plugin: If you're making something that would be most useful modifying open maps, this is the right path, it's a little more difficult to get started then a standalone program.

What's provided: Everything you have with standalone programs plus... messages for saving the map, importing and exporting scenario files from/to Chkdraft, and sending new triggers in text or raw TRIG section form
Advantages: Can work near-seamlessly with open maps, instant synchronization
Disadvantages: More difficult to code than standalone programs, you're in charge of distribution





Getting Started:
For starting either a standalone program or plugin, if you do not plan to import/export whole scenarios in a plugin, skip to 9-12

1. Obtain a compiler, ideally Visual Studios 2012
2. Create a new project for your plugin/program
3. Download the latest copy of Chkdraft
4. Browse to //Chkdraft/src/Chkdraft/Source Files/ and copy the entire Mapping Core folder to your projects code folder
5. Include SFmpq_MT.lib for your release configuration and SFmpq_MTd.lib for your debug configuration
    - In VS2012 go to project->properties, select your configuration in the top left box, select linker->input and in addition dependencies put "Mapping Core/SFmpq_MT.lib;" and "Mapping Core/SFmpq_MTd.lib;" for release and debug configurations respectively.
6. In project->properties, under C/C++ All Options, change runtime library to /MT (for release configuration) and /MTd (for debug configuration)
7. Include all the .h and .cpp files from mapping core in your project, preferably under their own filters
8. Put #include "Mapping Core/MappingCore.h" at the top of your main and any other project files that need it

Plugin only steps:

9. Copy ChkdPlugins.h from Chkdraft to your project code folder, include it in your project and #include "ChkdPlugins.h" in any files necessary
10. If your project doesn't have a window, setup a message-only window for communicating with Chkdraft (see example programs if necessary)
11. Get a handle to Chkdraft ( HWND hChkdraft = FindWindow("MainChkdraftWin", NULL); )
12. Send messages as ChkdPlugins.h specifies to communicate with Chkdraft


Examples:

Plugins:
    http://www.staredit.net/files/2962/
    ATextTrigGenerator (link pending)

Standalone Programs:
    http://www.staredit.net/files/2901/
    TerrainScale (link pending)
    TrigAnalysis (link pending)
    TrigCount (link pending)

Post has been edited 5 time(s), last time on Jun 6 2014, 12:03 am by jjf28.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jun 6 2014, 8:51 pm Roy Post #2

An artist's depiction of an Extended Unit Death

Regarding option #1: wouldn't it be easier for you to just put the source up on, say, GitHub, and anyone that wants to add a feature can just make a pull request? Are you using source control for Chkdraft?




Jun 17 2014, 7:30 am Heinermann Post #3

SDE, BWAPI owner, hacker.

Yeah you should definitely put this up on github.

This would allow people to put up pull requests for changes that you can approve/reject. It also provides an issues tracker, as well as releases.

Just make sure you have both a stable and unstable branch. A common setup is to make master the release branch (master reflects the most recent release), and a development branch where you push your changes to.




Jun 17 2014, 11:31 pm leeonix Post #4



i suggest using premake4 to generate project file. not only vs2012.
premake4 is easy to use.



None.

Jun 18 2014, 8:27 am CecilSunkure Post #5



I use premake for all my stuff. Premake is great!



None.

Jul 6 2014, 10:58 pm jjf28 Post #6

Cartography Artisan

Project is now on GitHub: https://github.com/TheNitesWhoSay/Chkdraft/

Post has been edited 1 time(s), last time on Oct 25 2020, 4:47 am by jjf28.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jul 7 2014, 7:16 am Heinermann Post #7

SDE, BWAPI owner, hacker.

Is there supposed to be a solution(sln) file?




Jul 7 2014, 8:41 am jjf28 Post #8

Cartography Artisan

woops shaved a directory level - it's there now



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: Roy