From c26837fdd70f635142e124a4534279548444694e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 2 Jul 2023 18:10:09 +0300 Subject: [PATCH] Step-by-step instructions to create a new Civilization mod --- .../unciv/app/desktop/UiElementDocsWriter.kt | 2 +- docs/Modders/2-Making-a-new-Civilization.md | 61 ++++++++++++++++--- docs/Modders/4-Creating-a-custom-tileset.md | 2 +- docs/Modders/5-Creating-a-UI-skin.md | 2 +- 4 files changed, 54 insertions(+), 13 deletions(-) diff --git a/desktop/src/com/unciv/app/desktop/UiElementDocsWriter.kt b/desktop/src/com/unciv/app/desktop/UiElementDocsWriter.kt index fc3c0e7c82..8717b57aa8 100644 --- a/desktop/src/com/unciv/app/desktop/UiElementDocsWriter.kt +++ b/desktop/src/com/unciv/app/desktop/UiElementDocsWriter.kt @@ -4,7 +4,7 @@ import java.io.File class UiElementDocsWriter { companion object { - private const val docPath = "../../docs/Modders/Creating-a-UI-skin.md" + private const val docPath = "../../docs/Modders/5-Creating-a-UI-skin.md" private const val startMarker = "" private const val endMarker = "" private const val srcPath = "../../core/src/com/unciv/" diff --git a/docs/Modders/2-Making-a-new-Civilization.md b/docs/Modders/2-Making-a-new-Civilization.md index e61cb41a23..f11f781e47 100644 --- a/docs/Modders/2-Making-a-new-Civilization.md +++ b/docs/Modders/2-Making-a-new-Civilization.md @@ -1,8 +1,14 @@ # 'My first mod' - Making a new Civilization -So you want to add your favorite civilization? +By the end of this tutorial, you should have a working, generally-available mod that adds a new Civilization to the game -There are a few steps required, so we'll walk you through them! +## Create your repository + +- Create a [Github account](https://github.com/join), if you don't already have one +- Go to the [mod example](https://github.com/yairm210/Unciv-mod-example) +- Click the green `Use this template` button - `Create a new repository` +- Choose your repository name and click `Create repository from template` (keep setting on 'public'!) +- Your new repository is now available! ## Fill in your Nation info @@ -10,7 +16,7 @@ Each civ has some basic information - what the civ name is, the leader's name, c In addition, each civ has flavor text when declaring war, intoduction etc. -All of these need to be filled in in [Nations.json](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Nations.json) +All of these need to be filled in in `jsons/Nations.json` file - see [here](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Nations.json) for the base game file for more examples ## Get your Civ icon @@ -18,29 +24,54 @@ Each civ has an icon, like the wreath for Rome, for instant identification. All of these icons are white on a transparent background, and are 100x100 pixels - see [icon considerations](#icon-considerations) for details -You'll need to put your icon in the [NationIcons folder](https://github.com/yairm210/Unciv/tree/master/android/Images.NationIcons/NationIcons). +You'll need to put your icon in the `Images/NationIcons` folder - you can navigate there and click `Add file - Create a new file` (top-right corner) -Same as with the nation name and leader name, the unique ability should also be put in the Nations translation file for bonus points =) +## Test it out! + +- Open Unciv +- Click 'Mods' - 'Download mod from URL' +- Copy-paste your repository's URL to the textbox, and click 'Download' +- Exit the mod screen, and create a new game, selecting your mod - which will be under 'Extension mods' on the left Congrats, your Civ is now fully playable! -But apart from the flavor, they are boring gameplay-wise, so now we need to add unique abilities! +!!! note + + You currently won't see any images from this mod, since it has no texture atlas - see [here](1-Mods.md#more-on-images-and-the-texture-atlas) for more details + If you're on Desktop, you can restart Unciv to generate this atlas and see the images + +But this nation's abilities are exactly those of the base mod. To make it truly unique, we'll need to change some Uniques ;) ## Adding unique units -Units in general are added in the [Units.json](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Units.json) file, with an icon in the [UnitIcons](https://github.com/yairm210/Unciv/tree/master/android/Images.Construction/UnitIcons) folder. +Units are defined in the `jsons/Units.json` - for the base game file, see [here](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Units.json) file, with an icon in the [UnitIcons](https://github.com/yairm210/Unciv/tree/master/android/Images.Construction/UnitIcons) folder. -The icon must be 200x200 pixels, white on transparent background - see [icon considerations](#icon-considerations) for details +The icons must be 200x200 pixels, white on transparent background - see [icon considerations](#icon-considerations) for details - and go in the `Images/UnitIcons` folder Remember that these are unique units, so search for an existing unique unit to see how they replace their regular counterparts! ## Adding unique buildings -Same as the units - info is in the [Buildings.json](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Buildings.json) file and icons in the [BuildingIcons](https://github.com/yairm210/Unciv/tree/master/android/Images.Construction/BuildingIcons) folder, same rules for the icons apply (200x200 pixels, icon considerations) +Same as the units - info is in `jsons/Buildings.json` - for the base game file, see [Buildings.json](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Buildings.json) file and icons in the [BuildingIcons](https://github.com/yairm210/Unciv/tree/master/android/Images.Construction/BuildingIcons) folder, same rules for the icons apply (200x200 pixels, icon considerations) + +Icons go in `Images/BuildingIcons` ## Civ Unique -Check out our [list of uniques](Unique-parameters.md) to see all the cool special effects you can add to your civilization! +Check out our [list of uniques](uniques.md) to see all the cool special effects you can add to your civilization! + +## Make it searchable! + +To list your mod in the Unciv Mods screen: + +- Open your repository +- Click the gear icon, to the right of the 'About' label (right side, top) +- Under 'Topics', add 'unciv-mod' +- 'Save changes' + +Congrats, your mod will now be shown in the mods page! + +The more stars your repo has, the higher towards the top it will appear, so start gaining fans :D ## Icon considerations @@ -51,3 +82,13 @@ Icons directly from the base game belong to Firaxis, so I'm not sure we're legal One source I use constantly is [The Noun Project](https://thenounproject.com) - everything there is Creative Commons or open, so they can all be used! Credits for icons should go in a `Credits.md` page. + +## What's next? + +You have a working mod, now it's time to go wild! + +- Add the [atlas files](1-Mods.md#more-on-images-and-the-texture-atlas) to your repo so your users get images +- Install Git locally, so you can change your files on your device and have those changes reflected in your repository +- Expand the abilities of your civ by adding new [uniques](uniques.md) +- Add new civs, buildings or units +- Expand into other game objects by exploring the rest of the [mod file structure](Mod-file-structure/1-Overview.md) diff --git a/docs/Modders/4-Creating-a-custom-tileset.md b/docs/Modders/4-Creating-a-custom-tileset.md index 9cfa01c8d3..45dd1c72e1 100644 --- a/docs/Modders/4-Creating-a-custom-tileset.md +++ b/docs/Modders/4-Creating-a-custom-tileset.md @@ -1,4 +1,4 @@ -# Creating a custom2 tileset +# Creating a custom tileset **You should read the [Mods](1-Mods.md) page first before proceeding** diff --git a/docs/Modders/5-Creating-a-UI-skin.md b/docs/Modders/5-Creating-a-UI-skin.md index 821563ff7f..a08e1ef34b 100644 --- a/docs/Modders/5-Creating-a-UI-skin.md +++ b/docs/Modders/5-Creating-a-UI-skin.md @@ -201,4 +201,4 @@ The color this UI element should have. A float value. Default value: null -The alpha this UI element should have. Overwrites the alpha value of tint if specified. +The alpha this UI element should have. Overwrites the alpha value of tint if specified. \ No newline at end of file