How to get the stacksize? or quanity of a stackable item

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
billy777
Posts: 5
Joined: Mon May 14, 2012 11:40 pm

How to get the stacksize? or quanity of a stackable item

Post 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
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Re: How to get the stacksize? or quanity of a stackable item

Post 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
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: How to get the stacksize? or quanity of a stackable item

Post by petri »

I'll add Item:getStackSize() for the next version.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: How to get the stacksize? or quanity of a stackable item

Post by Neikun »

Good Guy Petri
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
billy777
Posts: 5
Joined: Mon May 14, 2012 11:40 pm

Re: How to get the stacksize? or quanity of a stackable item

Post by billy777 »

I'll add Item:getStackSize() for the next version.
Now thats service... LOL!
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: How to get the stacksize? or quanity of a stackable item

Post by cromcrom »

Yes, it will be very helpfull, no more add one by one stuff on altars ^^ thanks :-)
A trip of a thousand leagues starts with a step.
User avatar
djoldgames
Posts: 107
Joined: Fri Mar 23, 2012 11:28 pm
Contact:

Lock consume all stacked keys

Post 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?
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: How to get the stacksize? or quanity of a stackable item

Post by Neikun »

You could try my double lock custom asset.
But that's only if you need two keys..
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
djoldgames
Posts: 107
Joined: Fri Mar 23, 2012 11:28 pm
Contact:

Re: How to get the stacksize? or quanity of a stackable item

Post 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.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to get the stacksize? or quanity of a stackable item

Post 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
Finished Dungeons - complete mods to play
Post Reply