About item stacking made by DigitalDemon

zicron

Level 2
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/stacking-items-45226/ --source DigitalDemon Stacking System

• (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))))
what does those two mean ? It seem to be an essential part of the 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
• 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)
The trick is "Math-modulo"
(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.

Last edited:

zicron

Level 2
bump XD
Item being manipulated = pickup item ?
Item carried by (Hero manipulating item) = the hero who pick up the item ?
type (Item-type of (Item being manipulated)) = type of the item that pickup ??

(Item being manipulated) Not equal to (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated)))
Doesn't really understand what is the meaning of this one , how it affect the whole trigger ?

Last edited:

Replies
8
Views
707
Replies
6
Views
807
Replies
1
Views
499
Replies
2
Views
265
Replies
17
Views
20K