Disco Elysium

Index : 

1 - How to create a bundle for importing objects. (Modders)
2 - Model and bundle naming and locations. (Modders)
3 - How to use console for spawning objects (Everyone)
4 - How to create a config.xml for auto-spawning objects on scene. (Everyone)
5 - How to create a config.xml for moving replaced objects local position. (Everyone)
6 - Credits for example models used into the mod.


1 - How to create a bundle for importing objects.
- You have to install latest Unity 3D software.
- Open or better start a new fresh projects.
- In the unity assets main folder create this sub-folders : AssetBundles, Prefabs, Editor, Temp
- Create a script named BuildAsset in Editor folder with this code : 

using UnityEngine;
using UnityEditor;
public class Example : MonoBehaviour
{
//Creates a new menu (Build Asset Bundles) and item (Normal) in the Editor
[MenuItem("Build Asset Bundles/Normal")]
static void BuildABsNone()
{
//Create a folder to put the Asset Bundle in.
// This puts the bundles in your custom folder (this case it's "AssetBundles") within the Assets folder.
//Build AssetBundles with no special options
BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
}
//Creates a new item (Strict Mode) in the new Build Asset Bundles menu
[MenuItem("Build Asset Bundles/Strict Mode ")]
static void BuildABsStrict()
{
//Build the AssetBundles in strict mode (build fails if any errors are detected)
BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.StrictMode, BuildTarget.StandaloneWindows64);
}
}

A new "Build Asset Bundles" menu should appear in unity.

2 - Model and bundle naming and locations.

- Import your model to Temp directory
- (optional) Extract Kim's Mesh (.obj) with AssetStudioGUI and import it into the Temp folder and then into the scene to have a reference on the proportion of the model you want to add/replace.
- In the Model tab, use scale factor to increase or decrease the model dimension and check Read/Write Enabled. Apply.
- If you are familiar with unity engine you know better than me what to do, however for those less practical the prefab must be created with the textures and any directives for the use of the animations already applied. 
  All material shaders are replaced with the game's default shader, otherwise they are not visible in game. I'm not an expert so I don't know if it's avoidable.
- Move the object to the scene, when ok , drag it into the Prefabs folder.
- Now, go to prefabs folder and select the prefab you want to add in the bundle, on bottom right should be a AssetBundle label with a dropdown list to the right. Select new and write the name of the bundle if isn't in the list.
  (Don't know why, but i can't write into this field, i have to copy-paste the value inside... )
- For replaced objects, name the prefab and the bunlde with the name of the model you want to replace. I suggest one model for bundle.
- For new objects chose simpliest name for model and bundle and avoid whitespaces. I suggest yournick_text to avoid possible duplicate with the original models.
- After that, select the menu created in point 1 and chose Normal, when finish right-click on AssetBundles folder -> Show in Explorer.
- Rename the file without extension from hisname to hisname.bundle
- Under the AssetBundles/New folder of the mod create a new directory and chose a name. Copy the .bundle file inside this directory. Can be more then just one.
- Ok! Now the model can be spawned in-game but how?

3 - How to use console for spawning objects

- After loading a savegame you can open the miniconsole by pressing N. Look at bottom of the screen.
- The "console" accept (for now) this commands : 
- create prefab_name
- spawn prefab_name (same as create)
- list models (list of imported objects)
- list scenes (list of all game scenes)
- list all (show all lists)
(the list are printed in bepinex console)

4 - How to create a config.xml for auto-spawning objects on scene.

- Under the AssetBundles/New/yourDirectory/ folder, where the .bundle file is located, just create a config.xml.
- Look into the config.xml included for a example.
- To see change on position simple save and reload after saving changes in the xml.

5 - How to create a config.xml for moving replaced objects local position.

- Same as point 4 but the directory is under AssetBundles/Replace/yourDirectory/ folder
- The local position of a replaced objects can be different from the original, adjust it with xml file.
- To see change on position simple save and reload after saving changes in the xml.

6 - Credits for example models used into the mod.

1) DANCING STORMTROOPER by StrykerDoesAnimation
2) Banana Dancing Fortnite by Jesús Dorado
3) Pacman Arcade + animation by Daniel Brück
4) Gangster hats by Michal Cavrnoch

Article information

Added on

Edited on

Written by

Gianxs

0 comments