The description_component is a Scene Graph component. It contains text data about the item, such as its name and description. Refer to Working with Entities and Components for how to add a component to your entity.
The component's text data can be used by other systems. Any kind of entity could utilize this component, but it is usually most helpful for player-facing information such as a character, an item, a vehicle, a location and more. The description_component has three editable fields that can be modified in the Prefab Editor and also with Verse:
Name: The name of the entity.Description: A long description of the entity.Short Description: A brief description of the entity.
See Components for a complete list of item and inventory components.
When the Custom Items and Inventory system is enabled the description_component is shown in the component dropdown list. For more information, check out the description_component API reference from the Verse API.
Example
In the example below, the description_component is added to an item prefab (an entity with an item_component).
Now when the item is picked up by a player, the Name and Description fields from the description_component are shown in the Backpack UI.
Verse: Description
Through Verse the description_component properties can be dynamically modified or new ones added.
You can use the examples below to set up the description_component in your project using Verse.
Below is a subclass of the description_component. It selects a random entry from an array of names to be used as the value for Name in the component.
# Copyright Epic Games, Inc. All Rights Reserved.
using { /Verse.org/SceneGraph }
using { /Verse.org/Presentation }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
# The text we want to use for names in our description_component must be declared outside of the class.