Modding - Getting started/outdated

This guide will help you get started with the ND modding tool. This tool is also used by the developers to create content although their version is more advanced. The data you will be modding is stored in JSON files. These are text files that are read by the game to produce everything you see in the game. This tool allows you to change these JSON files in a user-friendly way. You can change the game's data or make your own items and weapons and then distribute your mod to other players for them to play!

## Set up the modding tool

In short you will:

1. Download and install unity hub. Alternatively you could download a stand-alone unity version 2020.1.13f1 here
2. Download and install unity 2020.1.13f1 in unity hub
3. Go to the nearly dead itch.io page and download the Nearly\_dead\_modding\_tool
4. Create a new project in Unity
5. Copy the resources folder from the nearly\_dead\_data folder to the created poject\assets folder
6. Import the downloaded nearly\_dead\_modding\_tool.unitypackage trough add > import package > custom package
7. Click window > nearly dead > JSON editor

- Download Unity hub. Alternatively you could download a stand-alone unity version 2020.1.13f1 here

- Find the downloaded file

Open the file and follow the installation guide to install unity hub

Unity hub is now installed. Open unity hub

Create a unity ID here. You need this to activate your personal license later.

Go to settings, the button is in the top-right corner

Go to license management and click on login to sign in with your unity id

After you have logged in, click on 'activate new license'

Click on 'Unity Personal'

Click on 'I don't use Unity in a professional capacity.'

Click on 'Done'.

Exit preferences by clicking the arrow in the top-left

Go to installs in unity hub (4th menu item on the left)

Click on 'add' in the top-right

Click on 'download archive' to open the unity web page where the archive can be downloaded

Click the Unity 2020.x tab:

Scroll down to find unity 2020.1.13. Click on the green 'unity hub' button

You may see this popup. Click choose application:

Click 'open link'

This will Install unity 2020.1.13f1. A blue progress bar at the top of the tile will indicate the download and installation progress (not visible in the image below)

In unity Hub, Go to projects and click new and select the 2020.1.13.f1 version:

In the new project dialog, select 2d, enter a name for your project, select a folder and click create:

It takes a while for your project to be created:

Copy the 'Resources' folder from 'nearly\_dead\_data' folder in the nearly dead game folder to your newly created project folder/assets

In unity, wait for the resources to be imported

Now that you have a new project, download the Nearly\_Dead\_Modding\_Tool\_x.unitypackage if you haven't already from the nearly dead itch.io page

Click 'no thanks take me to the downloads' (you can donate $ if you want):

Click download next to the Neadly\_Dead\_Modding\_tool:

This dialog menu may popup (varies depending on your browser). Click 'safe file' and 'OK':

Go back to unity and import the Neadly\_dead\_modding\_tool unitypackage you downloaded earlier.

Select the Neadly\_Dead\_Modding\_Tool\_x.Unitypackage file and click 'Open'

Click import

Wait for it to be imported

Click Window > Nearly Dead > JSON\_Editor

A progress bar may appear. After it is finished, the JSON editor appears. Drag it to the tab bar in unity

Click Layout (in the top-right) and select 'Save Layout...'

Click Save

Click file > Save to save your project and settings.

Now you can start modding! The the next time you want to start the modding tool, you can open the project from unity hub:

When a new version of the game and/or the modding tool comes out, Update the modding tool.

## Modding tool overview

This is a basic overview of the common controls in the modding tool:

1. The currently selected JSON file. If you click this, you can select a file from a list and use the keyboard to filter by name.
2. Saves your changes to this file to disk
3. Useful to remove focus from other elements
4. The currently selected element in this JSON file. Click it to select an element from a list. You can use the keyboard to filter by name.
5. The previous and next buttons allow you to cycle trough the elements in the JSON file
6. Duplicates the selected element to a copy
7. Removes the currently selected element from the JSON file
8. Allows you to add a JSON element of the selected type
9. The unique ID of the element
10. The name of the element as it appears in-game
11. To the left is the assets tree. The files you are currenty working on are in the Resources folder. To the right is a list of files in the currently selected folder.To use the modding tool, please see the guides on the nearly dead reddit.

## Your first mod

This guide describes how to create a mod. You will copy a cookie item and recipe and call it a hyper cookie with adjusted properties.

First we will make a folder for our mod. Right click the **resources** folder, click Create > Folder

Give your folder a name, like hypercookiemod. It is recommended to use lowercase letters everywhere.

Search for food in the assets search box. If you scroll down you will see two JSON files called item\_food and recipe\_food. Copy them to your mod folder. You can use ctrl+copy and ctrl+paste, or just drag them over while holding ctrl.

