MP Playtesters wanted!
Giving up on the previous method of Autopickup, I have found a workable solution, at least for single player. It still has one hell of an exploit. I bet if you tried, you could crash your game by never picking up a component. The old version as well as this test version are doing the same thing. If you leave them in the world, you are destroying the ānatural progressionā of the game. Whatever, my parents told me not to smokeā¦
In any case, before, the pickup was triggered by OnRemoveFromWorld, which was nice and peachy. But, OnRemoveFromWorld is mysterious and if you leave an area with an Autopickup component on the ground, it gets āremoved from worldā, even though it is still there on the ground when you return.
So, little elves are at workā¦you turn your back and they come and remove stuff. You go back they replace it. Exactly where it was. That brings us to OnAddToWorld. As you guessed, it triggers when the loot is added such as when the component or scrap pop into the game out of a tasty loot orb or dead corpse on a bridge. And it triggers when the elves put it back too after you had to use the vendor.
But this is kinda fun, if I put the Autopickup on OnAdd as soon as you loot, you get them. You still have to pick them up. Otherwise, you trigger the exploit.
But which is the better way? And how does this work in MP?
In any case, the script just got made generic, so I need to edit all 80+ dbrs to change something, and now I could just as easily change the script call and move it to the OnAddToWorld trigger at the same time. But I suspect that OnAddToWorld is the less good option.
For anyone who wants to see this in action, and if some pairs of you could test in MP with both loot options and tell me who gets what and how many.
Here is a mods/Grimarillion/database/Grimarillion.arz database replacement
https://mega.nz/#!FBBWlTrR!XWen0gl2xT1NnZpIfgvMWsMyo-wicFQWmnXiQ9HoGJg
here is the mods/Grimarillion/resources/scripts.arc
https://mega.nz/#!0JogTZKa!rgvZ6tgB9kPw38ky47J0tzcCbDKvgITuuvU8X0zx708
backup your originals as these are not release quality versions, all they do is modify polished emeralds that drop from the starting bridge now. So to test, you enter world together, loot the corpse without picking up the emeralds. Leave by rift somewhere. Wait about 30 seconds, rift back to DC. You barely materialize and you should hear the sound of the component(s) you left on the bridge getting mistakenly put back into the world into your inventory as well as on the bridge.
I do not even know if only the person looting will get the component or if everyone gets them or what will happen in MP. If you have time to kill, give it a shot. I will put your names in the OP.