• 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] Spell Bugging Out

Status
Not open for further replies.
Level 8
Joined
Sep 10, 2013
Messages
372
WHAT I DID:
I made an aoe custom spell based on 'Silence' for a hero to teleport to the center of the area and deal damage to units in that area. Anyways, the spell works fine, everything checks out, the damage, the locations, everything... except one little thing.

One little thing about the spell, I modified the spell's properties in the object editor. I modified the 'Chance to Miss' field and unchecked everything from the 'Attacks Prevented' field, so that the spell itself without the trigger would prevent no attack or spell type but cause enemy units to miss on attacks.

THE PROBLEM:
Very often when I cast the spell, it uses no mana, it deals full damage and it needs no cooldown; so I can just spam it indifinitely causing massive damage in very little time. However once in a while, it works fine, with cooldown and it even consumes the set mana. Now, I have no idea what causes that, I've never seen it before.

I'll post the spell trigger here because maybe I caused it to glitch out with the triggers somehow...

REQUEST:
Please tell me what causes this so I can fix it.
Also, if the 'Chance to Miss' field is the reason for this problem, please tell me how I could cause many units in an area to miss on attacks using triggers.

  • TeleportStrike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Teleport Strike
    • Actions
      • Set TeleportStrike_Caster = (Casting unit)
      • Set Caster_Agi = (Agility of TeleportStrike_Caster (Include bonuses))
      • Set TeleportStrike_Level = (Level of Teleport Strike for TeleportStrike_Caster)
      • Set TeleportStrike_CasterLoc = (Position of TeleportStrike_Caster)
      • Set TeleportStrike_TargetLoc = (Target point of ability being cast)
      • Set TeleportStrike_Area = (((Real(TeleportStrike_Level)) x 25.00) + 125.00)
      • Set TeleportStrike_Targets = (Units within TeleportStrike_Area of TeleportStrike_TargetLoc matching ((Owner of (Matching unit)) Not equal to (Owner of TeleportStrike_Caster)))
      • Unit - Turn collision for TeleportStrike_Caster Off
      • Animation - Play TeleportStrike_Caster's spell throw animation
      • Special Effect - Create a special effect at TeleportStrike_CasterLoc using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.33 seconds
      • Unit - Move TeleportStrike_Caster instantly to TeleportStrike_TargetLoc
      • Special Effect - Create a special effect at TeleportStrike_CasterLoc using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.10 seconds
      • Special Effect - Create a special effect at TeleportStrike_TargetLoc using DarkNova.mdx
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in TeleportStrike_Targets and do (Actions)
        • Loop - Actions
          • Unit - Cause TeleportStrike_Caster to damage (Picked unit), dealing ((Real(Caster_Agi)) x ((Real(TeleportStrike_Level)) x 2.00)) damage of attack type Spells and damage type Poison
      • Unit - Turn collision for TeleportStrike_Caster On
      • Custom script: call RemoveLocation(udg_TeleportStrike_CasterLoc)
      • Custom script: call RemoveLocation(udg_TeleportStrike_TargetLoc)
      • Custom script: call DestroyGroup(udg_TeleportStrike_Targets)
 
Last edited:

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
Not sure but using a wait may cause lag or leak something like that as I read in many threads.

They do not cause leaks (directly) but they usually screw the code over completely because people don't know how to use them.

In this case, I would be surprised if the code worked with waits.
 
Last edited:
Level 8
Joined
Sep 10, 2013
Messages
372
They do not cause leaks (directly) but they usually screw the code over completely because people don't know how to use them.

In this case, I would be surprised if the code worked with waits.

I made a couple of spells with Wait commands and they never caused any issues. This case is no different.

I changed the trigger to this:

  • TeleportStrike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Teleport Strike
    • Actions
      • Set TeleportStrike_Caster = (Casting unit)
      • Set Caster_Agi = (Agility of TeleportStrike_Caster (Include bonuses))
      • Set TeleportStrike_Level = (Level of Teleport Strike for TeleportStrike_Caster)
      • Set TeleportStrike_CasterLoc = (Position of TeleportStrike_Caster)
      • Set TeleportStrike_TargetLoc = (Target point of ability being cast)
      • Set TeleportStrike_Area = (((Real(TeleportStrike_Level)) x 25.00) + 125.00)
      • Animation - Play TeleportStrike_Caster's spell throw animation
      • Special Effect - Create a special effect at TeleportStrike_CasterLoc using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.33 seconds
      • Special Effect - Create a special effect at TeleportStrike_TargetLoc using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.10 seconds
      • Unit - Move TeleportStrike_Caster instantly to TeleportStrike_TargetLoc
      • Special Effect - Create a special effect at TeleportStrike_TargetLoc using DarkNova.mdx
      • Special Effect - Destroy (Last created special effect)
      • Set TeleportStrike_Targets = (Units within TeleportStrike_Area of TeleportStrike_TargetLoc matching ((Owner of (Matching unit)) Not equal to (Owner of TeleportStrike_Caster)))
      • Unit Group - Pick every unit in TeleportStrike_Targets and do (Actions)
        • Loop - Actions
          • Unit - Cause TeleportStrike_Caster to damage (Picked unit), dealing ((Real(Caster_Agi)) x ((Real(TeleportStrike_Level)) x 2.00)) damage of attack type Spells and damage type Poison
      • Custom script: call RemoveLocation(udg_TeleportStrike_CasterLoc)
      • Custom script: call RemoveLocation(udg_TeleportStrike_TargetLoc)
      • Custom script: call DestroyGroup(udg_TeleportStrike_Targets)


Basically I changed the Event to 'Begins the effect of an Ability', and I moved:
  • Set TeleportStrike_Targets = (Units within TeleportStrike_Area of TeleportStrike_TargetLoc matching ((Owner of (Matching unit)) Not equal to (Owner of TeleportStrike_Caster)))
To just before the damage trigger. Now it works fine with cooldowns and the correct mana cost.

Thanks guys.
 
Status
Not open for further replies.
Top