• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

question. {creating a button that uses items and removes them}

Status
Not open for further replies.
Level 4
Joined
Mar 27, 2009
Messages
66
how would i create a make button that doesn't need items to be in pre-determined slots to create the new item and will only remove the items used?
 
Level 4
Joined
Mar 27, 2009
Messages
66
oh yes, perfect thank you.

{EDIT}
  • Log house
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Make Item
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Log) Equal to True
          • ((Triggering unit) has an item of type Log) Equal to True
          • ((Triggering unit) has an item of type Log) Equal to True
          • ((Triggering unit) has an item of type Log) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Log)
          • Item - Remove (Item carried by (Triggering unit) of type Log)
          • Item - Remove (Item carried by (Triggering unit) of type Log)
          • Item - Remove (Item carried by (Triggering unit) of type Log)
          • Hero - Create Build Log house and give it to (Triggering unit)
        • Else - Actions
          • Do nothing
ok..thats my basic make trigger...however it makes the item even if they only have 1 log...is there a way to fix this?
 
Last edited by a moderator:
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

  • Item picked
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Gem Fragment
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Hero manipulating item)) Equal to Player 1 (Red)
        • Then - Actions
          • Set ItemPlayer1 = (ItemPlayer1 + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ItemPlayer1 Equal to 4
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) of type Gem Fragment)
              • Item - Remove (Item carried by (Hero manipulating item) of type Gem Fragment)
              • Item - Remove (Item carried by (Hero manipulating item) of type Gem Fragment)
              • Item - Remove (Item carried by (Hero manipulating item) of type Gem Fragment)
              • Hero - Create Ring of Protection +5 and give it to (Hero manipulating item)
            • Else - Actions
              • Do nothing
        • Else - Actions
1) You need to create a variable for each player.
2) You need to clear each variable, but i forgot the costum script atm^^)
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
You can do it easier.

You use the same event and condition as in your trigger and then:

Actions:
loop for integer A 1-6
if(item for (triggering unit) in slot (integer A) = log)
set "numLog" = "numLog" + 1
(end loop)
if(numlog >= 4)

-> here comes the action which happens when the unit has 4 logs.
 
Status
Not open for further replies.
Top