Item Recipes Codes

Cloud_FF

New Member
Reaction score
5
I know that you're thinking that this is an item recipe thread on "How do I do it???" Well it's not. I've done it but I want to change it and I can't a tutorial which shows how I can make item recipes via variables. There is a simple Example down of one of my triggers. I'd love if someone was to redesign it with custom variables, since these are the ONLY triggers in my map which aren't done this way and I really hope that they are the source of the crashes (I redid all special effects, pathing, spawning, pick units, pick players and so on crushable triggers) cuz it sux that it crashes:

Code:
Event:
   Unit - A unit Acquires an item

Conditions:
   Or - Any (Conditions) are true
      Conditions
         (Item-type of (Item being manipulated)) Equal to |CFFO54A6Swift Steel Sword
         (Item-type of (Item being manipulated)) Equal to Magical Scroll
         (Item-type of (Item being manipulated)) Equal to Runed Scroll
   ((Hero manipulating item) has an item of type |CFFO54A6Swift Steel Sword) Equal to True
   ((Hero manipulating item) has an item of type Magical Scroll) Equal to True
   ((Hero manipulating item) has an item of type Runed Scroll) Equal to True

Actions:
   Item - Remove (Item carried by (Triggering unit) of type |CFFO54A6Swift Steel Sword)
   Item - Remove (Item carried by (Triggering unit) of type Magical Scroll)
   Item - Remove (Item carried by (Triggering unit) of type Runed Scroll)
   Hero - Create |CFF62D91Gut-Ripping Sword and give it to (Triggering unit)

The trigger works fine. It takes the items, it removes them, never miss works, always works correctly for the item combos and auto applies.

P.S. If you could put in a few words a system which uses dialogue buttons instead of auto crafting I'd be very glad. I have in mind for this:

Code:
Event:
   Unit - A unit Acquires an item

Conditions:
   Or - Any (Conditions) are true
      Conditions
         (Item-type of (Item being manipulated)) Equal to Gemless Pendant
         (Item-type of (Item being manipulated)) Equal to |CFF662D91Amethyst of Magic Warding
   ((Hero manipulating item) has an item of type Gemless Pendant) Equal to True
   ((Hero manipulating item) has an item of type |CFF662D91Amethyst of Magic Warding) Equal to True

Actions:
   Item - Remove (Item carried by (Triggering unit) of type Gemless Pendant)
   Item - Remove (Item carried by (Triggering unit) of type |CFF662D91Amethyst of Magic Warding)
   Hero - Create |CFF62D91Amethyst Pendant of Magic Warding and give it to (Triggering unit)

Somewhere in that last trigger I want dialogue trigger but I can't make them myself. :confused:
 

foodflare

You can change this now in User CP.
Reaction score
32
I know its not mpi or mui or leakless but this is wat i could come up with

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Items_Obtained[1] = Claws of Attack +15
        Set Items_Obtained[2] = Crown of Kings +5
        Set Items_Obtained[3] = Kelen's Dagger of Escape
        Set Items_Obtained[4] = Mask of Death
        Set Items_Obtained[5] = Orb of Frost
        Set Items_Obtained[6] = Ring of Protection +5
        Set Items_Created[3] = Heart of Aszune
        Set Items_Created[4] = Horn of Cenarius
        Set Items_Created[5] = Sun Key
        Set Items_Created[6] = Key of Three Moons
        Set Items_Created[7] = Magic Key Chain
        Set Items_Created[8] = Mogrin's Report
        Set Items_Created[9] = Moon Key
        Set Items_Created[10] = Mooncrystal
        Set Items_Created[11] = Note to Jaina Proudmoore

Code:
Dialog Creation
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Dialog - Clear CombinationDialog
        Dialog - Create a dialog button for CombinationDialog labelled Combine
        Set DialogButtons[1] = (Last created dialog Button)
        Dialog - Create a dialog button for CombinationDialog labelled Do not Combine
        Set DialogButtons[2] = (Last created dialog Button)

Code:
Show Dialog
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to 6, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Or - Any (Conditions) are true
                                    Conditions
                                        (Item-type of (Item being manipulated)) Equal to Items_Obtained[(Integer A)]
                                        (Item-type of (Item being manipulated)) Equal to Items_Obtained[(Integer B)]
                                ((Triggering unit) has an item of type Items_Obtained[(Integer A)]) Equal to True
                                ((Triggering unit) has an item of type Items_Obtained[(Integer B)]) Equal to True
                                (Integer A) Not equal to (Integer B)
                            Then - Actions
                                Set Items_to_Combine[1] = (Item carried by (Triggering unit) of type Items_Obtained[(Integer A)])
                                Set Items_to_Combine[2] = (Item carried by (Triggering unit) of type Items_Obtained[(Integer B)])
                                Set Triggering_Hero = (Triggering unit)
                                Dialog - Show CombinationDialog for (Owner of (Triggering unit))
                            Else - Actions

Code:
Creating Items
    Events
        Dialog - A dialog button is clicked for CombinationDialog
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[1]
            Then - Actions
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        For each (Integer B) 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 Items_to_Combine[1]) Equal to Items_Obtained[(Integer A)]
                                        (Item-type of Items_to_Combine[2]) Equal to Items_Obtained[(Integer B)]
                                    Then - Actions
                                        Item - Remove Items_to_Combine[1]
                                        Item - Remove Items_to_Combine[2]
                                        Item - Create Items_Created[((Integer A) + (Integer B))] at (Position of Triggering_Hero)
                                        Unit - Order Triggering_Hero to Right-Click (Last created item)
                                    Else - Actions
            Else - Actions

I know it doesnt allow for same type of item combinations but it works I have tested it
 

Cloud_FF

New Member
Reaction score
5
Whoa! :eek: Right...but doesn't that mean that I have to "pre-set" each and every item I use? They are kind of a lot...

P.S. Is that the simplest way btw....it looks very long. And are you sure that such triggers don't crash games? Because if they don't I am pretty much stuck headbanging at the other 270 triggers, why and where they go wrong.
 

foodflare

You can change this now in User CP.
Reaction score
32
True and its not that efficient because some diff item combos would make the same item and it might choose the wrong items.
 

Cloud_FF

New Member
Reaction score
5
I made sure that there are no combos which are equal for 2 different items...well I think I made sure...I'll check again :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top