Jump to content

Help modify auto-loot addon to loot everything


lasere200

Recommended Posts

lol isActorDetected fails hard. returns 0 for the player... that's inconvenient to say the least

 

Yep :confused: . a refwalk it is then and...

 

If npcRef.GetDetected player

 

Don't forget to filter out player + companions. This thread should help with that part...

http://www.thenexusforums.com/index.php?/topic/377444-how-to-get-if-crature-was-killed-by-companion/

Link to comment
Share on other sites

hello. version 0.3 is up and I want to thank you again. This is what I needed for bringing the fun back into that game and thanks to you it became possible. i can still improve on it an I will certainly try but right now it's looking really good. I'm just in the action so much more because of it and it's set it and forget it. i'll test it more in the days to come. thaks a million
Link to comment
Share on other sites

  • 3 weeks later...
someone commented on something I noticed myself... the add-on is picking up creature weapons... acid spit, hand laser and such. while I am thinking of disabling picking up weapons from corpses completely i figure there has to be a reason why you don't see these weapons in-game on corpses. some way they are set as hidden or something. does anyone have a clue about something like that?
Link to comment
Share on other sites

You could make a formlist to filter them out

 

set rBaseObject to rLootWeapon.GetBaseObject
set iIndex to ListGetFormIndex MyOffLimitWeaponsFormList rBaseObject
if iIndex > -1
;Dump weapon - don't want it
endif

Link to comment
Share on other sites

  • 1 month later...

hey. been away for a while. got back to maybe trying to make the mod better.

 

this is my way of filtering container items. I can't get it to actually check the list. IsInList halts the script while ListGetFormIndex doesn't really work. I think there's something about the pInvObk ref because of GetInventoryObject... can you help please. i've tried with the actual index from the formlist as in "ListGetFormIndex list ref == 1" (second position in list was a wrench) and it doesnt' work... doesn't halt it though

 

						if invPos < invCount
						set pInvObk to containerRef.GetInventoryObject invPos
						set pInvCnt to containerRef.GetItemCount pInvObk
						set vaFloat to GetValue pInvObk
						set waFloat to GetWeight pInvObk
							if waFloat == 0
								containerRef.removeitem pInvObk pInvCnt
								player.additem pInvObk pInvCnt
							elseif vaFloat / waFloat >= 10
								containerRef.removeitem pInvObk pInvCnt
								player.additem pInvObk pInvCnt
							elseif ListGetFormIndex MagneticPersonalityMiscFormList pInvObk >= 0
								containerRef.removeitem pInvObk pInvCnt
								player.additem pInvObk pInvCnt
							endif
						set invPos to invPos + 1
						Goto 666
					endif

Link to comment
Share on other sites

  • 1 month later...

Good job so far, lasere. If you could go ahead and try implementing the filter-out formlist like suggested before, then it might help with the issue of picking up enemy weapons/ammo.

 

Then there's the issue of some activators not wanting to trigger (possibly due to cells with scripted events), and NCR money not being picked up.

 

As I pointed out, both NCR and Legion money exist in 2 places in the item list(according to GECK):

Items - Caravan Money - MoneyLegion... and MoneyNCR

Items - Misc - LegionMoney... and NCRMoney

 

It could be that the ones being held in inventory are the first one, Caravan Money, and because of that may need a different refcode.

 

Also, I hope you don't mind, but I've spent a bit of time modifying the item lists for the DLC expansions. When done, if I actually get around to finishing, I could throw them your way for evaluation and you could add them as additional esps for people to use.

 

I don't suppose anyone would know a good way to look at held inventory in a save, in order to be able to determine which items should be filtered out? It might be easier to figure it out based on what is actually picked up, than having to go through every creature type and find all weapons/ammo they might be holding, and manually deleting them from collection records (unless the filtered out list is implemented, then it might be just as easy to add them to that list, if one doesn't already exist somewhere)

Link to comment
Share on other sites

  • 3 years later...

My apologies for resurrecting an old thread. I've only recently started to use lasere2000's auto loot mod, and it's really done a lot to improve the gaming experience.

 

