Edit D2R preset environments in Unity. A purchased copy of D2R is required to access the data files.
(Recommended: intro video about Unity's layout, panels and terminology https://youtu.be/pwZpJzpE2lQ?t=71)
- Create a new 3D project in Unity (this example project is named "D2R-docktown")
- Download this repository, unzip and place its contents into your unity project Assets folder (e.g.
...Unity Projects/D2R-docktown/Assets/Scripts , Resources, libs, ...
) - Open the project in Unity and select the
Main Camera
object in the Hierarchy. Then in theInspector
window on the right hand side add a component scriptScripts/SaveJson.cs
. (This is done only once per project) - Save your Unity Scene with
ctrl+s
. Set your D2R data paths inSaveJson.cs
and save the script see below - Click the blue "Play" button above the
Scene
window to load a json preset in the project folder (e.g.docktown3.json
). Click "Pause" and move/rotate/scale objects in the Scene - To add objects to the Scene click "Pause" to unpause and then click the "Add" button on the left of the Scene and specify the path of the model to add. Once objects have been added click "Pause" to go back to Scene editing
- When finished editing click "Pause" once again to unpause and then click "Save" on the left of the Scene to save your changes to the preset json file
- Place your edited preset json into your D2R/Data/hd/env/preset location and launch D2R with
-direct -txt
A video showing act1 edits: https://streamable.com/xbxe7i
If you see errors like
Assets\Scripts\SaveJson.cs(9,7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\SaveJson.cs(10,7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Then the Newtonsoft
package needs to be installed in Unity. Install through Unity's Package Manager: in Unity’s top menu: Window > Package Manager > Search for package Newtonsoft
. https://docs.unity3d.com/Packages/[email protected]/manual/index.html
Thanks to MilesTeg
from d2mods.info for pointing this out.
Lines 16 and 17 in SaveJson.cs
should be configured for your preset path and D2R data path
public string preset = "docktown3.json"; // Change this to be the json preset that is edited
public static string d2rDataPath = "D:/D2R/"; // Change this to where your D2R data is extracted (casc storage)
Freely available here https://store.unity.com/download-nuo
- D2RStudio by Shalzuth http://web.archive.org/web/20210508115732/github.com/shalzuth/d2rstudio which this project is based on
- LSLib by Norbyte https://github.com/Norbyte/lslib
- Noesis model viewer and converter https://richwhitehouse.com/index.php?content=inc_projects.php
- D2R_reader plugin for Noesis https://forum.xentax.com/viewtopic.php?f=16&t=22277&start=165#p173650
- D2R texture format https://github.com/CucFlavius/Zee-010-Templates/blob/main/DiabloIIResurrected_Texture.bt
Diablo II and Diablo II: Resurrected are copyrighted by Blizzard Entertainment, Inc. All rights reserved. Diablo II, Diablo II: Resurrected and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.
All trademarks referenced here are the properties of their respective owners.
This project and its maintainers are not associated with or endorsed by Blizzard Entertainment, Inc.