Jump to content

Trying to convert a auto-harvesting script from Oblivion


LilJaguar

Recommended Posts

Hiya. Ive been trying to convert "fast arrow collection" script from Oblivion to use in FO3 for collecting junk (misc items), since I find it very irritating to collect cans, pencils, eg individually. I know that this may seem menial, but i figure it doesn't detrimentally affect the game too much and I'm anal enough that I at least start off the game collecting everything I can.

 

 

anyway, the script, modified from the one written by Frankie_Mac, is as follows, and linked to an ability:

 

 

 

SCN LootEzyScript

ref arrow

 

begin ScriptEffectUpdate

 

set arrow to Apple

set arrow to (GetFirstRef 31 0) ; scans current cell only for ref's of type = Misc

if arrow ; make sure we have an actual ref

if arrow.GetDistance player < 512 ; only pick up close objects

if arrow.IsOwner ; don't automatically steal

arrow.activate player

endif

endif

endif

 

Label 1

if arrow ; repeat above steps for all other ammo references

set arrow to Apple

set arrow to GetNextRef

if arrow

if arrow.GetDistance player < 512

if arrow.IsOwner

arrow.activate player

endif

endif

endif

goto 1

endif

 

end

 

 

 

Odd thing is, when you get near a tin can, you die. Anyone able to help me get why, or fix this?

 

Thanks.

Link to comment
Share on other sites

Sloppy coding. I'd personally use a quest script and do it more like:

 

scn LootQuestScript

; requires FOSE!
; http://fose.silverlock.org/

ref target

begin GameMode
  ; iterate through current cell for Misc object refs
set target to GetFirstRef 31 0 0
Label 10

if target
	if target.GetDistance player < 512
	   ; this checks if the player is the owner (i.e. not owned)
		if target.IsOwner
		   ; pick up object
			target.activate player
		endif
	endif
	set target to GetNextRef
	Goto 10
endif
end

Link to comment
Share on other sites

Hmmm... interesting. I'll give this a shot and see what happens. I know that the old code lacked elegance... but I don't know why it failed when it works fine in Oblivion.

 

Anyway, I'll give it a shot and see.

 

Thanks for your advice.

Link to comment
Share on other sites

*sigh*

 

Ok, I tried it and it actually did nothing - which doubtless means I've missed something in implementing quest scripts. gsmanners, did you manage to get this script functioning, or was it hypothetical? btw I tried it as an effect script, and it killed the player as happened in my original efforts, so the scripts are basically equivalent... I just can't get them to work. :wacko:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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