Because eclipse seems easier to mod with the vanilla pixel dungeon (you don't need to worry about the hassle of gradle integration), I'm going to compile a list of ways to do this. Yes, I know this is already a forum topic, but I want to make it easier for people to find the guides, without having to search through other posts.
Eclipse Versions[]
I would recommend using the pre integrated android eclipse version, but you can always feel free to use the standard eclipse version and install adt plugin manually.
Requirements[]
Make sure you set the app target version to android version 4.4+ when trying to do this, or else you will get this error, and you won't be able to compile your project. (This doesn't mean you are setting the minimum android version for the app to run on.)
Setting the target version can be done by right clicking properties on your project folder → Android. Once you see the list of versions to target, select a version that is android 4.4 or higher.
SirPenta's Guide[]
Posted in: Thread:21209
SirPenta wrote: 1. Download this and this
2. Download, install, and open Eclipse ADT, select File > Import > Existing Android Project
3. Select the extracted PD Source Root Folder
4. Extract the PD-Classes zip folder, and drag the com folder onto the source folder in Eclipse
5. To Compile and run the game, you will need an android device or a virtual device
5. Guide to installing an Android device and using it in Eclipse here.
Now you're ready to mod!
Mdsimmo's Guide[]
Posted in: Thread:21209
Mdsimmo wrote: I just found a much better way to import the source which keeps the PD-Classes seperate from the main pixeldungeon:
- As before, open git bash and run:
- cd path/to/where/you/want/pd
- git clone https://github.com/watabou/pixel-dungeon
- git clone https://github.com/watabou/PD-classes
- Open eclipse ADT
- Select file→new→other
- Secect Andriod project from existing source
- Select browse and select the "pixel-dungeon" folder
- Eclipse will complain about a huge amount of errors, that's okay
- Right click the project, select properties
- Go to Java build path → source
- Click link source and select the PD-classes folder
- Click next and then finish
- Everything should work now :)
However, this won't let you commit changes to PD-classes from within eclipse; you'll have to do that from git (or you could create a new android library project...)
Roastedlasagna's Guide on Reddit[]
Posted in: https://www.reddit.com/r/PixelDungeon/comments/2jo1fm/modding_noob/#cldlhny
Building the Mod[]
The easiest way to go about building your modded pixel dungeon would be to right click your project folder, export as an android app, and then follow the instructions that you are given. (this app will become signed)
You can then download an android app player (bluestacks, andy, leapdriod, etc.) and test the app.
An alternative to that however, would be creating a virtual device on the AVD (the android in the phone) and pressing the run button in eclipse (run it as an android app). After you run it, the APK for your mod will be found in the bin folder of your project (the folder underneath the assets folder and above the res folder).
An error that I Got While Building
If you happen to get an error about a dex file not being created, then here is something you can consider doing.
To solve the problem, follow these steps.
Mac
Go to Eclipse (next to the apple logo) → Preferences → Android → Build
Then, uncheck the box next to the line: Skip packaging and dexing until export
You may also need to uncheck the line: Force error when external jars contain native libraries.
After that, try building the app again.
Windows
Go to: Window → Preferences → Android → Build
Then, uncheck the box next to the line: Skip packaging and dexing until export
You may also need to uncheck the line: Force error when external jars contain native libraries.
After that, try building the app again.
Still Need Help?[]
If you still need help with modding pixel dungeon in Eclipse, be sure to post a help request here: Board:Modding_–_General_Discussions
Or try posting a comment on this article.
Extensions[]
Now that you've successfully built pixel dungeon, here are some tutorials to help you out: