Item drop replase and put it in a Inventory box

Lord Regno

Active Member
Reaction score
19
Hi everyone I have an trigger that I want to work this way: If the player put a item in the Inventory box it will be replaced and putted in the box, but if the player put it on the ground it will be replaced and putted there.

I have sitting the hole day yesterday and today to fix the item stacking system error. Then you buy an item and the "stack item are placed on the right side of the bought item will lose the one that you have bought and the "stack item" doesn't stack that time. I have fixed that so now I got brain drop on triggers so I can't solve this easy part, that is the last part of the item stack trigger.

Well here are my trigger, now it just replace the item and put it on the ground even if I put it in the box:

Trigger:
  • Ice Armor Drop 2
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ice Armor
    • Actions
      • Set Temp_Group = (Units owned by (Owner of (Hero manipulating item)) of type Inventory)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Picked unit) of type Ice Armor)) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Item - Create Ice Armor 3 at (Position of (Hero manipulating item))
              • Item - Set charges remaining in (Last created item) to (Charges remaining in (Item being manipulated))
              • Item - Remove (Item being manipulated)
              • Item - Remove (Last created item) <- I discovered a strange thing if I do not have this action here then the trigger will crate two items instead of one...
              • Set armor = (Playable map area)
              • Item - Pick every item in armor and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Picked item)) Equal to Ice Armor 3
                    • Then - Actions
                      • Hero - Give (Picked item) to (Picked unit)
                    • Else - Actions
            • Else - Actions
              • Item - Create Ice Armor 3 at ((Position of (Hero manipulating item)) offset by 90.00 towards (Facing of (Hero manipulating item)) degrees)
              • Item - Set charges remaining in (Last created item) to (Charges remaining in (Item being manipulated))
              • Item - Remove (Item being manipulated)
              • Item - Remove (Last created item)
      • Custom script: call DestroyGroup(udg_Temp_Group)


EDIT: An if els then action got removed...
EDIT2: I really got brain drop it was right, I think
 

TheOverWhelm

Member
Reaction score
16
Why are you set armor = playable map area?
That'll overwrite rects and leak, I believe.
And what you're doing makes no sense to me.

So when you drop an item in RECT, it'll move to UNIT BOX?
But why "Ice Armor 3"?
 

Lord Regno

Active Member
Reaction score
19
Why I use armor is that I want it to pick Ice armor 3 and put it in the box. And no its don't leaks, that I had asked in another thread if it did.

EDIT: Or do you mean that you cant have a pick action in the pick action?

This trigger are just one of 3 and I need 2 items (but I using 3 items to be on the safe side) to fix the "stack item" error. This trigger is an part of the second trigger thats using Ice Armor 3 to stack into Ice Armor 1.

This I trying to do: If you put item 1 in the box the item 3 will be added to the box. But if you put the item 1 on the ground item 3 will get putted on the ground as well.
 

Lord Regno

Active Member
Reaction score
19
Yes, well I think I post the 3 triggers here instead so you can see the whole system:

EDIT: It's based on a 3 upgrade item system to, Ice Armor -> Harder Ice Armor -> Magic Ice Armor

Trigger:
  • Ice Armor
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ice Armor 2
    • Actions
      • Set temp_item = Ice Armor
      • Set temp_item_2 = Ice Armor 2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item)) Greater than or equal to 1
        • Then - Actions
          • 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-type of (Item being manipulated)) Equal to temp_item_2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Charges remaining in (Item carried by (Hero manipulating item) of type temp_item)) + (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_2))) Less than 4
                    • Then - Actions
                      • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type temp_item) to ((Charges remaining in (Item carried by (Hero manipulating item) of type temp_item)) + (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_2)))
                      • Unit - Set level of Item Armor Bonus (Ice Armour) for (Hero manipulating item) to (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item))
                      • Item - Remove (Item being manipulated)
                    • Else - Actions
                      • Item - Remove (Item carried by (Hero manipulating item) of type temp_item)
                      • Item - Remove (Item carried by (Hero manipulating item) of type temp_item_2)
                      • Hero - Create Harder Ice Armor 2 and give it to (Hero manipulating item)
                • Else - Actions
        • Else - Actions
          • Item - Remove (Item being manipulated)
          • Hero - Create temp_item and give it to (Hero manipulating item)


