• 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 faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade 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,130
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?
 
Level 12
Joined
Mar 26, 2005
Messages
790
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
 
Level 12
Joined
Mar 16, 2006
Messages
992
Don't forget to make a boolean for each player. Or it will only allow one player to hold an artifact. Haha.
 
Level 8
Joined
Mar 20, 2007
Messages
224
  • 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.
Top