Now you have two files in your mod folder. Unity might rename the file from the original.

We will now rename (right-click > rename) the files to suit your needs. item\_food will be renamed to hypercookie\_item and recipe\_food will be renamed to hypercookie\_recipe

Now we need to get the modding tool to load the files you made. To do this, press the play button on the top of the tool:

This will load the files you made. Press the play button again

If the game tab is now selected, switch back to the JSON\_Editor tab. You can click the tab or press window > Nearly dead > JSON\_Editor

Now click the currently selected file (the green button that says action (core)) and type 'hyper' into the filter box. Remember, this is case sensitive! Select the hypercookie\_item (core) file.

Now the hypercookie\_item file is selected. Because we copied the item\_food file earlier, a lot of other items are still in the file. We are going to remove those. The currently selected JSON element is corn. We only need cookie, so remove the other items from the file by pressing 'remove this element'. Don't accidentally remove cookie! If you see cookie appear, press next and remove the rest of the JSON elements from the list. If you accidentally remove the cookie, **don't** save the json file and press the play button and press the play button again to reload the data (as described above when you created the files).

When you are done, only the cookie will remain in the list:

Now we need a sprite for the hypercookie. You can make your own sprite, but for the sake of this guide we will copy and modify the current cookie sprite. Search for cookie in the search bar and copy the cookie sprite to the hypercookiemod folder

Rename the item\_cookie\_icon to hypercookie\_icon.

We need to open the icon in a graphics program to modify it. If you have your own sprite, you can just drop it in the mod folder and use that. To modify the cookie sprite, right click it and select 'open in explorer'

Now you can open the file with your favorite graphics program. For this guide, we will use paint.net since you need a program that can handle transparancy

You can change or create any sprite you want. There are many guides on how to do this. For this guide, I just changed the hue for the cookie sprite:

Make sure you keep transparancy when you save it! Now drag the hypercookie\_icon to the current icon of the item

Now let's change the iD, name and description:

Now you can start changing properties. Scroll down to 'food' and change 'fun' to 25

Scroll down to "set consume effect" and click on it to expand it. You will see a list of the current effects. We will add a new effect to the list. Open the drop-down list next to 'Consume Effect Type' and select mod\_condition. Click on add consume effect

A new item is added to the list. Click the empty box under 'Changing Condition ID'. A menu will drop-down. Select health from the list

Set the amount to 5

You are free to change any property you want. When you are done, press save this JSON file

Now we will change the recipe. From the file selection menu (you have to press the green button where it now says 'hypercookie\_item (core)'), select hypercookie\_recipe (core)

The file is now selected. We will do the same as before, delete all the JSON elements from the file until only cookie (recipe\_data) remains. If you accidentally remove the cookie recipe, don't save the json file and press the play button and press the play button again to reload the data (as described above when you created the files).

Now only the cookie recipe remains in the list.

Let's change the name and ID of the recipe as well as the description. You may need to click on 'Set common data' to expand it.

Click on 'Set recipe result' to expand it. Click on 'cookie' to open the selection list

Type 'hyper' into the filter box and select the hypercookie

You can set the required tool quality and skill difficulty if you want. You can change the recipe component too but we will just leave it as it is for now.

Click 'Save this json file' to save your changes

Well done! You made your mod. Now you need to test it.

## Testing your mod

This section will explain how to test your mod in-game.

You made a mod folder inside the unity project's assets folder, so let's find that folder in explorer. Right click the mod folder in Unity and select 'show in explorer'

Now open the directory where you have Nearly Dead located. Next, copy your mod folder into the **NearlyDead\nearly\_dead\_data\resources folder**

Start the game. Make sure your character has some skills to make the cookie

In the item pointshop select the duffel bag or any other backpack

Let's test the recipe and then we can test the hypercookie. You can look for the ingredients, but for testing purposes it's easier to wish for the items. Press ` it is located below the ESC key on the top left of most keyboards. Find the ingredients for the recipe and spawn them. We need:

Spawn as much of every ingredient as you need, about 10 will do. You can use the arrow keys next to the 'Get' button to change the amount. You only need 1 debug tool. To spawn them, click on Get.

Now open the crafting menu and browse to cooking > bakery. Click the recipe and press craft.

This window will pop up. Click the up arrow to add flour and press craft. Now you have your hypercookie!

Next, consume the hypercookie. To test if you recover health (since we put the mod\_condition effect for health on it) you need to take some damage first. Then consume the hypercookie. Right click the cookie in your inventory and press Eat

It works! The test is complete. If something went wrong, you need to make your adjustments and then copy your mod over to the **NearlyDead\nearly\_dead\_data\resources** folder again.