• 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.

Recipe System

Status
Not open for further replies.
Level 6
Joined
Oct 24, 2012
Messages
242
I was trying a recipe system for my map but it doesn't work. I was fooling around with a test map and tested the trigger.
attachment.php

It's supposed to remove the Crown of Kings and Claws of Attack and replace it with Mask of Death. What happens is if I pick either Crown of Kings or Claws of Attack, it makes 21 Mask of Deaths (some in the inventory and some on the ground) Why does this happen? :ogre_rage:
 

Attachments

  • Item.JPG
    Item.JPG
    47.7 KB · Views: 187
Bro,you have been here for 6 months and you can't still post triggers properly :/
To post triggers:
1)Right-click trigger icon in the trigger code then press "Copy trigger as text"
2)In between [trigger][/trigger] , Ctrl + V.
There you have it :D

Okay on-topic
The reason why it doesn't work is that you are checking if the unit has an item then you remove it,which in result it won't work :(. You should remove an item then add a new item.

Also,remove those Integer A and B for looping,you don't need loop to check if a unit has an item of type.Just use Hero Manipulating Item has an item Equal to YourItemType
 
I think that this would be a better way to do it.
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has an item of type Claws of Attack +9) Equal to True
      • Then - Actions
        • Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +9)
        • Hero - Create Mask of Death and give it to (Triggering unit)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
          • Then - Actions
            • Item - Remove (Item carried by (Triggering unit) of type Crown of Kings +5)
            • Hero - Create Mask of Death and give it to (Triggering unit)
          • Else - Actions
Here is the copy trigger text thing.
 

Attachments

  • Copy As Text.jpg
    Copy As Text.jpg
    33.3 KB · Views: 92
Level 6
Joined
Oct 24, 2012
Messages
242
I think that this would be a better way to do it.
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has an item of type Claws of Attack +9) Equal to True
      • Then - Actions
        • Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +9)
        • Hero - Create Mask of Death and give it to (Triggering unit)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
          • Then - Actions
            • Item - Remove (Item carried by (Triggering unit) of type Crown of Kings +5)
            • Hero - Create Mask of Death and give it to (Triggering unit)
          • Else - Actions
Here is the copy trigger text thing.

That would make 2 mask of deaths? :goblin_wtf:
 
Nah my trigger wont create two Masks of Death only the one.
If your hero has a claws of attack then it will get removed and replayed with mask of death.
If it doesn't Else if it has a Crown of Kings then the Item Crown of kings will get removed and the hero will be give the Mask of Death.

By what I have read, if your hero has either one of these items it will be replaced by the item Mask of Death?
 
Level 6
Joined
Oct 24, 2012
Messages
242
Nah my trigger wont create two Masks of Death only the one.
If your hero has a claws of attack then it will get removed and replayed with mask of death.
If it doesn't Else if it has a Crown of Kings then the Item Crown of kings will get removed and the hero will be give the Mask of Death.

By what I have read, if your hero has either one of these items it will be replaced by the item Mask of Death?

It is replaced by 21 Mask of Deaths xD What I want is, if I have Crown of Kings and Claws of Attack, it will be replaced by Mask of Death.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You need to set conditions better. What you have right now is this:
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
        • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
        • ((Hero manipulating item) has an item of type Claws of Attack +15) Equal to True
        • ((Hero manipulating item) has an item of type Crown of Kings +5) Equal to True
However this will fire more time than intended, since you use "Or" condition, it will check if ANY condition is true and if at least one is true, it will fire.
So basically if you have Claws of Attack (+15) in your inventory and you pick up a completely unrelated item (like Ring of Protection), the trigger will still fire, because at least one condition (((Hero manipulating item) has an item of type Claws of Attack +15) Equal to True) is true.

If you want the trigger to fire only if unit picks up Claws of Attacks while it has already Crown of Kings in its inventory, or vice versa, you will need to set conditions like this:
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
            • ((Hero manipulating item) has an item of type Crown of Kings +5) Equal to True
        • And - All (Conditions) are true
          • Conditions
            • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
            • ((Hero manipulating item) has an item of type Claws of Attack +15) Equal to True
Also, why do you create Loop inside Loop? And why is Loop (integer B) from 1 to 3 when you have only items[1] and items[2]?
 
Wasn't clear at first.
Here is the trigger that you want..
  • Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
          • ((Triggering unit) has an item of type Claws of Attack +15) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Crown of Kings +5)
          • Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +15)
          • Hero - Create Mask of Death and give it to (Triggering unit)
        • Else - Actions
 
Last edited:
Level 6
Joined
Oct 24, 2012
Messages
242
DeathChef's 2nd Trigger: I don't why it gives me 6 Mask of Deaths instead of 1 and it fires even I only had Claws of Attack.
DeathChef's 1st Trigger: Same as above.
Nichilus' Trigger: Doesn't do anything.

Oh why? :O The triggers are supposed to work.. DeathChef and Nichilus, could you try it in yours if it works?
 
Last edited:
Status
Not open for further replies.
Top