How i would do this (in theory)
1. when the deer is killed in its exit function spawn or un-hide the food entity and move it.
2. the foods script should be in the food, and then when the player picks it up make it hide instead of destroyed that way you can re use it. ( i don't know if the script will work again though when it is un-hid.
again this is theory, but you could also maybe find a loot script from your neighbor hood friendly Smallg. that may simplify some things. I haven't been to visible loot yet.
edit: testing with the theory above, I had to use dagored's rabbit ( i don't have mushrooms scripts but but for this I won't need them.)
on the rabbits exit function I made activate if used the dead rabbit in the medieval entities. so when the rabbit dies it will spawn the rabbit meat. using SetPosition(e,x,y,z) in the dead_rabbit script I made it spawn where the current rabbit died.
--dead rabbit body
g_show_corpse = false
function dead_rabbit_init(e)
end
function dead_rabbit_main(e)
Hide(e)
if g_show_corpse == true then
ResetPosition(e,g_loot_positionx,g_loot_positiony,g_loot_positionz)
SetActivated(e,1)
Show(e)
--example of the player interaction if below
--[[
if player_distance <= 80 then
prompt("press e to loot")
end
if player_distance <= 80 then
if e_is_pressed == true then
add_to_variable
do what ever
end
end
--]]
elseif SetActivated(e,0) then
Hide(e)
end
end
also added this into the rabbits exit function
--this gets the current entities x, and y to move the body,corpse and this will tell the
--other entity what ever you are using to show.
g_show_corpse = true
g_loot_positionx = g_Entity[e].x
g_loot_positiony = g_Entity[e].y
g_loot_positionz = g_Entity[e].z
ActivateIfUsed(e)
this may be inefficient but this is how i got this to work maybe you this will give you an idea though for your own way of doing it.
Markchapman10 is my Skype let's have some dev talk.