How to send command do stack item on create

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
xcpustyle
New User
Posts: 17
Joined: Fri Apr 27, 2012 5:55 pm

How to send command do stack item on create

Post 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!
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: How to send command do stack item on create

Post 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.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: How to send command do stack item on create

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: How to send command do stack item on create

Post by xeon »

It would be nice if CreateItem*() have an optional "struct CProps{}" parameter, to avoid inadvertently stacking different item with same base graphic
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: How to send command do stack item on create

Post 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!
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: How to send command do stack item on create

Post 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 )
xcpustyle
New User
Posts: 17
Joined: Fri Apr 27, 2012 5:55 pm

Re: How to send command do stack item on create

Post 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?
Post Reply