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

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