• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Help with a "crafting" trigger

Status
Not open for further replies.

thenigg

T

thenigg

Hi guys I am working on a new game largely based off of Kuulgryphun3's Wilderness Survival. It is kind of similar to Island Troll Tribes in sense that you can gather things and craft them. However the way you craft things is by having them in your inventory in any order (unlike ITT) and pressing the ability "Make". I was wondering how I could set up the trigger so that when this ability is activated, it checks what items are in your inventory and finds out the possible combinations. Then, it brings up another menu, similar to the regular build menu and shows what possible items can be crafted. Finally, when you click one of those items, it puts that item in your inventory and removes the items used to craft that item. For example, (Stick + Stick = Big Stick) if you have 2 sticks in your inventory and you press make, it will show the build menu with the only option of building a big stick. Or, if that is too difficult, it will simply just put a big stick in your inventory. The problem is, this has to be calibrated for a large scale basis because there will be several different recipes.

I know this looks like a complicated problem, but I am new to this community and I would really appreciate some help!
 
You basicly need to check each time if a recipe can be made by the items the unit have.

For example, you have a recipe that needs a Hide and 2 sticks (hmm... a tent maybe ? :P), you'll check it like this:

If yourUnit has Stick and another Stick and a Hide, add option "Build Tent" to dialog.

I think this will be pretty hard to make in GUI so I suggest Jass.
Maybe ill try to make it tommarow.
 
Thank you. I actually found Diablo-dk's recipe system and I think I can tweak it to suit my needs. I just need to make it not an auto combine.
 
Else u can du like this:
  • Events:
    • Unit - A unit Casts the ability MAKE
  • Conditions:
  • Actions:
    • Trigger - Turn off (this trigger)
    • For each integer A 1-6 do actions
      • If all conditions are true Then do then-actions else do else actions
        • Conditions - If
          • And: (If all conditions are true)
            • Item - Hero manipulating item has Item 1 in slot Integer A
            • Item - Hero manipulating item has Item 2 in slot Integer A
        • Actions - Then
          • Item - Remove item of type Item 1 from Hero manipulating item in slot Integer A
          • Item - Remove item of type Item 2 from Hero manipulating item in slot Integer A
          • Hero - Create a Your Item and give it to Hero manipulating item.
        • Actions - Else
          • Do nothing
    • Trigger - turn on (this trigger)
 
Status
Not open for further replies.
Back
Top