Dwarf Fortress > DF Modding

[DFHack] How to make C++ utility without using Git?

(1/3) > >>

SlimeOfSteel:
I want to create a C++ utility for DFHack, and I'm new to C++ in general. So I start looking up how to make C++ plugins when I come across this:


--- Quote ---DFHack doesn't have any kind of system of code snapshots in place, so you will have to get code from the GitHub repository using Git.
--- End quote ---

It seems kind of pointless to just use a few commands when I could install the files myself, so I was wondering, would downloading the source code zip yield the same results?

EDIT: Also, is using Visual Studio necessary? Could I use Eclipse instead?

EDIT 2: Okay, I lied. I have no idea what I'm doing. Can somebody explain to me how to build dfhack or whatever? It makes zero sense to me.

Hugo_The_Dwarf:
Visual Studio isn't necessary however it normally comes with the required C, C++ and C# compiler and libraries. Without a compiler you can't build anything.

You could use Eclipse if you can setup a C++ compiler for your builds

and you can go to the GitHub repo and just "download" the master branch as a zip yes. But using GIT (with or without a supporting GUI) makes getting the latest version much easier. Git is not a scary thing, if anything the commands you will be using is probably "pull" (it's a fetch from master + merge local combo) and I doubt you'd be adding so I doubt you'll be committing and pushing (or branching, committing, pushing, and merge request into master)

I've never made a plugin, and not that great with DFHack. I'm only talking to the high level stuff

 

SlimeOfSteel:

--- Quote from: Hugo_The_Dwarf on May 15, 2018, 12:19:11 pm ---Visual Studio isn't necessary however it normally comes with the required C, C++ and C# compiler and libraries. Without a compiler you can't build anything.

You could use Eclipse if you can setup a C++ compiler for your builds

and you can go to the GitHub repo and just "download" the master branch as a zip yes. But using GIT (with or without a supporting GUI) makes getting the latest version much easier. Git is not a scary thing, if anything the commands you will be using is probably "pull" (it's a fetch from master + merge local combo) and I doubt you'd be adding so I doubt you'll be committing and pushing (or branching, committing, pushing, and merge request into master)

I've never made a plugin, and not that great with DFHack. I'm only talking to the high level stuff

--- End quote ---

Thanks anyways, I've got one part of my problem solved. Now I just need to find out how to actually get everything else working.

lethosor:
Short version: you need git, and you should follow the instructions in Compile.html as closely as possible to avoid pain and suffering.


--- Quote from: Hugo_The_Dwarf on May 15, 2018, 12:19:11 pm ---Visual Studio isn't necessary however it normally comes with the required C, C++ and C# compiler and libraries. Without a compiler you can't build anything.

You could use Eclipse if you can setup a C++ compiler for your builds

--- End quote ---
Visual Studio is absolutely necessary. DFHack is loaded in the same memory space as DF, and must use the same runtime libraries, or it will crash. This means that it must be built with the same compiler as DF, which is Visual Studio 2015. Some people have had luck using the 2015 compiler in VS2017, but I'm not sure of the process there, so I would really recommend VS2015 to make things easy.

If you can get Eclipse working with the VS2015 compiler, then it might work, but otherwise it will not.


--- Quote ---and you can go to the GitHub repo and just "download" the master branch as a zip yes.

--- End quote ---
No, you cannot do that. DFHack contains several other repos as submodules, which will be downloaded if you use git (and follow the instructions in Compile.html), but the "download ZIP" option will not download any of them, so the build will fail at the configuration stage (in fact, we added checks at the configuration stage to prevent people from doing exactly this).

To be clear, we always appreciate contributions, but things go much more smoothly if you follow the build instructions - they were put together for a reason. We also really prefer that you use GitHub to submit pull requests for things to be added - sending in raw files quickly becomes a nightmare when we make changes after merging but you don't update your copy with those changes, etc.

In case you were unaware, there are two main branches of DFHack that you can get with Git - "master" (stable, most recent stable release) and "develop" (less stable, but with newer changes after the last release). I imagine that the master branch is fine for general plugin development, but if you want to work with 0.44.10, you'll need the develop branch for the time being. There are two corresponding versions of Compile.html - they're usually mostly the same, but it's good to look at the right one:
https://dfhack.readthedocs.io/en/stable/docs/Compile.html (master)
https://dfhack.readthedocs.io/en/latest/docs/Compile.html (develop)


--- Quote from: SlimeOfSteel on May 15, 2018, 09:38:41 am ---EDIT 2: Okay, I lied. I have no idea what I'm doing. Can somebody explain to me how to build dfhack or whatever? It makes zero sense to me.

--- End quote ---
If it's a matter of the instructions being unclear, I'd be happy to work with you to improve them, but I'd need a bit more specific feedback. How far have you gotten?

SlimeOfSteel:

--- Quote from: lethosor on May 16, 2018, 06:04:33 pm ---Short version: you need git, and you should follow the instructions in Compile.html as closely as possible to avoid pain and suffering.

Visual Studio is bsolutely necessary. DFHack is loaded in the same memory space as DF, and must use the same runtime libraries, or it will crash. This means that it must be built with the same compiler as DF, which is Visual Studio 2015.

DFHack contains several other repos as submodules, which will be downloaded if you use git (and follow the instructions in Compile.html), but the "download ZIP" option will not download any of them, so the build will fail at the configuration stage (in fact, we added checks at the configuration stage to prevent people from doing exactly this).

--- End quote ---

So I actually do need Visual Studio and Git. Thanks for telling me.


--- Quote from: lethosor on May 16, 2018, 06:04:33 pm ---If it's a matter of the instructions being unclear, I'd be happy to work with you to improve them, but I'd need a bit more specific feedback. How far have you gotten?

--- End quote ---

Right now I'm gathering info about what I need to do, and I'm also planning everything out so I can set up an effective workspace. I'll follow the instructions you've listed as best I can.

Speaking of the instructions, under the dependencies section, it states that Perl and Python are required (Python is said to be optional except for release builds). As stated previously, I plan to use C++ for my plugin. Why is Perl required?

Navigation

[0] Message Index

[#] Next page

Go to full version