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.
  • 1) Create a prefab with ork event that on click gives player loot you want to.
    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.
  • Thank you for the advice, but I ended up coding my own ORk spawning for items and currency on death. I am using a custom coded character controller with it's own custom death event using the ORK API so I shoved some code in the death function of the character.

    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();
  • You can set up stuff to spawn into the world instead of getting placed in the player's inventory in your battle system's settings - each system has their own Battle Gains Collection settings.

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.