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

[General] Weapon Counter Triggering

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
What is this trigger missing?

I followed a turtorial showing me how to make an IDS.
Now this one is based on the item level in object editor.
Let's say all two-handed weapons are level 1.
Main hands are level 2.
And off-hands are level 3.

The main idea here is that you cannot use 2 two-handed weapons. Nor can you use two main hands or two off-hands at the same time. But you may be able to use 1 main hand and 1 off hand together.

But the trigger i was instructed does not seem to work.
What am I missing?

  • IDS
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set ItemCounter_Limiter = 0
      • Set ItemCounter_Level = (Item level of (Item being manipulated))
      • Set ItemCounter_PickUpUnit = (Triggering unit)
      • Set ItemCounter_Inventory = (Size of inventory for ItemCounter_PickUpUnit)
      • For each (Integer ItemCounter_Loop) from 1 to ItemCounter_Inventory, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item level of (Item carried by ItemCounter_PickUpUnit in slot ItemCounter_Loop)) Equal to ItemCounter_Level
            • Then - Actions
              • Set ItemCounter_Level = (ItemCounter_Limiter + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemCounter_Limiter Greater than 1
        • Then - Actions
          • Hero - Drop (Item being manipulated) from ItemCounter_PickUpUnit
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: You are fat.
        • Else - Actions
      • Set ItemCounter_PickUpUnit = No unit
Thanks to the previous comments for the assistance.
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
You made it so complicated whereas it needs simple triggering.
Basically there are many ways to do this.

Here is my only-one-lonely trigger that can achieve this, I will use booleans (Note that I made this so fast, I didn't revise it):
You can also add the OffHand Boolean and Armor Booleans ...etc
NOTE 2.432 !!! : THIS IS NOT MUI, IT'S MPI, I just assumed you are building an ORPG or something , representing one hero per player...

Weapon Counter
  • Item Counter
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Player_ItemTempInt = (Player number of (Owner of (Triggering unit)))
      • -------- Checking if the unit is double handed or One-Handed, if not, it can acquire the item --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to "Double Sword"
          • (Item-type of (Item being manipulated)) Equal to "Double Knife"
          • (Item-type of (Item being manipulated)) Equal to "TwoHands Shield"
          • (Item-type of (Item being manipulated)) Equal to "Arrow Bow"
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_DoubleHanded[Player_ItemTempInt] Equal to True
              • Player_OneHanded[Player_ItemTempInt] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: Your hands are full.
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set Player_DoubleHanded[Player_ItemTempInt] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to "Single Sword"
          • (Item-type of (Item being manipulated)) Equal to "Single Knife"
          • (Item-type of (Item being manipulated)) Equal to "One-Hand Shield"
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_DoubleHanded[Player_ItemTempInt] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: Your hands are full.
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set Player_HandItemCounter[Player_ItemTempInt] = (Player_HandItemCounter[Player_ItemTempInt] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Player_HandItemCounter[Player_ItemTempInt] Equal to 2
                • Then - Actions
                  • Set Player_DoubleHanded[Player_ItemTempInt] = True
                • Else - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top