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

Multiple target spells showing some trouble

Status
Not open for further replies.
Level 5
Joined
Jun 16, 2009
Messages
49
Aye, I'm trying to make 2 spells that both are failing to show results:

The first one is a spell that will increase all allies' armor by 9999, making them immune to physical damage (sort of). I'm using Inner Fire to add the buff though, because my map is already full of roar based buffs. The point is that only one (sometimes two) random unit within 750 range is receiving the effect (+9999 armor), and can't figure out why.
  • Custom
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Solar Flame
    • Actions
      • Set Custom_Caster = (Triggering unit)
      • Set Custom_Owner = (Owner of (Triggering unit))
      • Set Custom_Point = (Position of Custom_Caster)
      • Unit - Create 1 Dummy for Custom_Owner at Custom_Point facing Default building facing degrees
      • Set Custom_Dummy = (Last created unit)
      • Unit - Add Solar Flame Dummy to Custom_Dummy
      • Unit - Set level of Solar Flame Dummy for Custom_Dummy to (Level of Solar Flame for Custom_Caster)
      • Unit - Add a 2.00 second Generic expiration timer to Custom_Dummy
      • Set Custom_Group = (Units within 750.00 of Custom_Point)
      • Unit Group - Pick every unit in Custom_Group and do (Actions)
        • Loop - Actions
          • Set CustomTarget = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CustomTarget belongs to an enemy of Custom_Owner) Equal to False
              • (CustomTarget is alive) Equal to True
            • Then - Actions
              • Unit - Order Custom_Dummy to Human Priest - Inner Fire CustomTarget
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Custom_Point)
      • Custom script: call DestroyGroup(udg_Custom_Group)

The next I tried to turn a single target spell into a multiple target within an area (entangling roots), but I wanted to make a projectile that would move towards that area and only then begin the spell effect itself. The caster would throw a projectile into the target, and only after the entangle would occur.
  • Woe of War
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Woe of War
    • Actions
      • Set Spell_Variation_Level[1] = (Level of Woe of War for (Casting unit))
      • Unit - Create 1 Woe of War dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Position of (Target unit of ability being cast))
      • Set Spell_Variation_Dummy[1] = (Last created unit)
      • Set Spell_Variation_Dummy[2] = (Target unit of ability being cast)
      • Trigger - Turn on Woe of War Loop <gen>
  • Woe of War Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Spell_Variation_Dummy[1] instantly to ((Position of Spell_Variation_Dummy[1]) offset by 45.00 towards (Angle from (Position of Spell_Variation_Dummy[1]) to (Position of Spell_Variation_Dummy[2])) degrees), facing (Position of Spell_Variation_Dummy[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of Spell_Variation_Dummy[1]) and (Position of Spell_Variation_Dummy[2])) Less than or equal to 100.00
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 305.00 of (Position of Spell_Variation_Dummy[2])) and do (Actions)
            • Loop - Actions
              • Unit - Create 1 Dummy for (Owner of Spell_Variation_Caster[1]) at (Position of Spell_Variation_Dummy[2]) facing Default building facing degrees
              • Unit - Add Woe of War dummy to (Last created unit)
              • Unit - Set level of Woe of War dummy for (Last created unit) to Spell_Variation_Level[1]
              • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Kill Spell_Variation_Dummy[1]
          • Set Spell_Variation_Dummy[1] = No unit
          • Set Spell_Variation_Dummy[2] = No unit
          • Trigger - Turn off (This trigger)
        • Else - Actions

Thanks in advance.
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
The first one is a spell that will increase all allies' armor by 9999, making them immune to physical damage (sort of). I'm using Inner Fire to add the buff though, because my map is already full of roar based buffs. The point is that only one (sometimes two) random unit within 750 range is receiving the effect (+9999 armor), and can't figure out why.
I'm guessing your dummy unit is still capable of moving which will lead them attempting to turn around and face their target before casting Inner Fire - it slows them down to the point where they just stop casting the spell, in this case. Remove their move ability by setting Move Speed field value to 0 or remove 'Amov' ability through custom script upon creating the dummy unit.

As for the second one, I see that you are creating a dummy unit for "(Owner of Spell_Variation_Caster[1])", but I don't see Spell_Variation_Caster[1] being defined anywhere.
 
Level 5
Joined
Jun 16, 2009
Messages
49
As for the second one, I see that you are creating a dummy unit for "(Owner of Spell_Variation_Caster[1])", but I don't see Spell_Variation_Caster[1] being defined anywhere.

Oh man that is so messed up, I mistook the variables names, it should have been "(Owner of Spell_Variation_Dummy[1])", thanks for pointing it out.

I'm guessing your dummy unit is still capable of moving which will lead them attempting to turn around and face their target before casting Inner Fire - it slows them down to the point where they just stop casting the spell, in this case. Remove their move ability by setting Move Speed field value to 0 or remove 'Amov' ability through custom script upon creating the dummy unit.


I assume that not all dummies requires movement speed set to 0? Because I've used some spells that didn't require that option, or is it something specifically with Inner Fire? Thanks anyway, it's solved.
 
Level 13
Joined
May 10, 2009
Messages
868
I assume that not all dummies requires movement speed set to 0? Because I've used some spells that didn't require that option, or is it something specifically with Inner Fire?
It's not really necessary for all case scenarios. However, in your first trigger there's just one dummy unit to cast inner fire upon all units within range at once. It's best to remove their ability to move, so they don't have to turn towards their target every time they need to repeat casting a spell, which requires some time to do so. You could also create a new dummy unit per target/cast instead of setting their move speed to 0.
 
Status
Not open for further replies.
Top