With these unity scripts editing D2R preset environments is possible: https://github.com/pairofdocs/Unity-D2R-Scene-Editor
Requirements:
- Unity freely available here https://store.unity.com/download-nuo
- D2R casc storage data extracted (e.g. D2R/Data/hd/env for models, textures and preset jsons)
- Create a new 3D project in Unity (this example project is named "D2R-docktown")
- Download the Unity-D2R-Scene-Editor 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 Scene. Then in the Inspector window on the right hand side add a component script Scripts/SaveJson.cs. (This is done only once per project)
- Save your Unity Scene with ctrl+s. Set your D2R data paths in SaveJson.cs and save the script (see Config section 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
Lines 16 and 17 in Scripts/SaveJson.cs should be configured for your preset path and D2R data path
Code: Select all
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)
Video Clip: https://streamable.com/xbxe7i
Screenshots:
Unity scene - act1 town south
In-game act1 town south (*preset model saving has been fixed. Models behind the chest stash and the campfire will be saved correctly in the current version of the editor and will appear in-game)
Happy Moddin'