I was wondering how I could make items spawn on the ground after killing enemies. I am doing real time combat 2D.
In OrkFramework I have a loot table made and in the combatant settings I have them using the loot table.
Do I need certain components on a prefab object and drag it into the prefab setting or is there something I am missing.
2) In Death event spawn the prefab.
3) Create different prefabs and different Death events for each enemy type (worse) or have single event, but use Check Combatant node to decide which prefab to spawn (better).
There potentially is a more advanced method. Maybe you can use Equipment to variable node to tell the prefab which items to spawn. You would have to use object variable for that.
attacker.Status[13].AddValue(exp, false, false, true, false, true, true, null);
List<IShortcut> itemList = new List<IShortcut>();
combatant.Inventory.GetAll(false, true, true, true, true, true, true, true, -1, true, ref itemList);
{
foreach (IShortcut item in itemList)
combatant.Inventory.Drop(item, 1, false, false);
}
var cash = combatant.Inventory.GetMoney(0);
Debug.Log(cash);
ORK.Game.ActiveGroup.Inventory.AddMoney(0,cash,true,false);
combatant.Status.Death();
When enabling Collect Immediately, you can enable dropping stuff. That'll spawn the item's prefab, so you can use e.g. a Place On Ground component (or some custom component) to place it directly on the ground.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!