DanielWillett.LevelObjectIcons 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DanielWillett.LevelObjectIcons --version 1.1.1                
NuGet\Install-Package DanielWillett.LevelObjectIcons -Version 1.1.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DanielWillett.LevelObjectIcons" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DanielWillett.LevelObjectIcons --version 1.1.1                
#r "nuget: DanielWillett.LevelObjectIcons, 1.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DanielWillett.LevelObjectIcons as a Cake Addin
#addin nuget:?package=DanielWillett.LevelObjectIcons&version=1.1.1

// Install DanielWillett.LevelObjectIcons as a Cake Tool
#tool nuget:?package=DanielWillett.LevelObjectIcons&version=1.1.1                

Level Object Icons Module

This was originally a part of DevkitServer and has been ported to a standalone module.

Object Preview

Features

Installation

  • Download and extract the latest standalone module from Releases into your Unturned/Modules folder.
  • Download the latest standalone module from the latest release of my UI utility library, UnturnedUITools, and extract this into your Unturned/Modules folder.
  • Edit the configuration file if desired (see below).
  • Launch without BattlEye so the module loads.

Features

  • View objects, NPCs, and decals without placing them.
  • Cycle through all of the material options in the default material palette (if set).
  • Edit object icons in-game for any objects.
  • Objects without custom icons are automatically lined up for any object.
    • The front is assumed to be the -Z face of the object when at a Euler rotation of (-90, 0, 0) (this is the default for most objects in-game, which is why it was chosen).<br>
  • All vanilla objects have icon camera transform overrides (when necessary).
  • Any mod can easily add their own offsets directly to their Bundles folder.
  • Preview the text in notes without placing them.
  • Default icons for notes, flags, billboards, decals, and NPCs that will update automatically if a new one is added later on.
  • Modules can add their own default icon provider by implementing the IDefaultIconProvider interface.

Configuration

There are two config files.

level_object_icons_config.json

Main settings file for the module with the following options:

  • edit_keybind: Key used to toggle the Live Editor checkbox. Default: F8
  • log_mising_keybind: Key used to print all objects that don't have an offset to Client.log. Default: Keypad5
  • cycle_material_palette: Enables cycling between materials in the material palette. This may cause some lag on lower-end machines. Default: true
  • debug_logging: Enables extra logging to see what files are being used, etc. Default: false
  • disable_default_provider_search: Disables searching other modules for default icon providers. Set this to true if errors arise from ApplyDefaultProviders. Default: false

Open in Visual Studio Code or another IDE that supports JSON schemas to get auto-complete.

Localization

Change translation values for UIs and add a language here. English.dat has the default values but you can add your own language if desired, similar to how vanilla localization files work.

Implementing custom overrides for your mod

You can create offsets using the in-editor object extension menu. You must have this enabled in the config, which will be enabled by default.

Spawn in the object you want to edit (E).

Press 'F8' while in the Object Editor. You should see a toggle box appear called Live Editor, ensure it's checked. It is normal to have a minor FPS drop while editing.

You must have the asset selected and the object you just spawned in selected, then you'll see the preview moving as you move your camera.

You can have multiple objects selected, as long as you only have one selected of the type you're editing. This can be useful for making multiple icons have the exact same offset.

Position your camera so the preview looks how you want the icon, then either hit Save or Save New (see below).

Save New saves to (or updates if theres already an icon preset there) the custom icon file: <Module Folder>\configured_icons.json, where they can be copied into your mod or plugin.

Save looks for a non-readonly file with an icon preset for that asset and saves there, otherwise it saves to the same place as Save New.

In-Game Editor

editor

Read Locations

Except for the Custom icons file, the file name must start with one of the following (case insensitive) and be a .json file:

  • Object Icons
  • Object Icon Presets
  • Object Presets
  • object_icons
  • object_icon_presets
  • object_presets
Location Readonly Recursive File Discovery
Custom icons file: <Module Folder>\configured_icons.json No N/A
Loaded workshop content: steamapps\workshop\304930\* Yes Yes
Sandbox folder: Unturned\Sandbox No Yes
Vanilla bundles folder: Unturned\Bundles Yes No
Vanilla object bundles folder: Unturned\Bundles\Objects Yes Yes
Loaded and Enabled Modules: Unturned\Modules\* Yes Yes

To include custom icon offsets in your mod, delete the custom icon file at <Module Folder>\configured_icons.json and exit and rejoin the editor if needed.

Then go through all your objects, place them, configure the icon like described above, and hit Save New.

The priority will be set as high as it needs to be to be picked over any other presets.

Once you're done, cut the custom icon file to somewhere in your mod folder (it must be under ~\Bundles for maps).

File Format

For manual entry

[
  {
    // Asset GUID or UInt16 ID - Objects do not require UInt16 IDs so they will likely become discontinued.
    "object": "GUID or ID",

    // Position offset (m)
    "position": [x: decimal, y: decimal, z: decimal],

    // Euler rotation offset (you can add a fourth argument (w: decimal) to make it read as a Quaternion)
    "rotation": [x: decimal, y: decimal, z: decimal],

    // Optional - Default is 0. Higher priorities are used first.
    "priority": integer
  },
  {
    "object": "205a8cc33c9849c9bd65790403d0753d",
    "position": [-3, -10, 9],
    "rotation": [-107, -80, 260],
    "priority": 1
  }
]

Copy Offsets

You can copy offsets of other objects by selecting the object asset, then right clicking the Goto button to fill it's GUID into the text box next to it. You could also just type the GUID in manually.

Next select the asset you want to align and a spawned level object object of the same type (not more than one) and left click Goto, it will teleport your camera to the same offset as the other object had relative to your selected object, and you can save it from there.

"Icon" Method

I recommend using the JSON method described above for compatibility and performance reasons.

Adding an empty GameObject as a child to the base prefab will provide a position and rotation for a camera.

Name it Icon (Icon2 is also supported).

To preview it in Unity, add a Camera Component in perspective mode with 60 FOV. Then just position the camera where you want.

Make sure you remove the Camera and I'd recommend disabling your Icon GameObject for performance reasons.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DanielWillett.LevelObjectIcons:

Package Downloads
DevkitServer.Client

Module for Unturned that enables multi-user map editing.

DevkitServer.Server

Module for Unturned that enables multi-user map editing.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 249 11/22/2023
1.1.1 312 11/18/2023
1.1.0 127 11/18/2023