How Do I Make One Item from Multiple of the Same Item?

BarzahdX

Active Member
Reaction score
18
I searched for a similar question but to no avail, I found an answer to my problem long ago, but it only regarded a copy of the item, no more than 2. I forgot to log the page and I can't seem to relocate it. Now I'm sure there's only a little tweaking that needs to be done to get this to work, but just can't seem to get it, and I don't want to be up all night.

Here's my current trigger that properly fuses 2 Boots of Speed into 1 Pegasus Shoes. I want(as a hypothetical example) a trigger that fuses 4 Boots of Speed into 1 Pegasus Shoes. Please help.

Trigger:
  • Pegasus Shoes
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Count[1] = 0
      • 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
              • Count[1] Equal to 0
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Boots of Speed
            • Then - Actions
              • Set Count[1] = (Count[1] + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Count[1] Equal to 1
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Boots of Speed
                  • ((Hero manipulating item) has an item of type Pegasus Shoes(Recipe)) Equal to True
                • Then - Actions
                  • Set Count[1] = -1
                  • Set Caster_Position[2] = (Position of (Hero manipulating item))
                  • Item - Remove (Item carried by (Hero manipulating item) of type Boots of Speed)
                  • Wait 0.00 seconds
                  • Item - Remove (Item carried by (Hero manipulating item) of type Boots of Speed)
                  • Item - Remove (Item carried by (Hero manipulating item) of type Pegasus Shoes(Recipe))
                  • Item - Create Pegasus Shoes at Caster_Position[2]
                  • Hero - Give (Last created item) to (Hero manipulating item)
                  • Custom script: call RemoveLocation (udg_Caster_Position[2])
                • Else - Actions
 

Bankde

Member
Reaction score
20
Here the trigger (Your trigger doesn't work because you mess up your condition)

Trigger:
  • Item Mix
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Count = 0
      • 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 carried by (Triggering unit) in slot (Integer A))) Equal to Boots of Speed
            • Then - Actions
              • Set Count = (Count + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count Greater than or equal to 4
        • Then - Actions
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Boots of Speed)
          • Set TempPoint = (Position of (Triggering unit))
          • Item - Create Pegasus Shoes at TempPoint
          • Hero - Give (Last created item) to (Triggering unit)
          • Custom script: call RemoveLocation (udg_TempPoint)
        • Else - Actions
 

ultimate11

Active Member
Reaction score
25
Trigger:
  • Item Mix
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item carried by (Triggering unit))) Equal to Boots of Speed
    • Actions
      • Set Count = 0
      • 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 carried by (Triggering unit) in slot (Integer A))) Equal to Boots of Speed
            • Then - Actions
              • Set Count = (Count + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count Greater than or equal to 4
        • Then - Actions
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Boots of Speed)
          • Set TempPoint = (Position of (Triggering unit))
          • Item - Create Pegasus Shoes at TempPoint
          • Hero - Give (Last created item) to (Triggering unit)
          • Custom script: call RemoveLocation (udg_TempPoint)
        • Else - Actions
          • Set Count = 0


I think it's better like this.Is more safe to clear your variable again in case if dont mach conditions.I had used a trigger like this in the past.And use first condition to prevent starting trigger over and over you aquire an item.
 

Bankde

Member
Reaction score
20
I'm think reset variable is useless because this trigger don't have "Wait" and there is no need to reset Count = 0 as if new trigger run, it will be the same "0". Or if you want to be really really sure, use local variable.

And Yep, I forget to add condition :)
 

BarzahdX

Active Member
Reaction score
18
Thank you both for the help, but I actually solved it myself shortly after posting this--sorry for wasting your time. I'll +rep.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top