Proposed feedback for multiple objects in a single tile

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Proposed feedback for multiple objects in a single tile

#1 Post 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?
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Proposed feedback for multiple objects in a single tile

#2 Post by darkgod »

Good idea!
Done!

Modules can activate it by simply doing:

Code: Select all

Map.object_stack_count = true
in their setupDisplayMode()
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Proposed feedback for multiple objects in a single tile

#3 Post 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.
<DarkGod> lets say it's intended

Post Reply