http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/stacking-items-45226/ --source DigitalDemon Stacking System
can anyone explain in detail to me. I just can't figure it out by myself.
In the same time , I would like to present some modification about the system unstack part done by Digital Demon in tutorial sector.
I think I solve the odd number of charged problem , hopefully
(Charges remaining in (Item carried by Hero[1] in slot (Integer A))) mod 2)
remainder charge = charge mod 2
example
1 = 7 mod 2
0 = 4 mod 2
so you won't loss any charge when you unstack an odd number charged item.
The item such as potion or etc should had their 'item class' set as 'charged' in the object editor if you want to unstack them or you just modify the trigger to suit your taste.
-
(Item being manipulated) Not equal to (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated)))
-
Set Slot = (Integer((Substring((Entered chat string), 10, 10))))

In the same time , I would like to present some modification about the system unstack part done by Digital Demon in tutorial sector.
I think I solve the odd number of charged problem , hopefully

-
Unstack
-
Events
-
Player - Player 1 (Red) types a chat message containing -unstack as A substring
-
-
Conditions
-
Actions
-
Set HeroPos = (Position of Hero[(Player number of (Triggering player))])
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-class of (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A))) Equal to Charged
-
-
Then - Actions
-
Set Charges = ((Charges remaining in (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A))) / 2)
-
Item - Set charges remaining in (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A)) to (Charges + ((Charges remaining in (Item carried by Hero[1] in slot (Integer A))) mod 2))
-
Item - Create (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A))) at HeroPos
-
Item - Set charges remaining in (Last created item) to Charges
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation(udg_HeroPos)
-
-
(Charges remaining in (Item carried by Hero[1] in slot (Integer A))) mod 2)
remainder charge = charge mod 2
example
1 = 7 mod 2
0 = 4 mod 2

The item such as potion or etc should had their 'item class' set as 'charged' in the object editor if you want to unstack them or you just modify the trigger to suit your taste.
Last edited: