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

[Trigger] My First Recipe

Status
Not open for further replies.
Level 9
Joined
Jul 1, 2005
Messages
393
I'm tryng to use the site tutorial to make my very first recipe. (Auto-Combine)

But I've run into numberous problems, and it seems like I have to go back and learn variables before I can go forwards! How irritating!

Problem 1:

Events: Unit - No Unit aquires an item.

For some reason I seem to need to specify a unit. But whenever I try I just end up going to world editor palette. So I try selecting a hero and I just rubber stamp a hero onto my map, trying to get it to work. Not what I had in mind.

Problem 2:

I want to restrict what forces can make a certain item. For example I want to turn a stick into a squash. But only if YOU are on the Night elf side, or the Universal side. If you are on the Naga side then it doesn't auto-combine.

Problem 3:
The condition
((Hero manipulating item))
I'm dumb I simply can't find it.

Problem 4:
Is there a way to make the script wait until a character is level 10 before the stick becomes a squash. And then is there a way to wait until the character is level 50 before the squash becomes an apple?


note: this is a learning recipe so that I know what to do next time, and have something I can refer back to.
 
Last edited:
Level 9
Joined
Jul 1, 2005
Messages
393
How I made recipes before

  • Events
  • Unit - A unit owned by Player 1 (Red) Acquires an item
  • Conditions
  • (Unit-type of (Triggering unit)) Equal to Tannery
  • Actions
  • If (((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Stag Skin) and ((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Antlers)) then do (Item - Create Net at (Position of (Triggering unit))) else do (Do nothing)
  • -remove-
  • If (((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Stag Skin) and ((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Antlers)) then do (Item - Create Net at (Position of (Triggering unit))) else do (Do nothing)

I am not certain what the diff is, or why one would be so much better than another.
 
Last edited:
Level 9
Joined
Jul 1, 2005
Messages
393
Packing Up

Is there a better way to pack?

  • pack up
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes training a unit
      • Unit - A unit owned by Player 2 (Blue) Finishes training a unit
      • Unit - A unit owned by Player 3 (Teal) Finishes training a unit
      • Unit - A unit owned by Player 4 (Purple) Finishes training a unit
      • Unit - A unit owned by Player 5 (Yellow) Finishes training a unit
      • Unit - A unit owned by Player 6 (Orange) Finishes training a unit
      • Unit - A unit owned by Player 7 (Green) Finishes training a unit
      • Unit - A unit owned by Player 8 (Pink) Finishes training a unit
      • Unit - A unit owned by Player 9 (Gray) Finishes training a unit
      • Unit - A unit owned by Player 10 (Light Blue) Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Pack Up Tent
    • Actions
      • Item - Create Packed Up Tent at (Position of (Triggering unit))
      • Unit - Remove (Triggering unit) from the game
      • Unit - Remove (Trained unit) from the game
----------------------------------------------------------
Spawning

Is there a better way to spawn?

  • sheep start
    • Events
      • Unit - A unit owned by Player 1 (Red) Gains a level
      • Unit - A unit owned by Player 2 (Blue) Gains a level
      • Unit - A unit owned by Player 3 (Teal) Gains a level
      • Unit - A unit owned by Player 4 (Purple) Gains a level
      • Unit - A unit owned by Player 5 (Yellow) Gains a level
      • Unit - A unit owned by Player 6 (Orange) Gains a level
      • Unit - A unit owned by Player 7 (Green) Gains a level
      • Unit - A unit owned by Player 8 (Pink) Gains a level
      • Unit - A unit owned by Player 9 (Gray) Gains a level
      • Unit - A unit owned by Player 10 (Light Blue) Gains a level
    • Conditions
      • sheep start <gen> Equal to Upgrade <gen>
    • Actions
      • Unit - Create 3 Sheep for Neutral Extra at (Random point in (Playable map area)) facing Default building facing degrees
 
Last edited by a moderator:
Level 2
Joined
Jun 10, 2007
Messages
19
Recipes

Hey here is how I do my recipes.
  • Events
    • Unit - A Unit Aquires an Item
  • Conditions
  • Actions
    • Wait 0.01 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Buying Unit) Has an Item of Type <Your Item>) Equal to True
      • Then - Actions
        • Item - Remove Item carried by (Buying Unit) of Type <Your Item>
        • Hero - Create <Your Item> and give it to (Buying Unit)
      • Else - Actions
        • Do Nothing
 
Last edited by a moderator:
Level 10
Joined
Jan 21, 2007
Messages
576
First off, do not triple post. Here il make a recipe trigger for you.

EDIT: Alright heres the trigger.

  • Squash
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Squash Seed) Equal to True
          • ((Hero manipulating item) has an item of type Tome Water Pitcher) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Squash Seed)
          • Item - Remove (Item carried by (Hero manipulating item) of type Water Pitcher)
          • Hero - Create Squash and give it to (Hero manipulating item)
        • Else - Actions
The items can be interchanged to make the recipe you want.
 
Level 10
Joined
Jan 21, 2007
Messages
576
Sorry for late response ive been busy, to get to hero manipulation item you would do as such:

Click last created item, change it to item carried by hero, then in the drop down list under Event Respone, there should be one called hero manipulation item.
 

Attachments

  • 1.JPG
    1.JPG
    28.7 KB · Views: 477
  • 2.JPG
    2.JPG
    29.1 KB · Views: 438
  • 3.JPG
    3.JPG
    27.4 KB · Views: 429
Level 9
Joined
Jul 1, 2005
Messages
393
here is what I have. I am having difficulty finding the appropriate conditions I was able to get the condition of Hero manipulating item but it will only work a certain way, I can't get hero manipulating item to be the first thing mentioned.
  • Squash
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Last created item) Equal to (Item carried by (Hero manipulating item) in slot 1)
          • (Last created item) Equal to (Item carried by (Hero manipulating item) in slot 1)
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Tome of Experience)
          • Item - Remove (Item carried by (Hero manipulating item) of type Tome of Experience)
          • Hero - Create Tome of Experience and give it to (Hero manipulating item)
        • Else - Action
 
Last edited by a moderator:
Level 10
Joined
Jan 21, 2007
Messages
576
Remove your conditions and go to "Boolean > Hero Has item type"

EDIT: Sorry for repeat answer.
 
Level 6
Joined
Feb 25, 2005
Messages
230
I was wondering, hope its not off topic, that if you want a recepie to require two of the same itemtype, then those triggers wont work just adding another condition of the same kind...

do you have to count the items in the slots or there an easier way?
 
Level 10
Joined
Jan 21, 2007
Messages
576
Diablo there is a way ^^:

  • Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Custom value of (Item being manipulated)) Not equal to 1
    • Actions
      • -------- Checks if you have Stickx1, hide, and rope --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Stick) Equal to True
          • ((Hero manipulating item) has an item of type Hide) Equal to True
          • ((Hero manipulating item) has an item of type Rope) Equal to True
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Stick) from (Hero manipulating item)
          • Item - Set the custom value of (Last dropped item) to 1
          • -------- Drops 1 stick then checks if you still have Stickx1. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Hero manipulating item) has an item of type Stick) Equal to True
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) of type Hide)
              • Item - Remove (Item carried by (Hero manipulating item) of type Rope)
              • Item - Remove (Item carried by (Hero manipulating item) of type Stick)
              • Item - Remove (Last dropped item)
              • Hero - Create Tent and give it to (Hero manipulating item)
              • Else - Actions
              • Hero - Give (Last dropped item) to (Hero manipulating item)
              • Item - Set the custom value of (Last dropped item) to 2
        • Else - Actions
 
Level 4
Joined
Jul 14, 2007
Messages
59
There is a way better way to have multi type item combining.
Make a few item type variable named "tempitem1", "tempitem2", etc.

Then when the hero acquires an item, the trigger will set all the tempitem variables to zero.

Then for every item type you want, you will run a For Loop from 1-6:
if the item type in slot (for loop integer A), If it is equal to the item type you want, then set tempitem1=tempitem1 + 1

You would then do that for every item type that you want to combine.

Example: So if you wanted to combine 2 boots of speed, you would make a
tempitem variable.
For every integer 1-6, do actions:
If item type of item carried by hero in slot (for loop integer A) is equal to boots of speed, then set tempitem=tempitem +1

Then, you would make an if, then statement:
If tempitem >= 2 then, remove boots of speed, remove boots of speed, give hero the item, uber boots of speed
 
Status
Not open for further replies.
Top