System Item Stacking

Discussion in 'Systems and Snippets' started by SFilip, Aug 28, 2006.

  1. lindenkron

    lindenkron You can change this now in User CP

    Ratings:
    +102 / 0 / -0
    Something delusional most have been going on when i first tested this system.

    Im pretty sure it did;
    Right click an item, click a new slot --> Moves 1 item from the old stack to the new slot, and removes 1 item from the old stack, or when you doubble rightclick it creates a new item in the slot next to. I would really like to avoid any "item dropping" :)

    Now people are saying its SUPPOSE to drop one item on the ground ? Not what i recall it did when i first tested it :nuts:.

    Anyway, would there be anyway to change what you made here, to what i wrote above? :)

    Thanks
    -Lindenkron
     
  2. SFilip

    SFilip Gone but not forgotten

    Ratings:
    +634 / 0 / -0
    Try this.
    Trigger:
    • Split
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • Custom script: set udg_order = GetIssuedOrderId()
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • order Greater than or equal to 852002
            • order Less than or equal to 852007
            • (Target item of issued order) Equal to (Item carried by (Ordered unit) in slot (order - 852001))
            • (Charges remaining in (Target item of issued order)) Greater than 1
          • Then - Actions
            • Item - Set charges remaining in (Target item of issued order) to ((Charges remaining in (Target item of issued order)) - 1)
            • Trigger - Turn off Acquire <gen>
            • Hero - Create (Item-type of (Target item of issued order)) and give it to (Ordered unit)
            • Trigger - Turn on Acquire <gen>
            • Item - Set charges remaining in (Last created item) to 1
          • Else - Actions

    When you double right-click on an item, 1 charge will be split and given to the Hero if he has free slots, otherwise dropped on the ground.

    Here's a trigger for merging those items back:
    Trigger:
    • Merge
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • Custom script: set udg_order = GetIssuedOrderId()
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • order Greater than or equal to 852002
            • order Less than or equal to 852007
            • (Target item of issued order) Not equal to (Item carried by (Ordered unit) in slot (order - 852001))
            • (Item-type of (Target item of issued order)) Equal to (Item-type of (Item carried by (Ordered unit) in slot (order - 852001)))
          • Then - Actions
            • Item - Set charges remaining in (Target item of issued order) to ((Charges remaining in (Target item of issued order)) + (Charges remaining in (Item carried by (Ordered unit) in slot (order - 852001))))
            • Item - Remove (Item carried by (Ordered unit) in slot (order - 852001))
          • Else - Actions

    If you drop one item of the same type over another, they will merge.
     
    • Like Like x 1
  3. lindenkron

    lindenkron You can change this now in User CP

    Ratings:
    +102 / 0 / -0
    Worked like a charm, thanks. +Rep :)
     
  4. Dangerb0y

    Dangerb0y New Member

    Ratings:
    +0 / 0 / -0
  5. Narks

    Narks Vastly intelligent whale-like being from the stars

    Ratings:
    +92 / 0 / -0
    its lulzy comparing old systems to new ones

    also necro
     
  6. icepig01

    icepig01 Member

    Ratings:
    +4 / 0 / -0
    Suitable for 'stackable-potions'?
     
  7. leon0007

    leon0007 New Member

    Ratings:
    +0 / 0 / -0
    Thank for your:) tutorial map
     
  8. SanKakU

    SanKakU Member

    Ratings:
    +21 / 0 / -0
    i saw a system like that which i used for my item stacking. you might want to check out my thread, too.

    http://www.thehelper.net/forums/showthread.php?t=148590

    there it is. that might help some.
     

Share This Page