Xyberviri Posted June 5, 2022 Share Posted June 5, 2022 (edited) So i wrote this to trouble shoot a issue i was seeing with trying to mess with loot from my mod, i wanted to change some mod data on the items that spawn on zombies but not ones that were crafted or spawned in by a admin. The issue is im only able to see the items worn on a zed when this event fires. local function zombieDead(zombie) local inv = zombie:getInventory():getItems(); for i = 0, inv:size() - 1 do local item = inv:get(i) print("ZEDLOOT: "..item:getFullType()) end end Events.OnZombieDead.Add(zombieDead); If i kill a zombie only the items on that zombie are being returned when i get the inventory. The Hand Fork on this zombie was in its back here is another one where the matches and wallet had to be added after the event fires: this one wasnt able to see the lighter. Im trying to figure out if this is intended behavior or if there is something else up since the only use cases in the game of this event aren't dealing with the inventory of the corpse. And other mods all seem to just be checking for the outfit to see if they want to add inventory not mess with existing. But the issue is im going to have to write my own loot tables if i want to do that. Edited June 5, 2022 by Xyberviri Link to comment Share on other sites More sharing options...
Tchernobill Posted June 6, 2022 Share Posted June 6, 2022 Hi, As you noticed, at the time the IsoDeadCorpse container is created: 1- the visible items (clothes, worn weapons..) are transferred from the "just dead" IsoZombie to the IsoDeadCorpse. 2- the invisible items are created. If you wanna mess with loots that pop up at IsoDeadCorpse time, without using the loot tables, there is a (twisted) way: - Store the IsoZombie identifier when the Zombie Dies. - When a new container is reacheable (OnRefreshInventoryWindowContainers) check it is a Dead corpse, check the associated IsoZombie identifier matches a Zombie newly dead, add your loot. Link to comment Share on other sites More sharing options...
Xyberviri Posted June 7, 2022 Author Share Posted June 7, 2022 16 hours ago, Tchernobill said: OnRefreshInventoryWindowContainers Ah thanks for the tip I played with this the other day with another object and didnt think about checking the container that way. that gives me somethign to work with. Link to comment Share on other sites More sharing options...
Tchernobill Posted June 7, 2022 Share Posted June 7, 2022 (edited) I did it in AutoLoot (Autodrop.lua), but not linking to Zombie Ids which will be your main problem I guess. Edited June 7, 2022 by Tchernobill Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now