Trigger:
  • Ice Armor Drop
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ice Armor 3
    • Actions
      • Set temp_item_drop[1] = Ice Armor
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1])) Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1]) to ((Charges remaining in (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated)))) + (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1])))
              • Item - Remove (Item being manipulated)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1])) Greater than or equal to 4
                • Then - Actions
                  • Hero - Create Harder Ice Armor 2 and give it to (Hero manipulating item)
                  • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1]) to ((Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1])) - 4)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1])) Equal to 0
                    • Then - Actions
                      • Item - Remove (Item carried by (Hero manipulating item) of type temp_item_drop[1])
                    • Else - Actions
                • Else - Actions
        • Else - Actions
          • Set armor_int = (Charges remaining in (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated))))
          • Item - Remove (Item being manipulated)
          • Hero - Create temp_item_drop[1] and give it to (Hero manipulating item)
          • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type temp_item_drop[1]) to armor_int
      • Unit - Set level of Item Armor Bonus (Ice Armour) for (Hero manipulating item) to (Charges remaining in (Item carried by (Hero manipulating item) of type Ice Armor))


Trigger:
  • Ice Armor Drop 2
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ice Armor
    • Actions
      • Set Temp_Group = (Units owned by (Owner of (Hero manipulating item)) of type Inventory)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Picked unit) of type Ice Armor)) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Item - Create Ice Armor 3 at (Position of (Hero manipulating item))
              • Item - Set charges remaining in (Last created item) to (Charges remaining in (Item being manipulated))
              • Item - Remove (Item being manipulated)
              • Item - Remove (Last created item)
              • Set armor = (Playable map area)
              • Item - Pick every item in armor and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Picked item)) Equal to Ice Armor 3
                    • Then - Actions
                      • Hero - Give (Picked item) to (Picked unit)
                    • Else - Actions
            • Else - Actions
              • Item - Create Ice Armor 3 at ((Position of (Hero manipulating item)) offset by 90.00 towards (Facing of (Hero manipulating item)) degrees)
              • Item - Set charges remaining in (Last created item) to (Charges remaining in (Item being manipulated))
              • Item - Remove (Item being manipulated)
              • Item - Remove (Last created item)
      • Custom script: call DestroyGroup(udg_Temp_Group)
 

TheOverWhelm

Member
Reaction score
16
Immediately I would assume it'd be that remove last created item.
Whats actually happening that shouldn't be the end result?
 

Lord Regno

Active Member
Reaction score
19
Well if I don't have remove last created item it will spawn 2 items on the ground instead of one... thats is strange.

EDIT: Even if I put it in the box it will drop it on the ground and not in the box.
 

TheOverWhelm

Member
Reaction score
16
I don't think those conditions really work, but -shrug- Looks like you're picking every unit and whenever it's not carried by a unit it does that Else.
I feel like the triggers are overcomplicated for a supposed simple thing.

Unit Loses Item
Item being Manipulated==This
If Item in Rect then
---Create item2
---SetCharges in Item2 to Charged in Item1
---remove Item Being Manipulated
endif
Pick all units in Rect
---If Unit Owns Item then
------Create Item2
------Set Charges in Item2 to Charges in Item1
------Remove Item1
------Give Hero Item2
---Endif
Endpick
 

Lord Regno

Active Member
Reaction score
19
This condition doesn't work:

Trigger:
  • Item-type of (Item carried by (Picked unit) of type Ice Armor)) Equal to (Item-type of (Item being manipulated))


And going to bed see ya tomorrow.
 

TheOverWhelm

Member
Reaction score
16
Next best thing for that is do a Loop 1 to 6 right before it that checks the slot status to see if the slot has that item and if it's equal to Item being Manipulated. This'd effect every item of that time he's carrying, btw.
Unless I forgot something, which is possible.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top