recipe

CBBPhoenix

New Member
Reaction score
1
Hi guys I am making a map where you ( as in dota ) should be able to pick up some items and then get another more powerful one. The problem is that I want for 2 identical items to meld to one powerful one and I can't make this using the ordenary triggers 'cause it will give the new item as soon as you pick up one. What can I do about it using GUI?
 
Use this:
Trigger:
  • 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 Recipe: Shiny Axe of Strength) Equal to True
          • ((Triggering unit) has an item of type Gauntlets of Ogre Strength +3) Equal to True
        • Then - Actions
          • Set Count = 0
          • For each (Integer A) 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 (Item carried by (Triggering unit) in slot (Integer A))) Equal to Axe
                • Then - Actions
                  • Set Count = (Count + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Count Equal to 1
                    • Then - Actions
                      • Set Slot = (Integer A)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Count Equal to 2
                    • Then - Actions
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Item - Remove (Item carried by (Triggering unit) in slot Slot)
                      • Item - Remove (Item carried by (Triggering unit) of type Recipe: Shiny Axe of Strength)
                      • Item - Remove (Item carried by (Triggering unit) of type Gauntlets of Ogre Strength +3)
                      • Set TempPoint = (Position of (Triggering unit))
                      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_TempPoint)
                      • Hero - Create Shiny Axe of Strength and give it to (Triggering unit)
                    • Else - Actions
                • Else - Actions
        • Else - Actions

If you only want two identical items, just remove the "If" and keep the Integer A loop, like this:
Trigger:
  • Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Count = 0
      • For each (Integer A) 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 (Item carried by (Triggering unit) in slot (Integer A))) Equal to Axe
            • Then - Actions
              • Set Count = (Count + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Count Equal to 1
                • Then - Actions
                  • Set Slot = (Integer A)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Count Equal to 2
                • Then - Actions
                  • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                  • Item - Remove (Item carried by (Triggering unit) in slot Slot)
                  • Item - Remove (Item carried by (Triggering unit) of type Recipe: Shiny Axe of Strength)
                  • Item - Remove (Item carried by (Triggering unit) of type Gauntlets of Ogre Strength +3)
                  • Set TempPoint = (Position of (Triggering unit))
                  • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Hero - Create Shiny Axe of Strength and give it to (Triggering unit)
                • Else - Actions
            • Else - Actions


And to change the two identical items needed for this, simply change the condition which looks like this:
Trigger:
  • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Axe
 
Okay

So you use a count function to see if there is more than one gauntles of str on the hero inventory? I think I used boolean and that only checks whether or not the hero has none or one/more of the item. I am not quite sure which kinds of variables you use but I am going to try this trigger... Looks very long for such a "simple" game function T_T.

PS: there is no way that you can copy triggers from Thehelper.net and paste them in the trigger editor is there?:(
 
There are only two variables in that trigger, Count (An "Integer" variable) and TempPoint (A "Point" variable) ;)


PS: there is no way that you can copy triggers from Thehelper.net and paste them in the trigger editor is there?

Hehe, nope :p
You'll have to try it for youself :D
 
Testing done

Works perfectly no matter where the required items are in the Hero inventory. You're win mate :D

Thanks a lot. Approved
 
Set Slot = (Integer A) I can figure out how to put it in if i only made those other two triggers
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top