Generic filters
Exact matches only
Search in title
Filter by Custom Post Type
Search in project

Dropping Items on the ground

To set up dropping items on the ground we have to set the INVENTORY_LOOT_ON_GROUND game setting parameter to true in the Atavism Standalone Editor -> Game Settings option.

There are some other parameters but we will describe them later.

Now we need to define the visual representation of the dropped item. To do this, we need to create a prefab in the Unity Editor, but for this document purpose we will use a reference example included in the Atavism called ItemTwoHand00 located in the Assets\Resources\Content\GroundItemDisplay

This item looks like this and the main difference between a typical prefab and this one is the additional GroundItemDisplay component. It also has a capsule collider, but you can use any primitive unity collider which is responsible for colliding with your terrain or ground objects in general. On the screenshot, you can also see the BlMiniMapItem component that will display the item on the minimap, but it’s optional, Let’s go back to our GroundItemDisplay component to describe all its parameters.

We have such parameters like:

  • Drop Effect Object – Defines game objects from the prefab that will be turned on when the item hits the ground – highlighted with yellow color in the below screenshot.
  • Loot Effect Object – Defines game object from the prefab that will be turned on when the item is looted by a player – highlighted with pink color in the below screenshot.
  • Loot Coord Effect – Defines Coordinated effect (prefab name) that can be instantiated when a player loots the item. The coordinated effect prefab must be placed directly in the Assets\Resources\Content\CoordinatedEffects directory
  • Move Object – Defines our main prefab object that will be moved when the item is dropped. We have to select the object from the prefab that can be nested prefab – highlighted with blue color in the below screenshot.
  • Move Curve – Defines position in time in relation to Move Offset parameter, so for our example graph in the middle of the curve our item will be in the Move Offset value.
  • Move Offset – Defiens maximum offset value for our moving object.
  • Rotation X Curve, Y Curve, Z Curve – These define rotation in every axis you want. In our example, we are using only X-axis rotation to give the item a bit of rotation.
  • Final Object – Defines game object from the prefab that will be turned on when the Move Object hits the ground. It can be useful if you want to move some particles during the movement but place a static object on the ground.
  • Marker – Defines additional effects that will be turned on when the item hits the ground. You can place there something like a beam or flickering light to highlight that special item was dropped. In our case, we prepared a light beam with some particles – highlighted with green color in the below screenshot.
  • Start Loc, Dest Loc – These locations are only for tests, to display values for the specific object.
  • Height – Defines where the label with the item name is spawned.

You can also set some audio effects, that can be within objects that Atavism will turn on or off within the Item Prefab, or you can use the new Audio Evnet System for Items and this is configured in the Atavism Standalone Editor. There you have various events that you can set, but these are described more here.

Now you have to assign our Item Preafb called ItemTwoHand00 to our item and we are doing it in the Atavism Standalone Editor in the Items Module.

Update it and restart the server. Here is the result of the example configuration.

Also, in the game, you can set what quality of items will be looted automatically. Just open game settings (by default by pressing the ESC button), General tab, and use dropdown list.

You can also configure the mentioned earlier game setting parameters:

  • INVENTORY_LOOT_ON_GROUND – Defines if the server should drop items on the ground or use the default system – Boolean – Default value: false
  • INVENTORY_LOOT_ON_GROUND_TIMEOUT – Defines how long the item remains on the ground (in seconds) – Integer – Default: value: 600
  • INVENTORY_LOOT_ON_GROUND_TIMEOUT_INTERVAL – Defines interval in which the server will check if the item on the ground should be removed (in seconds) – long – Default value: 5
  • INVENTORY_LOOT_ON_GROUND_MAX_DISTANCE – Defines range in which the item can be dropped on the ground (in meters) – Integer – Default value: 10
  • INVENTORY_LOOT_ON_GROUND_LOGOUT_QUALITY_MAIL – Defines item qualities of items that will be mailed to the player who dropped them when the player is disconnected, logged out, or when will leave the instance – String – Default value: “5” (you can define more with “;” as a separator. The number is from the ordered list of item qualities from the Option Choices dictionary)