Getting a Placeable to drop an item?
Dragonfolk2000
Member Posts: 390
So I'm trying to make it so a tree will drop planks of wood when it is destroyed. However, you can only target a placeable if it is set to useable. I don't want the player to click on it and open up an inventory. So I have Has Inventory set to false. I have an existing 'loot drop system' in place that seems to work for placeables and creatures as long as they have an inventory. I've found a function that checks if an object is a placeable and another function that checks if a placeable has an inventory. My current loot system places objects into the inventory of the dying creature using CreateItemOnObject but this won't work if the object doesn't have an inventory.
I am trying to find a function that will give a placeable object an inventory. Does one exist? If not I'll probably make a separate loot thing that handles placeables without inventories. The existing loot system would be difficult to make adjustments to account for objects without inventories otherwise.
I am trying to find a function that will give a placeable object an inventory. Does one exist? If not I'll probably make a separate loot thing that handles placeables without inventories. The existing loot system would be difficult to make adjustments to account for objects without inventories otherwise.
0
Comments
//Placeable OnDeath drop stuff
void main()
{
location lLoc = GetLocation(OBJECT_SELF);
CreateObject(OBJECT_TYPE_ITEM, "res ref of item", lLoc);
}
That's what I ended up doing. But this method requires making extra scripts for the objects that don't normally have inventories.