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

[Trigger] Weapon Limit

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
No, I'm not asking how to do it, lolz.
I made these here 4 triggers to put a limit on weapons and shields.
But for some strange reason they don't work the way they should do.
I'm thinking the bug each other, but I just can't find out why.

Maybe u can see it?

  • Only1Weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to Artifact
          • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item being manipulated)) Equal to Artifact
              • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set DropPointItemWeapon[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
              • Item - Move (Item being manipulated) to DropPointItemWeapon[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Create floating text that reads (PlayerColor[(Player number of (Owner of (Triggering unit)))] + You can only wield one weapon.) at DropPointItemWeapon[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 15.00 towards (Random real number between 50.00 and 90.00) degrees
              • Custom script: call RemoveLocation(udg_DropPointItemWeapon[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
              • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-class of (Item being manipulated)) Equal to Artifact
                  • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to False
                • Then - Actions
                  • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = True
                • Else - Actions
  • Able2PickUpWeapon
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to Artifact
          • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
          • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = False
  • Only1Armor
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to Permanent
          • Only1Armor[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set Only1Armor[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item being manipulated)) Equal to Permanent
              • Only1Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set DropPointItemArmor[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
              • Item - Move (Item being manipulated) to DropPointItemArmor[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Create floating text that reads (PlayerColor[(Player number of (Owner of (Triggering unit)))] + You can only wield one piece of armor.) at DropPointItemArmor[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 15.00 towards (Random real number between 50.00 and 90.00) degrees
              • Custom script: call RemoveLocation(udg_DropPointItemArmor[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
              • Set Only1Armor[(Player number of (Owner of (Triggering unit)))] = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-class of (Item being manipulated)) Equal to Permanent
                  • Only1Armor[(Player number of (Owner of (Triggering unit)))] Equal to False
                • Then - Actions
                  • Set Only1Armor[(Player number of (Owner of (Triggering unit)))] = True
                • Else - Actions
  • Able2PickUpArmor
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to Permanent
          • Only1Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set Only1Armor[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
          • Set Only1Armor[(Player number of (Owner of (Triggering unit)))] = False
 
Level 9
Joined
Apr 3, 2008
Messages
700
You have conditions:
  • (Item-class of (Item being manipulated)) Equal to Artifact
and
  • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to False
and
  • (Item-class of (Item being manipulated)) Not Equal to Artifact
and
  • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Not Equal to False
There is no trigger that will work with conditions like that. Move if then else.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
You have conditions:
  • (Item-class of (Item being manipulated)) Equal to Artifact
and
  • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to False
and
  • (Item-class of (Item being manipulated)) Not Equal to Artifact
and
  • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Not Equal to False
There is no trigger that will work with conditions like that. Move if then else.

Thanks, for trying but no, that's not it. Why? I already fixed it.
It was the last action of the 2nd and 4th trigger, just turned it off when u dropped other item.
Work's fine now, though why should the other things not work hmm?
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
Oh, yea, and your ordering the hero to drop at a specific place.
Why not just -hero- drop item from unit?
That way you dont need that variable.

  • InitializeWeaponSystem
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- I initialize each class in here --------
      • Set ____Sword = Permanent
      • Set ____Shield = Charged
      • Set ____Glove = Purchasable
      • Set ____Helmet = Artifact
      • Set ____Ring = Powerup
      • Set ____Staff = Campaign
      • -------- The system will work only when game has started so dont add items into units inventory --------
      • -------- or preplace them in a heroes inventory or something. --------
      • -------- booleans will be set to true if they get the weapons. --------
  • GetAWeapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • -------- i added the condition so the system only works for heroes.. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Sword
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bSword[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set zz_bSword[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Shield
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bShield[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou alrea...
              • Item - Remove (Item being manipulated)
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set zz_bShield[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Glove
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bGlove[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set zz_bGlove[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Helmet
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bHelmet[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set zz_bHelmet[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Ring
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bRing[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set zz_bRing[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Staff
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bStaff[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Set zz_bStaff[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
  • LoseAWeapon
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • -------- i added the condition so the system only works for heroes.. --------
      • -------- it checks if there are any items left in his slots that are the same class of the one he dropped --------
      • -------- and if there are any they wont set the booleans to false so they can get another weapon --------
      • -------- instead we skip the remaining actions. --------
      • Set zz_IntegerItemClassCheck = 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 being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot (Integer A)))
              • (Item being manipulated) Not equal to (Item carried by (Triggering unit) in slot (Integer A))
            • Then - Actions
              • Set zz_IntegerItemClassCheck = (zz_IntegerItemClassCheck + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • zz_IntegerItemClassCheck Less than 1
        • Then - Actions
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Sword
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bSword[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bSword[(Player number of (Owner of (Triggering unit)))] = False
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Shield
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bShield[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bShield[(Player number of (Owner of (Triggering unit)))] = False
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Glove
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bGlove[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bGlove[(Player number of (Owner of (Triggering unit)))] = False
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Helmet
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bHelmet[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bHelmet[(Player number of (Owner of (Triggering unit)))] = False
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Ring
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bRing[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bRing[(Player number of (Owner of (Triggering unit)))] = False
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to ____Staff
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bStaff[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bStaff[(Player number of (Owner of (Triggering unit)))] = False
            • Else - Actions
        • Else - Actions
Triggers stolen from this Pack.

You should do something like that.
 
Status
Not open for further replies.
Top