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

Triggered Cleave Not Working

Status
Not open for further replies.
Level 7
Joined
Mar 6, 2014
Messages
203
  • Great Cleave
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (GDD_DamageSource has buff Great Cleave ) Equal to True
              • (Unit-type of GDD_DamageSource) Equal to (Unit-type of Beastmaster 0023 <gen>)
        • Then - Actions
          • Set GC_AtkCount = (GC_AtkCount + 1)
          • Set GC_TargetLoc = (Position of GDD_DamagedUnit)
          • Set GC_Group = (Units within GC_AoE of GC_TargetLoc matching (((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GC_AtkCount Equal to GC_AtkReq
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in GC_Group and do (Actions)
                • Loop - Actions
                  • Set GC_Targets = (Picked unit)
                  • Unit - Cause GDD_DamageSource to damage GC_Targets, dealing GC_Damage[GC_Increaser] damage of attack type Hero and damage type Normal
              • Set GC_AtkCount = 0
              • Custom script: call RemoveLocation (udg_GC_TargetLoc)
            • Else - Actions
          • Trigger - Turn on (This trigger)
        • Else - Actions
OK this is how the spell works. Every 3rd attack of the hero. hero will deal aoe damage. my problem is when my hero attack 3 time the spell is works fine. but when my hero attacks the attacker and the attacker attacks my hero the spell is bugging.

please help me ASAP
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
Is there a reason you need to turn off the trigger? If it is turned off then it cannot run and turn itself back on.

I would try removing the actions where you turn the trigger off and on and see if it works then.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,195
Is there a reason you need to turn off the trigger? If it is turned off then it cannot run and turn itself back on.
To prevent it firing itself. It also does turn itself on when it leaves the conditional block.

Both these lines should be moved inside the conditional block as they do not need to be computed every time damage is done. In fact currently these leak 2/3 times.
  • Set GC_TargetLoc = (Position of GDD_DamagedUnit)
  • Set GC_Group = (Units within GC_AoE of GC_TargetLoc matching (((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True))
the spell is bugging
In what way? The only functional bug I see is that it is not MUI so if another unit were to fulfil the requirements (Beastmaster with Great Cleave buff) then they will all share a global counter value for procing it instead of separate counter values.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Unit-type of Beastmaster 0023 <gen> should be Beastmaster unit type directly instead of the unit type of a preplaced unit.
Better yet, you can remove the unit type comparison because you focus the ability on the buff instead.

C_AtkCount should be an array so you can make this MUI using a unit indexer.

The group and location should only be made when the count hits the required amount.

Turn on (this trigger) should be in the Then - Actions part because the turn off is also in that block.

GC_Increaser isnt set in this trigger so I suppose you should recalculate the damage in that trigger (just before the group loop) to make it MUI.

Because of the limitations of your DDS, other spells like these may interfere with the outcome of this effect.
But if that is not the case, then as DSG mentioned, the only problem is MUI-ness which will be solved with the three modifications I mentioned (Remove unit type comparison, make count an array with unit indexer as index, calculate damage each time this trigger's effect runs).
 
Level 7
Joined
Mar 6, 2014
Messages
203
  • Great CLeave
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Great Cleave ) Equal to True
      • (Unit-type of DamageEventSource) Equal to Beastmaster
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Set GC_Index = (GC_Index + 1)
      • Set GC_AtkCount = (GC_AtkCount + 1)
      • Set GC_Attacker[GC_Index] = DamageEventSource
      • Set GC_Attacked[GC_Index] = DamageEventTarget
      • Set GC_TargetPoint[GC_Index] = (Position of GC_Attacker[GC_Index])
      • Set GC_TGroup[GC_Index] = (Units within 300.00 of GC_TargetPoint[GC_Index] matching (((Matching unit) belongs to an enemy of (Owner of GC_Attacker[GC_Index])) Equal to True))
      • Game - Display to (All players) the text: (String(GC_AtkCount))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_AtkCount Equal to 3
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set GC_MUI = (GC_MUI + 1)
          • Set GC_TargetPoint[GC_MUI] = (Position of GC_Attacker[GC_MUI])
          • Set GC_TGroup[GC_MUI] = (Units within 300.00 of GC_TargetPoint[GC_MUI] matching (((Matching unit) belongs to an enemy of (Owner of GC_Attacker[GC_MUI])) Equal to True))
          • Unit Group - Pick every unit in GC_TGroup[GC_MUI] and do (Actions)
            • Loop - Actions
              • Set GC_Target[GC_MUI] = (Picked unit)
              • Unit - Cause GC_Attacker[GC_MUI] to damage GC_Target[GC_MUI], dealing 50.00 damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation (udg_GC_TargetPoint[udg_GC_MUI])
          • Set GC_Attacker[GC_MUI] = GC_Attacker[GC_Index]
          • Set GC_Attacked[GC_MUI] = GC_Attacked[GC_Index]
          • Set GC_TargetPoint[GC_MUI] = GC_TargetPoint[GC_Index]
          • Set GC_TGroup[GC_MUI] = GC_TGroup[GC_Index]
          • Set GC_Target[GC_MUI] = GC_Target[GC_Index]
          • Set GC_AtkCount = 0
          • Set GC_MUI = 0
          • Set GC_Index = 0
          • Trigger - Turn on (This trigger)
        • Else - Actions
IS THIS MUI NOW? I think no. Please help me to fix it
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
There's no need to make it MUI because the spell is practically instant. The only variable that has to be MUI is the AtkCount. I have 2 solutions for this:
  1. As what Wietlol suggested, use a Unit Indexer. You will just need to make AtkCount an array using the custom value of the unit.
  2. Use 2 unit groups
    • Unit Group 1 will be attackers who have already made 1 attack; Unit Group 2 will be attackers who have already made 2 attacks.
    • If a unit with the passive makes its first attack, run a check if they are not in Unit Group 1 or 2. If neither is true, add them to Unit Group 1.
    • If a unit with the passive is on their second attack, run a check if they are in Unit Group 1. If so, add them to Unit Group 2 and remove them from Unit Group 1.
    • When the unit makes its third attack, check if they're in Unit Group 2. If true, then run all the actions for the cleaving attack and remove them from Unit Group 2.

Like I said, the cleaving attack is practically instant, so theres no need to make it MUI other than the ability level, if the cleave supports multiple levels, and AtkCounter if you wish to go the former suggestion. Also, the only problem with either methods (again as Wietlol mentioned) is that DDS will run anytime damage is dealt (from a spell). I'm not entirely sure if there is a DDS that can check if the attack is strictly from an "auto-attack".
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
A rough outline using Damage Engine:

  • Cleave
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • DamageEventSource has Cleave Equal to True
    • Actions
      • Set TempInteger = (Custom value of DamageEventSource)
      • Set CleaveCount[TempInteger] = (CleaveCount[TempInteger] + 1)
      • If (CleaveCount[TempInteger] Equal to 3) then (Do nothing) Else (Skip Remaining Actions)
      • Set CleaveCount[TempInteger] = 0
      • Trigger - Turn off (This trigger)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick all Units and do
        • Loop - Actions
          • If ((Picked unit) Not Equal to DamageEventTarget) then (Do nothing) Else do (Skip remaining actions)
          • Unit - Cause DamageEventSource to damage (Picked unit)
      • Trigger - Turn on (This trigger)
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
I just thought of a great idea! Make a cleaving attack custom ability with 100% chance, but hidden from the UI. Use PDD or DamageEngine to catch physical damage.


The ifs were laziness on my part, but the loop is necessary as it needs to enumerate an area


  • Cleave
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • Level of Cleave for DamageEventSource Greater than 0
    • Actions
      • If (Multiple)
        • If
          • DamageEventSource has Cleaving 100%
        • Then
          • -------- The unit has used cleaving attack
          • Unit - Remove Cleaving 100%
        • Else
          • Set TempInteger = (Custom value of DamageEventSource)
          • If (Multiple)
            • If
              • AddCleave[TempInteger] Equal to True
            • Then
              • -------- The unit will cleave on its next attack
              • Set AddCleave[TempInteger] = false
              • Unit - Add Cleave 100% to DamageEventSource
            • Else
              • -------- Add Cleave to the unit on its next attack
              • Set AddCleave[TempInteger] = true
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Cleaving attack is supposed to go out in a crescent and deliver damage based on units' proximity to the epicenter. What OP was doing was picking all units in a circle around the target, which could extend the range too much/doesn't reduce damage on the outer distances/isn't in a crescent. Rather than triggering all that, simply adding the Object Editor ability is enough.

Use of Object Editor is a good idea in many cases. You should only trigger something if there is no other way to get it to work.
 
Status
Not open for further replies.
Top