Wiki source code of Looting System

Version 7.4 by Alexandros Mloukie on 2026/01/20 21:17

Hide last authors
Alexandros Mloukie 1.1 1 = 0 - Introduction =
2
3 The purpose of this document is to give a more detailed explanation on how Looting would work in the Mawforged MVP. Note that changes can be made to this system in the final game. Should the assigned programmer need any more information, contact {{mention reference="XWiki.AlexandrosMloukie" style="FULL_NAME" anchor="XWiki-AlexandrosMloukie-9xtdtf"/}} .
4
5 ----
6
Alexandros Mloukie 5.1 7 (% class="wikigeneratedid" %)
8 [[image:Looting Manual.png]]
9
Alexandros Mloukie 7.2 10 = 1 - Enemy Inventory =
Alexandros Mloukie 1.1 11
Alexandros Mloukie 7.4 12 Every enemy in the game needs to have access to their very own inventory. This can probably use the {{info}}MAWInventoryComponent{{/info}} already used for the player, though there are gonna be some extra things to it so a new component might be needed. The inventory will be populated with items on __enemy spawn__ instead of on-death. The items that will occupy the inventory will be defined through a {{success}}Data Table{{/success}}, so designers can easily tweak values later on.
Alexandros Mloukie 1.1 13
Alexandros Mloukie 7.3 14 == 1.1 - Enemy Loot Data Table ==
15
16 The loot entries struct that will fill the {{success}}Loot Data Table{{/success}} will be in the following form:
17
18 (% class="table-bordered" %)
19 (% class="active" %)|=(% style="width: 140px;" %)Variable|=(% style="width: 170px;" %)Type|=(% style="width: 852px;" %)Description
20 |(% style="width:140px" %)Item|(% style="width:170px" %){{info}}FItemStack{{/info}}|(% style="width:852px" %)The item that will be added to the enemy inventory.
21 |(% style="width:140px" %)DropWeight|(% style="width:170px" %){{success}}float{{/success}}|(% style="width:852px" %)The chance that this item will be added to the enemy inventory. The value must be between 0 and 1 (mapped to 0% - 100%)
22
23 The enemy uses a {{info}}[[Data Table Row Handle>>https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/FDataTableRowHandle]]{{/info}} to define which entry in the Data Table they will be using to populate their inventory.
24
25 = 2 - =