Page 1 of 1

Proposed feedback for multiple objects in a single tile

Posted: Fri Oct 01, 2010 5:31 pm
by yufra
I will lead off with a potential (ie. not confirmed) bug. The getObjectTotal function in engine.Map is currently checking for "self(x, y, i)", and if "i" is starting at one then this will actually be checking the terrain and piles of objects will actually only decay the first object in the pile. The following change (using getObject instead of call) should fix that:

Code: Select all

function _M:getObjectTotal(x, y)
	-- Compute the map stack position
	local i = 1
	while self:getObject(x, y, i) do i = i + 1 end
	return i - 1
end
This leads me into my development suggestion. I find it frustrating to only realize there is a pile of objects when I physically stand on it. I was thinking about having some sort of visual feedback on the map to identify multiple objects within a tile. The current idea I had was to modify the "if o then" section in engine.Map:updateMap and add another MO with say the number of objects in the tile to the top left corner of the tile.

Code: Select all

	if o then
		o:getMapObjects(self.tiles, mos, 7)
		if self:getObjectTotal(x, y) > 1 then
		    -- Add an additional MO, but I have no idea how to :-D
		end
		mm = mm + MM_OBJECT
	end
Thoughts?

Re: Proposed feedback for multiple objects in a single tile

Posted: Wed Oct 06, 2010 10:12 pm
by darkgod
Good idea!
Done!

Modules can activate it by simply doing:

Code: Select all

Map.object_stack_count = true
in their setupDisplayMode()

Re: Proposed feedback for multiple objects in a single tile

Posted: Wed Oct 06, 2010 11:09 pm
by yufra
I like it! One question and one request. The question is if the call to the local Map variable in the setupDisplay function will cause issues on saving/loading? I cannot remember the intricacies of this problem. The request is for the tooltips of each item to appear. I cannot find where the tooltips are actually coded, and can imagine all sorts of problems with large stacks of object but thought I would suggest it for some thought.