• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Item Creating ( Recipes )

Status
Not open for further replies.
Level 3
Joined
Jul 4, 2012
Messages
31
Hello
I've been Using some triggers on making an item with 2 similar items , but it doesn't work well , i would be glad to have your ideas about it

Problem : it doesn't need 2 items (it just picks one , makes the item i want , removes the one needed)

Trigger :
Prob_1.png


Edit : Second problem is fixed
 
In this case, you'll have to loop through the slots and check if there are more than 1 slots with that item. It'll look something like this (I don't know the exact triggers off the top of my head):
  • Set ClawCount = 0
  • For each LoopInteger from 1 to 6 do (Actions)
    • Loop - Actions
      • If (All conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item carried by (Triggering unit) in slot (LoopInteger)) Equal to Claws of Attack +160 (Upgradeable))
        • Then - Actions
          • Set ClawCount = ClawCount + 1
          • If (All conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ClawCount Equal to 2
            • Then - Actions
              • <remove items and create the +320 item>
              • Set LoopInteger = 6 // exit from the loop since you're done with the trigger
            • Else - Actions
        • Else - Actions
Basically, since you are checking for the same item, the normal condition of "Does <unit> have <item>?" doesn't work. Even if the unit has one, it'll still pass the condition, even if you put 50 conditions for it. Another method could be removing that item and then checking if he still has it, but that is sloppy. The method above simply loops through the item slots and keeps track of how many claws of attack there are (using ClawCount). If it reaches 2 (meaning, the unit has 2 claws of attack +160), it'll finish the recipe and then exit the loop.
 
Status
Not open for further replies.
Top