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

[Solved] How does "Set Unit Weapon Boolean Field" Work?

Status
Not open for further replies.
Level 5
Joined
May 24, 2017
Messages
93
I am working on the Mana Shield ability and I have a trigger that when a unit uses mana shield it checks for a buff that it gives and disables the units attack. I think the above action can do it because it disables the attack when used but it does not reactivate it. I will post the trigger, the spell has nothing but the name changed. The ability removes the attack and stop icon in the command card. Thank you and ask questions to see if you can figure it out.
 

Attachments

  • Warcraft trigger.PNG
    Warcraft trigger.PNG
    15.4 KB · Views: 54
Level 25
Joined
Mar 29, 2020
Messages
1,466
can you clarify what exactly you are trying to do?

also useful tip - to display triggers here you don't need to attach a picture, you can just go into the trigger editor right click and "copy as text" and then paste it here, and it will appear just like in the WE if you write "trigger" (enclosed in square parenthesis ) before, and "/trigger"(also enclosed in square parenthesis) after.
 
Level 13
Joined
May 10, 2009
Messages
868
Well, you're disabling attack index 0 and attempting to enable index 1 later. That could be the reason behind it.

If that problem still persists, there's another action which is capable of disabling attack.
  • Custom script: set udg_Attack = 'Aatk' // This is an Ability Code var
  • Unit - For UNIT, Ability Attack, Disable ability: True, Hide UI: False // Disable
  • Unit - For UNIT, Ability Attack, Disable ability: False, Hide UI: False // Enable
 
Level 5
Joined
May 24, 2017
Messages
93
Can you please set up the trigger with your codes inside it? Do I need to set up a variable?
I do not get the "for UNIT" and I cant find what the action is for it?

EDIT: I found the "for UNIT" Action

EDIT: Do I need to set the variable with the custom code?
 
Last edited:
Level 5
Joined
May 24, 2017
Messages
93
  • Deactive Attack
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Disable Attack
    • Actions
      • Custom script: set udg_Attack = 'Aatk'
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Disabled Attack ) Equal to True
        • Then - Actions
          • Unit - For (Triggering unit), Ability Attack, Disable ability: True, Hide UI: False
        • Else - Actions
          • Unit - For (Triggering unit), Ability Attack, Disable ability: False, Hide UI: False
It will disable but not re able. Maybe something to do with the event or checking for a buff? Does mana shield trigger this when it is turned off?

+rep for getting me this far
 
Level 13
Joined
May 10, 2009
Messages
868
Oh, you're right. I forgot that turning mana shield off doesn't fire that event. Let's give Unit Order event a try:
  • Events
    • Unit - A unit Is issued an order with no target
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Issued order) Equal to (Order(manashieldon))
        • (Issued order) Equal to (Order(manashieldoff))
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Issued order) Equal to (Order(manashieldon))
      • Then - Actions
        • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: False
      • Else - Actions
        • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: True
You'll also have to take effects such as stuns / pause into consideration because that event could still be fired while a unit is under those effects.
 
Level 5
Joined
May 24, 2017
Messages
93
It did not recognize the order command. I tryed it with both disabling methods and it did not disable the attack like it did with my previous trigger.
  • Deactive Attack
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(manashieldon))
          • (Issued order) Equal to (Order(manashieldoff))
    • Actions
      • Custom script: set udg_Attack = 'Aatk'
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(manashieldoff))
        • Then - Actions
          • Unit - For (Triggering unit), Ability Attack, Disable ability: True, Hide UI: False
        • Else - Actions
          • Unit - For (Triggering unit), Ability Attack, Disable ability: False, Hide UI: False
Anyother ideas
 
Level 5
Joined
May 24, 2017
Messages
93
I figured out how to make it work. I just made two abilitys and deactivated the attack and replaced the abilitys when one of the abilitys was cast. Thank you all for the help and I am switching this post to solved.
 
Status
Not open for further replies.
Top