I'd like to make a tiny modification to the mod though. Namely the script below:

    set NpcRef to GetFirstRef 42 1 0
    Label 42
    if NpcRef
        if player.Getdistance NpcRef < 256 && NpcRef.GetDisabled == 0 && NpcRef.GetDead == 1
            ;NpcRef.RemoveAllTypedItems Player 1 1 24
            NpcRef.RemoveAllTypedItems Player 1 1 25
            ;NpcRef.RemoveAllTypedItems Player 1 1 26
            NpcRef.RemoveAllTypedItems Player 1 1 29
            NpcRef.RemoveAllTypedItems Player 1 1 31
            NpcRef.RemoveAllTypedItems Player 1 1 40
            NpcRef.RemoveAllTypedItems Player 1 1 41
            NpcRef.RemoveAllTypedItems Player 1 1 46
            NpcRef.RemoveAllTypedItems Player 1 1 47
            NpcRef.RemoveAllTypedItems Player 1 1 49
            NpcRef.RemoveAllTypedItems Player 1 1 50
        endif
        set NpcRef to Pencil01
        set NpcRef to GetNextRef
        Goto 42
    endif

How do I script in code to only loot items with a value to weight ratio of 10? Could I just insert the following:

 

set invPos to 0
Label 260
set invCount to NpcRef.GetNumItems
if invPos < invCount
set pInvObj to NpcRef.GetInventoryObject invPos
set vFloat to GetValue pInvObj
set wFloat to GetWeight pInvObj
if wFloat == 0
NpcRef.removeitem pInvObj 1
player.additem pInvObj 1 1
elseif vFloat / wFloat >= 10
NpcRef.removeitem pInvObj 1
player.additem pInvObj 1 1
endif
Goto 260
endif

Zero experience with GECK, so any help is much appreciated.

 

Thanks!

 

-Nick

 

 

Link to comment
Share on other sites

This is the code I have now, doesn't work though:

 

 

set NpcRef to GetFirstRef 42 1 0
Label 42
if NpcRef
set checkObj to NpcRef.GetInventoryObject 0
if player.Getdistance NpcRef < 200 && NpcRef.GetDisabled == 0 && NpcRef.GetDead == 1
NpcRef.RemoveAllTypedItems Player 1 1 24
NpcRef.RemoveAllTypedItems Player 1 1 25
;NpcRef.RemoveAllTypedItems Player 1 1 26
NpcRef.RemoveAllTypedItems Player 1 1 29
NpcRef.RemoveAllTypedItems Player 1 1 31
NpcRef.RemoveAllTypedItems Player 1 1 40
NpcRef.RemoveAllTypedItems Player 1 1 41
NpcRef.RemoveAllTypedItems Player 1 1 46
NpcRef.RemoveAllTypedItems Player 1 1 47
NpcRef.RemoveAllTypedItems Player 1 1 49
NpcRef.RemoveAllTypedItems Player 1 1 50
set invPos to 0
Label 260
set invCount to NpcRef.GetNumItems
if invPos < invCount
showmessage TestNick2222
set pInvObj to NpcRef.GetInventoryObject invPos
set listIndex to ListGetFormIndex MagneticPersonalityMiscFormList pInvObj
set vFloat to GetValue pInvObj
set wFloat to GetWeight pInvObj
if wFloat == 0
NpcRef.removeitem pInvObj 1
player.additem pInvObj 1 1
showmessage TestNick1234 wFloat
elseif vFloat / wFloat >= 25
NpcRef.removeitem pInvObj 1
player.additem pInvObj 1 1
set diviRatio to vFloat / wFloat
showmessage TestNick1234 diviRatio
elseif listIndex >= 0
NpcRef.removeitem pInvObj 1
player.additem pInvObj 1 1
showmessage TestNick1234 wFloat
elseif listIndex < 0
set invPos to invPos + 1
endif
Goto 260
endif
endif
set NpcRef to Pencil01
set NpcRef to GetNextRef
Goto 42
endif
"showmessage" identified that nothing is firing after "if invPos < invCount". Help, anyone?
Btw, how do I copy/pase my code while keeping the indentations?

 

Thanks in advance.

 

-Nick

 

 

Edited by nicbizz
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...