Page 1 of 1

Red "2" on items on the ground

Posted: Fri Oct 29, 2010 4:33 pm
by greycat
What does the red "2" mean on items that I find on the ground? At first I thought it was a quantity indicator, as in "this is really 2 gems", but upon walking over to the item and picking it up, it was just 1 gem. I get the "2" on items dropped by monsters, and occasionally on items generated on the level, but not on items that I drop, even if they're still unidentified... so apparently it doesn't mean "unidentified" either.

Edit: oh, there are "3"s too!

Image

As it turns out, this was a stack of TWO items (a gem and a scroll). Maybe this is intended to be a "number of items in the pile" indicator, and it has an off-by-one bug?

Re: Red "2" on items on the ground

Posted: Fri Oct 29, 2010 5:08 pm
by darkgod
Ther eprobably was gold inside which got autopickedup

Re: Red "2" on items on the ground

Posted: Fri Oct 29, 2010 5:12 pm
by escargot
Yeh, I noticed too and it was actually gold, if you check the log you'll see the autopicking.
I like the method to show a stack, but I also loved from T2 how after killing a boss or a dragon you'd get tons of items dropped in a 2 tiles radius. Looked magnificent :D

Re: Red "2" on items on the ground

Posted: Sat Oct 30, 2010 12:52 pm
by Shoob
That probably wouldnt be that hard to incorporate in t4, it may need the check free grid modified, but only slightly.

Re: Red "2" on items on the ground

Posted: Sat Oct 30, 2010 6:12 pm
by yufra
If you want to give this a try, open tome/class/Actor.lua and scroll down to the "_M:die" function. Find this line (around line 750 in my copy)...

Code: Select all

						game.level.map:addObject(self.x, self.y, o)
... and replace it with these lines:

Code: Select all

						local drop_x, drop_y = util.findFreeGrid(self.x, self.y, 5, false, {[engine.Map.OBJECT]=true})
						game.level.map:addObject(drop_x, drop_y, o)

Re: Red "2" on items on the ground

Posted: Sat Oct 30, 2010 7:59 pm
by Shoob
the main problem is that some objects may not be placed with that code, especially with bosses. which is why it would need to be tweaked some.

Re: Red "2" on items on the ground

Posted: Sat Oct 30, 2010 8:15 pm
by yufra
Shoob, the resolvers.drops that bosses use just adds the items to the inventory so the above code will correctly drop those items as well (haven't tested it, but the code definitely suggests that).

Re: Red "2" on items on the ground

Posted: Sat Oct 30, 2010 9:12 pm
by darkgod
Not if there are too many objects around :)

Re: Red "2" on items on the ground

Posted: Sat Oct 30, 2010 9:16 pm
by yufra
Mmm, good point.

How about:

Code: Select all

                  local drop_x, drop_y = util.findFreeGrid(self.x, self.y, 5, false, {[engine.Map.OBJECT]=true})
                  drop_x = drop_x or self.x
                  drop_y = drop_y or self.y
                  game.level.map:addObject(drop_x, drop_y, o)