Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/creating/delimods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
title: Deli mods
---

Deli is a popular format of packaging mods, and can be anything from maps, code mods, or guns.
> [!WARNING]
> Deli is not supported anymore. The following information is here for legacy reasons only. If you were linked here
from a seemingly updated article, [open an issue](https://github.com/H3VR-Modding/wiki/issues/new).

Deli was a popular format of packaging mods, and can be anything from maps, code mods, or guns.

All a `.deli` file is, is a `.zip` renamed.

Expand Down Expand Up @@ -65,7 +69,7 @@ mod.deli/
vault_...
```

Your `character.json` file should be inside of a folder, named anything you want. In this example I used the `character`
Your `character.json` file should be inside a folder, named anything you want. In this example I used the `character`
name. Your sosigs should have the "sosig_" prefix, and your vault files should have the "vault_" prefix.

This should make the following list for you to copy into your `"asssets"` list:
Expand Down Expand Up @@ -116,7 +120,7 @@ mod.deli/
```

Your `item` is the assetbundle created through Unity. You do not need to include its `.manifest` file, but you can.
Do **NOT** reference this file inside of the manifest.
Do **NOT** reference this file inside the manifest.

This should make the following list for you to copy into your `"asssets"` list:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 59 additions & 112 deletions src/creating/implementing/the_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,57 @@ title: Implementing Basics
---

This document is meant as a quick reference guide, and should not be substituted for a comprehensive tutorial.
We recommend you take a look at how to set up [MeatKit](../meatkit/intro.md) first.

## Required/Recommended tools

You need Unity version 5.6.3. This is **non-negotiable**. Any patch version is compatible (p4, f). The link to the Unity
You need Unity version 5.6.7f1. This is **non-negotiable**. The link to the Unity
version archive can be found [here](https://unity3d.com/get-unity/download/archive).

[AssetStudioGUI](https://drive.google.com/file/d/18P59DJL0tGRSTXaxXknVl9lFiLJ27Y_v/view) is an extremely useful tool for
[AssetStudioGUI](https://github.com/aelurum/AssetStudio/releases/latest) is an extremely useful tool for
exporting packaged meshes and textures.

The [H3 Unity Template](https://drive.google.com/file/d/1bRHZrJxgPmE1PJGR_ty3i78mBfLTZQiB/view?usp=sharing) contains all
scripts and stubs for you to create firearms or other objects.
The [MeatKit Project](https://github.com/H3VR-Modding/MeatKit) contains everything you need to make... pretty must everything.

Once you have these, open Unity then open the folder of the template as a Unity project.
Once you have installed MeatKit, open up the project.

## Unity Window Types

There are a few types of windows inside of the unity editor.
#### There are a few types of windows inside the Unity editor:

Inspector
| Window | Description |
|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Inspector | The Inspector window shows you the details of the object you have selected. |
| Hierarchy | The Hierarchy shows the parent child relationships of your objects in the scene.</br> Objects that are selected here are not saved automatically, and must be applied through the Inspector window. |
| Game | This window shows what the camera in your scene is seeing.</br>Useful for taking pictures. |
| Scene | The Scene is a display of the objects in your hierarchy.</br>You can use the edit tools (move, rotate, etc.) in the top left of the Unity window to modify the objects placed in the scene. |
| Project | Commonly known as the Assets Tray, this area shows your file structure and saved prefabs. |
| Asset Bundles | This window shows what asset labels you have and which items are included in them.</br> In the build section, you can build your asset labels to be used and shared. |

- The Inspector window shows you the details of the object you have selected.

Hierarchy

- The Hierarchy shows the parent child relationships of your objects in the scene.
- Objects that are selected here are not saved automatically, and must be applied through the Inspector window.

Game

- This window shows what the camera in your scene is seeing.
- Useful for taking pictures.

Scene

- The Scene is a display of the objects in your hierarchy.
- You can use the edit tools (move, rotate, etc.) in the top left of the Unity window to modify the objects placed in
the scene.

Project

- Commonly known as the Assets Tray, this area shows your file structure and saved prefabs.

Asset bundles

- This window shows what asset labels you have and which items are included in them.
- In the build section, you can build your asset labels to be used and shared.

## Importing prefabs

Got an item in mind that you want to make? Think of an item already in the game that is most like it, and which class it
would belong in (melee, smg, rifle, etc.). Open your file explorer and go to your root H3VR folder, then navigate
to `H3VR/h3vr_data/StreamingAssets/` and find that file. For example, if you wanted to make an smg, you would want to
copy the `assets_resources_objectids_weaponry_smg` and `assets_resources_objectids_weaponry_smg.manifest` file.

Paste those files inside of your H3 unity template under assets (`H3 Unity Template/Assets/`).

You should have empty game object with the prefab loader script component in the unity window. If you don't have one,
you can right-click in the `Hierarchy` on the left and click the `Create Empty` button. Once selected, in
the `Inspector` tab on the right, click on the `Add Component` button and search for the prefab loader script.

Once you have a prefab loader object ready, fill it out with the fields you need.

1. Open the `.manifest` file in any notepad program.
2. Find the `.prefab` path you want to copy. Note: `.asset`s cannot be used.
3. Fill in your prefab loader object with the path to your asset bundle you are extracting from, and the path you copied
from its `.manifest` file.

For example:
>[!NOTE]
> If you want to contribute, adding an entry on the Advanced Prefab Loader is welcome!

Prefab Path: `Assets/assets_resources_objectids_weaponry_smg`
1. Enter and exit Play Mode by clicking on the Play button in the upper center of the Unity Editor, then clicking on it
again when the Editor unfreezes. (Note: If you wish to retain the meshes and materials of your imported objects
at the cost of losing script references after a restart of the Editor, forgo this step)
2. Go to `Meatkit > Prefab Loader` ![](images/UnityEditor/prefab_loader.png) and click on the `Select Asset Bundle` button on the pop-up. ![](../implementing/images/UnityEditor/prefab_loader_window.png)
3. Navigate to `\steamapps\common\H3VR\h3vr_Data\StreamingAssets` and open the asset bundle with the object you
wish to import into the Hierarchy.
4. Finally, choose the prefab you want to import by clicking on the asset display button, navigating to your desired
prefab, clicking it and clicking Spawn.
![prefab_loader_choosing_a_prefab.png](images/UnityEditor/prefab_loader_choosing_a_prefab.png)

This is the location of the bundle you copied into your Unity project.

Prefab_to_Load: `Assets/Weaponry/SMGClosedBolt/Mp9.prefab`

This is the path copied from the manifest file.

Press the pause button then the play button at the top of the screen, then drag the clone into your assets tray.

## Importing assets

Importing assets is as easy as copying them to your Unity project. Its recommended to make them under a recognizable
Importing assets is as easy as copying them to your Unity project. It is recommended to make them under a recognizable
folder, such as `Materials`. This can be done by dragging and dropping them into the Assets tray, or by opening your
OS's file explorer and copying them through there.

Assets can range from textures, meshes, or sounds.
Assets can range from textures and meshes to sounds and custom scripts.

**Alloy** is the lighting system that H3VR uses, and because of that we need to create special materials to make sure
that the item you are trying to create renders correctly.
Expand All @@ -104,6 +69,9 @@ the `Material Map Channel Packer` in the window tab.

![channel packer](images/UnityEditor/alloy_channel.png)

>[!NOTE]
> This section needs more information. Contributions welcome!

In the window that opens, drag your textures into the required fields. The normal is not required. After you hit
generate, you will obtain a metal texture. Fill you material with your texture sets now (base/diffuse, metal, and
normal).
Expand Down Expand Up @@ -133,28 +101,31 @@ You will have to figure out the specifics on your own.

## Required Assets

To make sure your weapon works, you need to give it an object wrapper (found in the main script). The object wrapper is
simply an object id, something that defines your item.
To make sure your weapon works, you need to give it an Object Wrapper
(can be created with `Assets > Create > Object IDs > Object ID`). The Object Wrapper is
simply an Object ID, something that defines your item.

Among the item id, you also need:
If you want your item to show up in the spawner, you will need to give it a Spawner Entry.</br>
This can be done by creating said Spawner Entry via `Assets > Create > MeatKit > Otherloader > Spawner Entry`

- Item Spawner ID
And if the item is a firearm:

And depending on the if the item is a firearm or not:

- Recoil profile
- Audio profile
- Recoil Profile (`Assets > Create > Firearms > RecoilProfile`)
- Firearm Audio Set (`Assets > Create > AudioPooling > FireArmAudioSet`)

## Filling out the specifics

This next section will go over what needs to be filled out in each file detailed above. Included are example `.zip`
files that include an empty script object and it's associated `.meta` file. You can extract these into your Unity
project for reference and duplication. If for whatever reason the scrip file is empty, click on the little circle in the
Inspector window and browse for the correct name of the script and press enter.
This next section will go over what needs to be filled out in each file detailed above. If you want to duplicate an
already-existing script, you can do that by:
1. Clicking on your desired already-filled-in prefab
2. Finding a field that has the required script filled in (e.g. all Physical Objects (which includes firearms)
will have it filled in right under the Physical Object Config Header) ![physical_object_object_wrapper.png](images/UnityEditor/physical_object_object_wrapper.png)
3. Double-clicking the field. This will open the script in the Inspector, from where you can copy the contents however
you want. Note that this will NOT add the script to your project.

### Item ID

[Script example download](https://github.com/H3VR-Modding/wiki/raw/main/src/creating/implementing/files/file_ID.zip). Script name: `FVRObject`
Script name: `FVRObject`

The Item ID requires a few fields to be filled out:

Expand All @@ -165,28 +136,28 @@ Item ID, Display Name, Spawned From ID:
Identifiers of your item. To avoid confusion, should all be the same.

The rest of the fields should be filled out to your discretion. They are tags that relate to Take and Hold, so if you
want your item to spawn in it they need to be filled out.
want your item to spawn in it, they need to be filled out.

Finally, if you want your item to spawn in TnH, enabled the `O Sple` property.

### Item Spawner ID
### Item Spawner Entry

[Script example download](https://github.com/H3VR-Modding/wiki/raw/main/src/creating/implementing/files/file_ISID.zip). Script name: `ItemSpawnerID`
Script name: `ItemSpawnerEntry`

The ISID can be made through the assets tray `Create > ItemSpawner > ID`, and the icon is just an image that has its
The Item Spawner Entry can be made through the assets tray `Create > MeatKit > Otherloader > SpawnerEntry`,
and the icon is just an image that has its
metadata changed to be a sprite (clicking on the icon and changing the type in the inspector).

Make sure that you have `Is Displayed In Main Entry` and `Is Unlocked By Default` are set to true. This will allow you
to see your item and spawn it. Set it's category and sub category so that you can find it (make sure that you set it to
something used in the game already or else it won't load correctly). Set the sub heading to something you want, but its
not required.
to see your item and spawn it. Set its category and sub category so that you can find it. Set the sub heading to something
you want, but it's not required.

Fill out the icon with the one you made (not required), and set the `Item ID` field to the exact same string you used in
the Item ID object just above. Drag your item id object into the `Main Object` field.

### Recoil profile

[Script example download](https://github.com/H3VR-Modding/wiki/raw/main/src/creating/implementing/files/file_Recoil.zip). Script name: `FVRFireArmRecoilProfile`
Script name: `FVRFireArmRecoilProfile`

This is just a bunch of number fields that determine your weapon's recoil.

Expand All @@ -196,50 +167,26 @@ If you want to simulate your referenced weapon, the follow the following steps:
2. In the Hierarchy, click on the newly cloned weapon.
3. Scroll down in the Inspector window until you find the location of the recoil profile that is required by all
weapons.
4. Double click on it.
4. Double-click on it.
5. The Inspector should have changed to show your referenced weapon's recoil profile. Take a screenshot
using `win + shift + s`, or any other snipping tool you may have for a quick reference.

Make sure that you place your recoil profile in both slots in your weapon's main script.

### Audio Profile

[Script example download](https://github.com/H3VR-Modding/wiki/raw/main/src/creating/implementing/files/file_Audio.zip). Script name: `FVRFirearmAudioSet`
Script name: `FVRFirearmAudioSet`

The Audio profile is exactly the same as the recoil profile, double check what your referenced weapon used by following
the similar steps, taking pictures along the way. Make sure that you expand all clip sections and take note of which
fields (such as `prefire`) are filled. Your weapon's audio profile **must** contain a sound in the same field.

AssetStudioGUI is a great tool to use here. Drag and drop the asset bundle you copied into your Unity project into the
ASGUI window and wait for it to load. Select the `Asset List` tab and then search for the sound files that are required.
You can right click on the sound files and click `Export Selected Assets`, and you can export them straight to your
You can right-click on the sound files and click `Export Selected Assets`, and you can export them straight to your
Unity project to use.

## Building your item

Before building your item, you need to add a few items to your asset bundle list. To do this, select your prefab, item
id, and item spawner id from the assets tray (using `ctrl + click`), then look at the bottom of the inspector tab. Here
you will see a black box with a drop-down at the bottom. This is the asset label box, and allows you to select which
items are bundled together.

![bundle selection](images/UnityEditor/assetbundle_select.png)

In the drop down, create a new bundle name that is descriptive of your item. This usually is the name of your mod, but
its recommended to include a short-form or your name as well for diagnostic purposes.

Next up, select the `AssetBundle Browser` from the `Window` tab.

![assetbundle browser open](images/UnityEditor/assetbundle_browser_open.png)

This will open a small window. You can move the tab somewhere easier to see in another part of the unity editor.

![browser](images/UnityEditor/assetbundle_browser.png)

In the `Configure` tab, you can select your asset label to see what is inside of your bundle that will be made.
Everything that your item needs will be auto populated by unity, so don't worry about tracking things down.

In the `Build` tab, you can select the location where your bundle will be built to. It is recommended to just select
your `H3VR/LegacyVirtualObjects` folder to make it easier to test. Make sure you have `Clear Folders` enabled,
and `Copy to Streaming Assets` disabled.

Thats it, hit build and you are on your way to testing it.
It's currently recommended to use the [MeatKit Build Profile](../meatkit/getting_started/2_build_profile.md) to build
your mod as a Thunderstore package.
Loading