ID:175740
 
This is for Simant Byond. Is is possible to group a bunch of items together. Like a bunch of food. If there are 8 food objects all stacked on to one tile, is there a way to make is to it looks like a pile of 8? Is there a way to identify how many food objects are on a tile in a procedure, and then maybe change icon_states accordingly to make it look like a pile? I don't know where to begin on this...

-Dagolar
I know this is possible, because I have seen this happen in Incursion with troops.

I am not sure as to how I would go about it, but I am sure Lummox would be willing to help you out.

As for the stacking, Lummox does this with his units and resources in Incursion. If you have ever played Incursion, you would understand where I am coming from, whereas if you haven't, you may not get me.

Say you have 3 units, the image displays three units and in the description, it tells you how many units you have on one island with an image of the amount of units.

Say you had 5 units, instead of displaying 5 units, the icon_state changes to a horse, although at first sight I thought it was a dog, though Lummox corrected me ^_^

Anyway, as you can see, I am not all that good at describing what you need. Lummox on the other hand, or anyone else for that matter maybe better than myself. Though, I do suggest asking Lummox about this, considering I know from first hand experience he uses something similar to what you need, as he told me he changes icon_states dependant on unit sizes and resource sizes in-game, per player.

Bah! I am struggling and babbling now, ask Lummox :P

--Lee
In response to Mellifluous
I've played incursion a few times, and you understand what I'm talking about, and I understand what you're talking about. I just need to know how to identify icon_states on a tile...

-Dagolar
In response to Dagolar
Okies, glad you understand me ^_^

I would say that from off the top of my head, Lummox is the one to ask, but then again, other people may know.

As for me, I am sorry I cannot help.

--Lee
obj
Food
Move(newLoc)
var/obj/Food/F = locate() in newLoc
if(F)
if(text2num(F.icon_state) < 8)
F.icon_state = "[text2num(F.icon_state)+1]"
del(src)
. = ..()
In response to Garthor
Okay I tried implementing that, but there is no initial icon_state. When I make a starting icon_state, named "FoodL", it doesn't change anything when the food items stack, because I then have icon_states named "FoodL2", "FoodL3", and so on. Catch 22 in the works here. ;[

-Dagolar
In response to Dagolar
F.icon_state = "FoodL[text2num(F.icon_state)+1]"