Autopickup stackable items even when not selected


Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.

Temple Termagant

Posts: 14

Joined: Sunday, 29th March 2015, 16:00

Post Sunday, 29th March 2015, 16:07

Autopickup stackable items even when not selected

Especially when playing a char that relies on few ranged weapons for special situations - say, one that carries curare needles and tomahawks of dispersal only -, it is very annoying that one cannot select which egos should be picked up precisely. However, since there is no more weight limit, situations like this can easily be made less annoying if stackable items are autopicked even when they're not selected as such, but currently in inventory. I already implemented this in Lua for myself, and it's made ranged combat much more comfortable to manage. I'm not sure if it makes sense to extend this to potions and such, but then again, the only drawback is a few lost turns, and those who go for speed records likely use auto-anything functions much less in the first place.

For this message the author PAnacea has received thanks: 5
Arrhythmia, chequers, duvessa, Hurkyl, nago

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Sunday, 29th March 2015, 17:14

Re: Autopickup stackable items even when not selected

I'm sure people would like and use a LUA version of this, if you care to post it.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

For this message the author Siegurt has received thanks:
nago

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Sunday, 29th March 2015, 17:40

Re: Autopickup stackable items even when not selected

PAnacea: This is a really good idea and should come with the game (i.e. as default)!

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Sunday, 29th March 2015, 17:44

Re: Autopickup stackable items even when not selected

Yes, it's been brought up before, I think the response then was "Yeah, this is a good idea, now someone needs to go do it"
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

Dungeon Master

Posts: 1613

Joined: Thursday, 16th December 2010, 21:54

Post Sunday, 29th March 2015, 17:55

Re: Autopickup stackable items even when not selected

This is already built in for potions and scrolls (except it wasn't working, but now it is), extending it to branded ammo sounds good too.

For this message the author Kate has received thanks:
dpeg

Tartarus Sorceror

Posts: 1774

Joined: Tuesday, 23rd December 2014, 23:39

Post Sunday, 29th March 2015, 18:23

Re: Autopickup stackable items even when not selected

I would also like not to pick up items that I've already dropped. That is, if I drop a stack of enchant weapon scrolls, I would like to have it disable enchant weapon scrolls from autopickup without having to do that manually.
streaks: 5 fifteen rune octopodes. 15 diverse chars. 13 random chars. 24 NaWn^gozag.
251 total wins Berder hyperborean + misc
83/108 recent wins (76%)
guides: safe tactics value of ac/ev/sh forum toxicity

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Sunday, 29th March 2015, 20:01

Re: Autopickup stackable items even when not selected

Berder: That sounds reasonable, too. I wonder if that should always work, or be an option...

Temple Termagant

Posts: 14

Joined: Sunday, 29th March 2015, 16:00

Post Sunday, 29th March 2015, 20:07

Re: Autopickup stackable items even when not selected

Siegurt: No problem, not exactly pretty though. It'd be nice if there was a "stackable" flag and a way to get the basename (i. e. "23 needles of confusion" -> "needle of confusion"), that way it could be applied to all of the inventory dynamically. If I ever get into development, extending the CLua is probably where I'll start :P

  Code:
function ready()
      missiles_have = {["bolt"]={},["arrow"]={},["sling bullet"]={},["needle"]={},["stone"]={},["large rock"]={},["throwing net"]={},["tomahawk"]={},["javelin"]={}}
      for it in iter.invent_iterator:new(items.inventory()) do
         if it.class(true) == "missile" then
            missiles_have[it.subtype(true)][tostring(it.ego(true))] = true
         end
      end
end

add_autopickup_func(function(it, name)
      if it.class(true) == "missile" then
         return missiles_have[it.subtype(true)][tostring(it.ego(true))]
      end
end)


You can do a lot of things in the rcfile, I'm just always careful I'm not taxing the server too much... for instance, scanning the inventory in every ready() - is that bad? There aren't any documents that tell you about the constraints. Which is why I'd prefer if something that universally useful would be implemented by someone who knows what they're doing, I keep crashing my webtiles server games and feel bad about it.

Edit: I forgot to mention, ammo may not be set to overriden in the known items dialog for that system to work! (White text.) In that case, the autopickup function is never called, it's just true or false depending on settings for all items of a subtype.

Edit2: Also, there's currently a bug where the game returns it.ego() = nil for some ammo. It's already been fixed in git and should be rolled out soon, until then the script things those are unbranded arrows.

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Sunday, 29th March 2015, 21:40

Re: Autopickup stackable items even when not selected

A few times i've ended up with too many items at the end of a portal vault and wished I had left, say, 200 plain arrows outside while keeping 200 in my inventory, so I can drop the ones in my inventory to carry something important out (like cure mutation.) Sometimes having all of something in my inventory is not the best.

I can usually think through this before entering a portal, but sometimes there is pressure to enter quickly.

Return to Game Design Discussion

Who is online

Users browsing this forum: No registered users and 106 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.