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

[Trigger] Left / Right Hand Equipment

Status
Not open for further replies.
Level 2
Joined
May 1, 2007
Messages
25
Now I made this trigger to limit the user to use only 2 items for hands (currently you'll see only Dagger but if work ill add...) but for some reason after picking 1 item, it says I use 2.

Here is the way it goes

  • Acquire Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeftHand Equal to True) and (RightHand Equal to True)
          • And - All (Conditions) are true
            • Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) for 5.00 seconds the text: Your hands are both...
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeftHand Equal to False) and (RightHand Equal to False)
          • And - All (Conditions) are true
            • Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
        • Then - Actions
          • Set RightHand = True
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeftHand Equal to False) and (RightHand Equal to True)
          • And - All (Conditions) are true
            • Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
        • Then - Actions
          • Set LeftHand = True
        • Else - Actions
          • Do nothing

Can some one solve this ?
 
Last edited by a moderator:
Level 32
Joined
Oct 23, 2006
Messages
5,291
Hopefully we will get it straightened out before too long.

[off-topic] Our vBuelletin software includes [TRIGGER][/TRIGGER] tags:

folder.gif


These make the posting of triggers more powerful: I have edited your post to demonstrate.

Instructions for their use may be found here.
 
Level 3
Joined
May 4, 2007
Messages
66
Ok i think i've got it. When u pick up an item second "if then else" fires and sets RightHand to true. Then trigger continues and cuz RightHand == True then third "if then else" fires and then LeftHand is set too true and there is ure bug. To fix this put "Skip remaining actions" in every "if then else". So here is ure trigger:

  • Acquire Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeftHand Equal to True) and (RightHand Equal to True)
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) for 5.00 seconds the text: Your hands are both...
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeftHand Equal to False) and (RightHand Equal to False)
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
        • Then - Actions
          • Set RightHand = True
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeftHand Equal to False) and (RightHand Equal to True)
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
        • Then - Actions
          • Set LeftHand = True
          • Skip remaining actions
        • Else - Actions
 
Level 2
Joined
May 15, 2007
Messages
27
Wouldn't this be much easier to set all items that can be used in left and right hand to an item type variable array, and or an item class.
so all weapons that can be used in left or right hand set to a class such as buyable or artifact.

and then count how many of said items in the inventory are said class each time a person picks up a new weapon of said class.
Also using a integer array would be much easier to keep track of how many weapons the user currently has.
this would allow you to not have to do code for each individual item.

Ill post an example.
  • Dual Wield
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set DualWieldClass = Permanent
      • Set PlayerNumber = (Player number of (Owner of (Hero manipulating item)))
      • Set E_Weapon[PlayerNumber] = 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-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to DualWieldClass
            • Then - Actions
              • Set E_Weapon[PlayerNumber] = (E_Weapon[PlayerNumber] + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • E_Weapon[PlayerNumber] Greater than 2
        • Then - Actions
          • Game - Display to (Player group((Player(PlayerNumber)))) the text: Your hands are curr...
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
 
Level 2
Joined
May 15, 2007
Messages
27
Its not needed as I said you could also use an item array. removing the need to hardcode each item.
I simply showed the item class method.


Your trigger is based on item type as it is.
 
Status
Not open for further replies.
Top