Page 1 of 1

How to send command do stack item on create

Posted: Sat Oct 05, 2013 6:52 am
by xcpustyle
Hello guys, how are you?

When i us ealchemy to create potions, they create in my backpack but not stacked, it is created one by one side a side, i want send a command in script do stack with others the same graphic and stack that.

How can i do that?

Thank you all!

Re: How to send command do stack item on create

Posted: Sat Oct 05, 2013 3:06 pm
by Tomi
What UO Client version are you using ? because the old clients doesnt have potions as stackable
What PolCore version are you using 097, 098, 099 ?

There is the function CreateItemInInventory that force stack everything for you that is non-stackable but it could bring up more problems than good things if used wrong.

Re: How to send command do stack item on create

Posted: Sun Oct 06, 2013 4:48 am
by Yukiko
In the original Distro (pre-POL 0.96) the potions weren't stackable because they used a non-stackable graphic. With the introduction of the POL 0.99 "Distro" the graphic for potions is stackable because those scripts were based on a shard that used the empty bottle graphic for potions. You can use the graphic for an empty bottle for your potions to resolve this but you'll have to colour the bottles according to the potions' proper colour, ie. yellow for heals, orange for cures etc. I know the World of Dreams "Distro" used that method and many shards are based on that set of scripts.

Re: How to send command do stack item on create

Posted: Sun Oct 06, 2013 11:21 am
by xeon
It would be nice if CreateItem*() have an optional "struct CProps{}" parameter, to avoid inadvertently stacking different item with same base graphic

Re: How to send command do stack item on create

Posted: Sun Oct 06, 2013 11:05 pm
by Yukiko
That's odd. I know you can't manually drop a stackable item on another of the same graphic if there are any differences, ie. colour, name, different CProps. I wasn't aware that if you CreateItem that was stackable that it will drop that item on top of another of the same graphic ignoring the pre-existing item's differences. That sounds like a bug to me!

Re: How to send command do stack item on create

Posted: Mon Oct 07, 2013 4:04 am
by Tomi
In the original Distro (pre-POL 0.96) the potions weren't stackable because they used a non-stackable graphic. With the introduction of the POL 0.99 "Distro" the graphic for potions is stackable because those scripts were based on a shard that used the empty bottle graphic for potions. You can use the graphic for an empty bottle for your potions to resolve this but you'll have to colour the bottles according to the potions' proper colour, ie. yellow for heals, orange for cures etc. I know the World of Dreams "Distro" used that method and many shards are based on that set of scripts.
I dont remember exactly when bottles ( potions ) were changed to be stackable on clientside, but before that change many people used either the way Yukiko mentioned or edited their tiledatas to stack the potions.

With newer clients the potions are automatically stackable so having all potions as "empty potion" graphic just with different colors are useless for this.

As I mentioned the function CreateItemInInventory that force stacks items, it should only be used when filling up a merchants sale container to show the items correctly in shop gumps ( otherwise it may bring up alot of problems )

About Cprops, items does not stack if they have different props ( only way around this is with the StackingIgnoreProps option )

Re: How to send command do stack item on create

Posted: Mon Oct 07, 2013 6:47 am
by xcpustyle
I'm using Distro 099,

The potions are stackable, if i drop in other potion, they stack. Only when mage craft with alchemy, it does not stack, but if i get the created potion and drops into other potion at the same gaphic it's does.

There is a command to stack, all itens at the same graphic on character backpack? Or stack only itens choosed by me on script file?