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

Help. Trigger not working currect [AoE damage + item charges]

Status
Not open for further replies.
Level 6
Joined
Aug 31, 2018
Messages
157
When i don't have 10 stacks of [item - soul] i deal 1000 damage [like in the trigger] but when i have 10 stacks i deal 200 + 1000 damage (both damage triggers apply) Why? It should only deal 200 damage if i have 10 stacks.


  • AoE Thunder Clap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Thunder Clap
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Souls) Equal to True
              • ((Charges remaining in (Item carried by (Triggering unit) of type Souls)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))) Equal to 10
            • Then - Actions
              • Set TempPoint = (Position of (Triggering unit))
              • Set Temp_Group = (Units within 500.00 of TempPoint matching ((Matching unit) Not equal to (Triggering unit)))
              • Unit Group - Pick every unit in Temp_Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 200.00) damage of attack type Spells and damage type Normal
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call DestroyGroup(udg_Temp_Group)
            • Else - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Set Temp_Group = (Units within 500.00 of TempPoint matching ((Matching unit) Not equal to (Triggering unit)))
          • Unit Group - Pick every unit in Temp_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Custom script: call DestroyGroup(udg_Temp_Group)
        • Else - Actions
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
If i'm reading correctly you want to deal reduced damage when you achieve 10 stacks?
If so enclose the highlighted trigger into the ELSE - ACTIONS as it is outside of it:
upload_2020-1-23_8-58-39.png
 
Level 6
Joined
Aug 31, 2018
Messages
157
If i'm reading correctly you want to deal reduced damage when you achieve 10 stacks?
If so enclose the highlighted trigger into the ELSE - ACTIONS as it is outside of it:
View attachment 345204
Actually don't look at the damge, i just wanted to test it. THe main idea is to make a stackable item that gives damage to ability.
There are 2 ways.
Each stack to give x damage to the ability (but i dont know if thats possible)
And second variant is to make the item deal x more damage at 10, 20 and 30 stacks.
But i dont know how to do the full trigger, first time doing thing like that.
 
Level 2
Joined
Apr 1, 2019
Messages
156
Hey your still removing your leaks in inside the loop instead of outside.

  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_Temp_Group)
This would loop only once then destroy the group thus ending the loop. Damaging only one unit rather then all

Do this instead

  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyGroup(udg_Temp_Group)
 
Level 6
Joined
Aug 31, 2018
Messages
157
Hey your still removing your leaks in inside the loop instead of outside.

  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_Temp_Group)
This would loop only once then destroy the group thus ending the loop. Damaging only one unit rather then all

Do this instead

  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyGroup(udg_Temp_Group)
Hey again, the problem is, that i dont know how to move the leaks like in the picture.. Dont know how to move them behind
 
Level 6
Joined
Aug 31, 2018
Messages
157
Hey again, the problem is, that i dont know how to move the leaks like in the picture.. Dont know how to move them behind
Btw its working now
  • AoE Thunder Clap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Thunder Clap
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Souls) Equal to True
              • ((Charges remaining in (Item carried by (Triggering unit) of type Souls)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))) Equal to 10
            • Then - Actions
              • Set TempPoint = (Position of (Triggering unit))
              • Set Temp_Group = (Units within 500.00 of TempPoint matching ((Matching unit) Not equal to (Triggering unit)))
              • Unit Group - Pick every unit in Temp_Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 200.00) damage of attack type Spells and damage type Normal
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call DestroyGroup(udg_Temp_Group)
            • Else - Actions
              • Set TempPoint = (Position of (Triggering unit))
              • Set Temp_Group = (Units within 500.00 of TempPoint matching ((Matching unit) Not equal to (Triggering unit)))
              • Unit Group - Pick every unit in Temp_Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call DestroyGroup(udg_Temp_Group)
        • Else - Actions
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Hey again, the problem is, that i dont know how to move the leaks like in the picture.. Dont know how to move them behind
Move one of them above the If/then/else block and then move the if/then/else block above that. Or use the little [-] button to the left of the if/then/else block to hide it.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
How many of the "Souls" item can a Hero have? More than 1 or only 1? Can the Hero move the Item around to different Inventory Slots?

Also, you check the "charges remaining in item carried by Hero in slot (Integer A)". Why are you using Integer A? That's a global variable used in For Loops.

Here's what your trigger should look like. Change Slot 1 to whichever Slot the Item is equipped to. If the Hero can move the Item around to other slots then I can show you a way to find which Slot has the Item.
  • Cast Thunderclap Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
      • ((Triggering unit) has an item of type Souls) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item carried by (Triggering unit) in slot 1)) Equal to 10
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Set TempGroup = (Units within 500.00 of TempPoint)
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 200.00) damage of attack type Spells and damage type Normal
                • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Set TempGroup = (Units within 500.00 of TempPoint)
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
                • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
See how you can + and - the "Pick every unit TempGroup" action. Minimize it (-) and then put your Custom Script Actions BELOW it. You don't want them inside of the "Pick every unit" action, otherwise the Point and Group will be destroyed after the first picked unit is found.

Here's a way to find which Inventory Slot has the Souls Item. It also figures out if the Souls Item has 10 Souls or not. The Boolean "Has10Souls" is True if it has a Souls item with 10 souls, and False if it doesn't. It also sets the Integer "InventorySlot" to which slot has the 10 Souls Item if you wanted to reference that.
  • Cast Thunderclap Ex 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
      • ((Triggering unit) has an item of type Souls) Equal to True
    • Actions
      • Set Has10Souls = False
      • -------- --- --------
      • 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-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Souls
              • (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) Equal to 10
              • Has10Souls Equal to False
            • Then - Actions
              • Set Has10Souls = True
              • Set InventorySlot = (Integer A)
            • Else - Actions
      • -------- --- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Has10Souls Equal to True
        • Then - Actions
          • Game - Display to (All players) for 30.00 seconds the text: Has 10 Souls
          • Set TempPoint = (Position of (Triggering unit))
          • Set TempGroup = (Units within 500.00 of TempPoint)
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 200.00) damage of attack type Spells and damage type Normal
                • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
          • Game - Display to (All players) for 30.00 seconds the text: Doesn't Have 10 Sou...
          • Set TempPoint = (Position of (Triggering unit))
          • Set TempGroup = (Units within 500.00 of TempPoint)
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1000.00) damage of attack type Spells and damage type Normal
                • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
 
Last edited:
Status
Not open for further replies.
Top