Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004014 [DCSS] Patches feature N/A 2011-05-19 06:57 2014-05-04 16:58
Reporter rriegs View Status public  
Assigned To MarvinPA
Priority normal Resolution done  
Status resolved   Product Branch 0.9 ancient branch
Summary 0004014: Introducing egopickup.lua, a handy autopickup extension
Description egopickup.lua adds four in-game and init.txt customizable behaviors:

- egopickup_everything = (true | false | ego) ((default false))
- egopickup_weapons = (true | false | ego) ((default false))
- egopickup_my_ammo = (true | false | ego) ((default true))
- egopickup_my_gear = (true | false | ego) ((default ego))

Each of these has an associated macroable function ===toggle_egopickup_<foo>, which cycles through the available options. Just stick egopickup.lua in with your other Lua files (e.g. runrest.lua) and add lua_file = lua/egopickup.lua to your init.txt.

In short, setting egopickup_<foo> to true instructs autopickup to pick up all items described by <foo> while setting it to ego instead just picks up all ego/artefact items in the described class.

Accordingly, egopickup_everything = true picks up everything (except for carrion), while egopickup_everything = ego picks up all ego items. This option, in conjunction with it's macroable toggle, would allow a Nemelexite to explore without clogging up his or her inventory and then automatically gather up any found valuable items once the coast is clear. egopickup_weapons is similar, but designed for followers of Elyvilon and picks up all weapons, missiles, and staves (which are always considered ego).

egopickup_my_ammo and egopickup_my_gear are a bit more interesting in that they automatically assess what kinds of ammo/equipment is useful for your character. egopickup_my_ammo seeks out missiles and throwable weapons used by your chosen ranged skills. Similarly, egopickup_my_gear gathers skill-appropriate melee weapons and launchers, and also picks up armour and shields similar in terms of "heaviness" to the equipment that you're wearing.

Let me know if this add-on is useful to you and if there are any ways I can improve it with the aim of including it in the general release. Feedback is much appreciated!
Additional Information
Tags No tags attached.
Attached Files ? file icon egopickup.lua [^] (10,423 bytes) 2011-05-19 06:57
? file icon egopickup2.lua [^] (12,619 bytes) 2011-05-26 19:49

- Relationships

-  Notes
galehar (administrator)
2011-05-19 10:32

my_ammo and my_gear do seem useful, but I'm not sure about the ones for Nemelex and Elyvilon. What's the point of picking them up? Why not just sacrifice them?
rriegs (reporter)
2011-05-19 22:30

The aim of the Nemelex/Elyvilon options is to get autoexplore to navigate to the items you might want to sacrifice, rather than you having to poke around in the level map or the Ctrl-F interface to autotravel to their positions. I find these alternatives a bit cumbersome, though of course that is a personal preference. Before writing this script, I'd edit the autopickup string in init.txt to seek out sacrificable items when playing various worshipers. I agree that actually picking the item up is a waste of time.

Heh, I've just now discovered this macro trick:


This serves essentially the same purpose as egopickup_weapons = true, and does indeed stop upon reaching the item. With a bit more hacking on the Ctrl-F search string and the help of stash.lua, you can recover egopickup_weapons = ego, too, but this makes for a heinously ugly macro. Plus, if you don't find anything, unintended behavior may result.

Anyway, for the sake of code simplicity, I wouldn't mind axing egopickup_everything and _weapons and instead focusing on refining _my_ammo and _my_gear.
rriegs (reporter)
2011-05-26 20:16
edited on: 2011-05-26 20:24

I've added a revised egopickup.lua (egopickup2.lua) which makes several changes:

- I removed the _everything and _weapons options, as these were a bit awkward even for their targeted users (Nemelexites and worshipers of Elyvilon).

- I've disabled the macro toggles as these were too cumbersome to use in practice. Left are the init.txt configurations, which have been adjusted to better meet user's long-term play styles. (See below.)

- egopickup_my_gear has been split into egopickup_my_weapons, _my_armour, and _my_shields for more precise control over what kinds of items to gather. These still seek out skill-appropriate weapons and armour of similar weight class to what you're wearing.

- I've added egopickup_alt_armour = (true | false | ego), which gathers all forms of armour other than body armour. Note that the default autopickup exception useless_item prevents this from picking up armour you can't use.

- I've added egopickup_throwable_weapons, _snakable_weapons, and _sandblast_weapons, which are comma-separates lists of the form:

egopickup_throwable_weapons = dagger:ego, spear:ego, dart, javelin, stone, net

  The ":ego" affix restricts autopickup to seek only ego items matching the listed name; otherwise autopickup gathers all such items. The item name supports regular expressions. Each of these egopickup options only trigger if you have the Throwing skill or know the appropriate spells.

Edit: egopickup_snakable_weapons defaults to "club, spear, blowgun, arrows" because these are light, and egopickup_sandblast_weapons picks up stones and large rocks (if you can wield them). I admit, _sandblast_weapons being a list is a bit overkill, but it's consistent with the other skill/spell specific options and has room to grow, if ever more stone-hewn items are added to the game.

ledtim (reporter)
2011-05-31 22:15

You may or may not find the labelling/autopickup scheme I posted at [^] useful.
MarvinPA (developer)
2014-05-04 16:58
edited on: 2014-05-04 16:58

Bits of this are now handled by options like auto_sacrifice, and the built-in autopickup menu. advanced_optioneering.txt also has some Lua for armour pickup which could possibly be extended, perhaps from Medar's changes: [^]

- Issue History
Date Modified Username Field Change
2011-05-19 06:57 rriegs New Issue
2011-05-19 06:57 rriegs File Added: egopickup.lua
2011-05-19 10:32 galehar Note Added: 0013140
2011-05-19 22:30 rriegs Note Added: 0013155
2011-05-26 19:49 rriegs File Added: egopickup2.lua
2011-05-26 20:16 rriegs Note Added: 0013280
2011-05-26 20:24 rriegs Note Edited: 0013280
2011-05-27 12:28 MarvinPA Issue Monitored: MarvinPA
2011-05-31 22:15 ledtim Note Added: 0013340
2013-01-17 20:10 MarvinPA Issue End Monitor: MarvinPA
2014-05-04 16:58 MarvinPA Note Added: 0026042
2014-05-04 16:58 MarvinPA Status new => resolved
2014-05-04 16:58 MarvinPA Fixed in Branch => 0.15 development branch
2014-05-04 16:58 MarvinPA Resolution open => done
2014-05-04 16:58 MarvinPA Assigned To => MarvinPA
2014-05-04 16:58 MarvinPA Note Edited: 0026042
2014-05-04 16:58 MarvinPA Note Edited: 0026042

Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker