Jump to content

Help modify auto-loot addon to loot everything


lasere200

Recommended Posts

AutoLoot Enhanced v0.1

 

There you go. The mod description lists current issues I am trying to solve and I would appreciate any kind of help with those issues. I am really really nubish so don't hold anything back. I just wanted to make the gameplay experience less tedious. Right now it's still picking up a lot of stuff I don't want it to - from containers and corpses as I can't filter that...

Link to comment
Share on other sites

Wow, you have been busy :)

 

for some reason i couldn't use the OR operator for

wFloat == 0 || vFloat / wFloat >= 10

GECK is weird in that both sides are always evaluated, so although you were looking for and caught the zero... GECK decides to commit div-by-zero hari-kari anyway.

 

<STEALING>

i know how to handle the detection but not the ownership stuff. maybe you could point me in the right direction. thanks again

 

Since Volek last updated that, NVSE now has a new GetOwner command. Not sure how it works though.

I'd guess you can just use 'if ref.GetOwner' to see if *any* npc/faction is set as owner. A null ref counts as false.

Might also need to use the vanilla IsCellOwner command. I think unowned items inherit ownership from the cell.

Link to comment
Share on other sites

Yeah the IsOwner is a vanilla function (and not much use). GetOwner was added by NVSE.

Doc at ES Wiki

Not all the OBSE commands have been ported to NVSE. Check the whats_new doc.

 

The Public flag is to do with trespassing, not theft, but...

GetParentCellOwner was added in NVSE v2b1, which is much more useful than the vanilla IsCellOwner.

Link to comment
Share on other sites

Well from what I understand so far I can take items from Public cells and I need to steal them from owned cells. The thing is I want to be able to pick up the items in public cells without any kind of check for being detected. So I need to differentiate between public and owned and they both return 0 on IsOwner. IsOffLimits form OBSE might have helped but it's not available in NVSE. IsTrespassing might help also. I'm gonna look into it. Seems like I won't be able to do it without some kind of list though and I hate those lists.
Link to comment
Share on other sites

So I need to differentiate between public and owned and they both return 0 on IsOwner.

Well, like Tunaisafish pointed out:

 

rRefToLoot.GetOwner

 

returns the owner. If the owner returned is zero, the player, or playerfaction, then you can take it with no worry.

 

I use Getowner in one of my own scripts and it works fine.

Link to comment
Share on other sites

set containerRef to GetFirstRef 27 1 0
Label 27
if containerRef
	if player.Getdistance containerRef < 160 && containerRef.GetDisabled == 0 && containerRef.Getlocked == 0
		set pInvObj to (containerRef.GetInventoryObject 0)
		set parentRef to containerRef.GetParentRef
		set ownerRef to parentRef.GetOwner
		if containerRef.GetOwner == 0 || containerRef.GetOwner == player || containerRef.GetOwner == playerfaction || ownerRef == 0 || ownerRef == player || ownerRef == playerfaction
			containerRef.RemoveAllTypedItems Player 1 1 24
			containerRef.SetDefaultOpen 1
		elseif stealing == 1 && player.IsActorDetected == 0 && pInvObj
			containerRef.RemoveAllTypedItems Player 1 1 24
			containerRef.SetDefaultOpen 1
			rewardKarma -5
		endif
	endif
	set containerRef to Pencil01
	set containerRef to GetNextRef
	Goto 27
endif

 

While it works to get the owner of a container that actually has an owner and it's not inherited I can't seem to get the parent cell owner. I tried both GetParentRef and GetParentCell and it doesn't seem to work. am I being really newb?

Link to comment
Share on other sites

The next version of NVSE actually has GetParentCellOwner. http://forums.bethsoft.com/index.php?/topic/1197681-beta-new-vegas-script-extender-nvse-v2/

 

GetParentREF is referring to the enable parent of an object and doesn't have anything to do with ownership.

 

GetParentCell will return the cell that the object is in, but I don't think GetOwner would work on the returned cell reference, thus the new function in NVSE ver 2

Link to comment
Share on other sites

well i did try getparentcell and it didn't work. i will try to use the nvse beta 2.1b for the getparentcellowner. thanks for the info yet again :)

 

the add-on is comeing along fine... it seems like it's all i do in my free time :) i'm having fun really. now that the stealing mode is there I have one more thing to do

 

some misc items you only want to collect if you're crafting... like egg timers you'd only wanna pick up if you end up making timebombs. so i have a list that overrides the normal misc item filters (the weight =0 and value/weight > 10). i want to be able to enable or disable picking up items like that ingame. i'm thinking i'll make some diffrent lists... so like - explosives list (with lunchboxex, duct tape, egg timers and so on), stimpaks llist (empty syringe, leather belt)i've got an idea on how to do it and I am going to explore it tonight . the problem is i don't want to end up with 9 buttons to toggle stuff on and off so i'm looking to make somewhat of a menu for it. is that peticulary hard?... I have no programming experience whatsoever

Link to comment
Share on other sites

  • Recently Browsing   0 members

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