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

items

Status
Not open for further replies.
Level 19
Joined
May 1, 2008
Messages
1,129
ok so i have a item of class "artefact" in my inventory and if i pick up a nother one of the same class i want my hero to automaticaly drop it and then a text message pops up saying "u can hold only 1 artefact". How do i do that?
 
you can do it with boolean variable.

If hero picked item and item type is artefact, set VariableX=true

and if hero picked item, make If/then/else. if X=true, then drop picked item and game text blabla, Else pick item
 
Don't forget to make a boolean for each player. Or it will only allow one player to hold an artifact. Haha.
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Artifact
    • Actions
      • 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-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Artifact
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
And booleans do not leak.
 
Status
Not open for further replies.
Back
Top