SteveTownsend / SmartHarvestSE

AutoHarvest 2 Skyrim SE mod ported to CommonLibSSE
GNU General Public License v3.0
18 stars 7 forks source link

FEC death-item lootables not automatically handled #473

Closed SteveTownsend closed 5 months ago

SteveTownsend commented 8 months ago

Nexus report from Roentgens

I am having a problem with looting satchel packs spawned by Frozen Electrocuted Combustion(FEC). Basically in FEC, electrocuted enemies can explode, leaving a satchel pack with their inventory and death items. Smart Harvest doesn't seem to able to loot these containers, I was wondering if this is similar to the ash pile problem in the past. I took a screenshot. I think the problem is that the satchel is marked player owned by FEC?

image

SteveTownsend commented 5 months ago

The mod scripts _po3deatheffectsnpcperm.psc and _po3deatheffectscr.psc marks the container with the victim's inventory as PlayerOwned, maybe to avoid triggering theft checks? Need to treat this as a special case and allow autoloot.

Function PlaceContainer(Container akPouch, Container akSatchel)

    ObjectReference inventory

    int numItems = victim.GetNumItems()
    if numItems > 0
        if numItems <=  4       
            inventory = victim.placeAtMe(akPouch)
            inventory.SetDisplayName(victimName + "'s Pouch", true)
        else
            inventory = victim.placeAtMe(akSatchel)
            inventory.SetDisplayName(victimName + "'s Satchel", true)
        endif       
        inventory.SetActorOwner(PlayerRef.GetActorBase())       
        victim.RemoveAllItems(inventory, abRemoveQuestItems = true)
    endif

endFunction
SteveTownsend commented 5 months ago

Test evidence for whitelisting these (the last one fixed -> 0x908 after this run)

2024-06-16 11:45:50.484     info  17668 Found exact match 0xfe053817 for FEC.esp:0x000817
2024-06-16 11:45:50.484     info  17668 CONT FEC.esp:0xfe053817 added to Whitelist
2024-06-16 11:45:50.484     info  17668 Found exact match 0xfe053825 for FEC.esp:0x000825
2024-06-16 11:45:50.484     info  17668 CONT FEC.esp:0xfe053825 added to Whitelist
2024-06-16 11:45:50.484     info  17668 Found exact match 0xfe053843 for FEC.esp:0x000843
2024-06-16 11:45:50.484     info  17668 CONT FEC.esp:0xfe053843 added to Whitelist
2024-06-16 11:45:50.484     info  17668 Found exact match 0xfe053844 for FEC.esp:0x000844
2024-06-16 11:45:50.484     info  17668 CONT FEC.esp:0xfe053844 added to Whitelist
2024-06-16 11:45:50.484     info  17668 Found exact match 0xfe05386a for FEC.esp:0x00086a
2024-06-16 11:45:50.484     info  17668 CONT FEC.esp:0xfe05386a added to Whitelist
2024-06-16 11:45:50.484     info  17668 Found exact match 0xfe053876 for FEC.esp:0x000876
2024-06-16 11:45:50.484     info  17668 CONT FEC.esp:0xfe053876 added to Whitelist
2024-06-16 11:45:50.484     info  17668 No exact match for FEC.esp:0x009078
2024-06-16 11:45:50.484     info  17668 Whitelist CONT FEC.esp/0x00009078 not found

image