Page 1 of 2
How to get the stacksize? or quanity of a stackable item
Posted: Thu Sep 27, 2012 7:59 pm
by billy777
I wanted to check if a certain amount of money has been placed into an alcove - money is totaled as stacksize (i.e. quanity) which can be hundreds or thousands - so they cant do each indivdually.
If they put some money with stacksize of 100 how can i check in standard alcove code...
example...
for i in altar_gold:containedItems() do
if i.name == "dollars" then
quanity = i:getStackSize() -- of course this doesnt work but shown for example
end
end
Re: How to get the stacksize? or quanity of a stackable item
Posted: Thu Sep 27, 2012 8:04 pm
by Shloogorgh
maybe you could use i:getWeight()
and use an equation to figure out the amount of money based on the weight of the stack
Re: How to get the stacksize? or quanity of a stackable item
Posted: Thu Sep 27, 2012 9:20 pm
by petri
I'll add Item:getStackSize() for the next version.
Re: How to get the stacksize? or quanity of a stackable item
Posted: Thu Sep 27, 2012 9:59 pm
by Neikun
Good Guy Petri
Re: How to get the stacksize? or quanity of a stackable item
Posted: Thu Sep 27, 2012 10:49 pm
by billy777
I'll add Item:getStackSize() for the next version.
Now thats service... LOL!
Re: How to get the stacksize? or quanity of a stackable item
Posted: Thu Sep 27, 2012 10:56 pm
by cromcrom
Yes, it will be very helpfull, no more add one by one stuff on altars ^^ thanks
Lock consume all stacked keys
Posted: Fri Sep 28, 2012 12:16 am
by djoldgames
petri wrote:I'll add Item:getStackSize() for the next version.
Great!
And what about "multiconsumable" locks?
If I create stackable keys, there is a little problem in the game - if you use items (keys) stacked together, the lock will consume all of them!
...feature?
Re: How to get the stacksize? or quanity of a stackable item
Posted: Fri Sep 28, 2012 12:24 am
by Neikun
You could try my double lock custom asset.
But that's only if you need two keys..
Re: How to get the stacksize? or quanity of a stackable item
Posted: Fri Sep 28, 2012 11:31 am
by djoldgames
Neikun wrote:You could try my double lock custom asset.
But that's only if you need two keys..
Yes I know of it, thanks. But I thought something else...
Problem is: when we use stacked keys (4 keys together on mousecursor) on One lock, the lock will consume all of them! I need to one lock consumes only one item.
Re: How to get the stacksize? or quanity of a stackable item
Posted: Fri Sep 28, 2012 11:38 am
by Komag
I'm not sure I like the idea of stacked keys, there shouldn't be that many keys around in my opinion, but I guess in certain circumstances it could be alright or make sense