[Spell] This ability really needs some fixes...

Level 15
Joined
Jul 19, 2007
Messages
855
I have imported an ability named "Dopple Orb" from a spellpack and it works like this. Shoot a Haunting Orb that when it collides with an enemy, it dissipates, dealing 80 damage to units in 220 AOE range, and creating a doppleganger of them for a short time. The dopplegangers lasts 15 seconds.

The problem is that it seems to even create dopplegangers of allied units too and dopplegangers of cropses! I want it to ONLY create dopplegangers of enemies that is hit by the orb and I don't want it to create dopplegangers of "Heroes", "Giants" or "Ancients" but I dunno really how to solve that.

And the last thing I want is that the dopplegangers should take 500% increased damage, like you can do with illusions of the "Mirror Image" ability.

  • Dopple Orb Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Haunt
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Casting unit)) Equal to (Player((Integer A)))
            • Then - Actions
              • Set VariableSet DO_Units[(Integer A)] = (Casting unit)
              • Set VariableSet DO_Target[(Integer A)] = (Target unit of ability being cast)
              • Set VariableSet DO_Point[(Integer A)] = (Position of DO_Units[(Integer A)])
              • Unit - Create 1 HauntDummy for (Owner of DO_Units[(Integer A)]) at DO_Point[(Integer A)] facing Default building facing degrees
              • Set VariableSet DO_Dummies[(Integer A)] = (Last created unit)
              • Unit - Order (Last created unit) to Attack DO_Target[(Integer A)]
              • Custom script: call RemoveLocation (udg_DO_Point[bj_forLoopAIndex])
            • Else - Actions
  • Dopple Orb Periodic
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Order DO_Dummies[(Integer A)] to Attack DO_Target[(Integer A)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DO_Dummies[(Integer A)] is alive) Equal to True
              • (Number of units in (Units within 75.00 of (Position of DO_Dummies[(Integer A)]) matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)) and (((Owner of (Matching unit)) is an enemy of (Owner of DO_Du Greater than or equal to 1
            • Then - Actions
              • Set VariableSet DummiesGroup[(Integer A)] = (Units within (220.00 x 1.00) of (Position of DO_Dummies[(Integer A)]) matching ((((Owner of DO_Target[(Integer A)]) is an enemy of (Owner of DO_Dummies[(Integer A)]).) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching uni
              • Unit Group - Pick every unit in DummiesGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Unit - Cause DO_Dummies[(Integer A)] to damage (Picked unit), dealing (85.00 x 1.00) damage of attack type Spells and damage type Universal
              • Unit Group - Remove all units of DummiesGroup[(Integer A)] from DummiesGroup[(Integer A)].
              • Set VariableSet DummiesGroup[(Integer A)] = (Units within (220.00 x 1.00) of (Position of DO_Dummies[(Integer A)]) matching ((((Owner of DO_Target[(Integer A)]) is an enemy of (Owner of DO_Dummies[(Integer A)]).) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching uni
              • Unit Group - Pick every unit in DummiesGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Set VariableSet DO_Point[(Integer A)] = (Position of (Picked unit))
                  • Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of DO_Dummies[(Integer A)]) at DO_Point[(Integer A)] facing ((Facing of (Picked unit)) - 180.00) degrees
                  • Animation - Change (Last created unit)'s vertex coloring to (0.00%, 55.00%, 100.00%) with 15.00% transparency
                  • Unit - Add a (15.00 x 1.00) second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation (udg_DO_Point[bj_forLoopAIndex])
              • Unit - Explode DO_Dummies[(Integer A)].
              • Unit Group - Remove all units of DummiesGroup[(Integer A)] from DummiesGroup[(Integer A)].
            • Else - Actions
 
Level 13
Joined
Feb 5, 2018
Messages
567
I want it to ONLY create dopplegangers of enemies that is hit by the orb and I don't want it to create dopplegangers of "Heroes", "Giants" or "Ancients" but I dunno really how to solve that.
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to False
          • ((Picked unit) is alive) Equal to True
          • ((Picked unit) is An Ancient) Equal to False
        • Then - Actions
        • Else - Actions
You need to filter the targets in the "Pick every unit in unit group" action and add the things you want.


Do you have other "Loop integer A" triggers running at the same time?

Start by creating a new global integer Variable called "Dopple Orb Loop" and change all the For Integer A to
For each VARIABLE intger "Dobble Orb Loop" do actions 1 to 12

Loop Integer A is a global function and will cause issues with other abilities if used multiple times over in different
triggers.

Is the idea of the spell to shoot 12 orbs or just one orb? Im confused.
And the last thing I want is that the dopplegangers should take 500% increased damage, like you can do with illusions of the "Mirror Image" ability.
This is is easy

You can either use a damage engine or if you are in the latest patch you can do this:
  • Do Image
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Unit-type of (Damage Target)) Equal to Footman
    • Actions
      • Unit - Cause (Damage source) to damage (Damage Target), dealing ((Damage taken) x 5.00) damage of attack type Spells and damage type Magic
 
Level 15
Joined
Jul 19, 2007
Messages
855
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to False
          • ((Picked unit) is alive) Equal to True
          • ((Picked unit) is An Ancient) Equal to False
        • Then - Actions
        • Else - Actions
You need to filter the targets in the "Pick every unit in unit group" action and add the things you want.


Do you have other "Loop integer A" triggers running at the same time?

Start by creating a new global integer Variable called "Dopple Orb Loop" and change all the For Integer A to
For each VARIABLE intger "Dobble Orb Loop" do actions 1 to 12

Loop Integer A is a global function and will cause issues with other abilities if used multiple times over in different
triggers.

Is the idea of the spell to shoot 12 orbs or just one orb? Im confused.

This is is easy

You can either use a damage engine or if you are in the latest patch you can do this:
  • Do Image
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Unit-type of (Damage Target)) Equal to Footman
    • Actions
      • Unit - Cause (Damage source) to damage (Damage Target), dealing ((Damage taken) x 5.00) damage of attack type Spells and damage type Magic
The spell only shoots 1 orb. I changed all "Integer A" to "DobbleOrbLoop" but now the spell seems to not damage any units at all and not creating any doopledangers... Do I have to change this "custom script" too?
custom.png
 

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
I'm not sure if the spell is MUI.. but it looks MPI.

Firstly, change
  • For each (Integer A) from 1 to 12, do (Actions)
=>
  • For each (YourIntegerVariable) from 1 to 12, do (Actions)
and make sure to replace all the array variables that previously used Integer A with YourIntegerVariable.
That also means you have to change the custom scripts a tad bit into something like this
  • Custom script: call RemoveLocation(udg_DO_Point[bj_forLoopAIndex])
=>
  • Custom script: call RemoveLocation(udg_DO_Point[udg_YourIntegerVariable])
or else, the memory leaks will not be removed.

But about the 500% increased damage taken, how can I actually make so it only happens on doopleganger-units?
You can add the dopplegangers into a unit group variable first after you create them.
Next, when the event damage is taken fires, you can check first if the unit is in the group. If it's a yes, that unit is your doppleganger units, make them take 500% increased damage then.
 
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
855
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to False
          • ((Picked unit) is alive) Equal to True
          • ((Picked unit) is An Ancient) Equal to False
        • Then - Actions
        • Else - Actions
I did that but still it creates dopplegangers of allied units or dead units... It's very wierd why this is happening and it is supposed to only create dopplegangers of units who got damaged by the orb but it doesn't :-/
 
Level 13
Joined
Feb 5, 2018
Messages
567
I am still confused why would we always iterate trough the units twelve times if the idea is to launch one single orb.

Maybe you could just use an index counter. Also the loop is never turning off, which is bad.

I don't think the unit group(s) needs to be indexed either.

Check this:


Also this spell could be made with the realistic missile system, would be way more simpler. Also this would automatically turn the spell into MUI, since the missile code handles everything on from the trigger where you launch the missile. Also with the missile system it automatically checks if the missile has reached it's destination so you wouldn't need to run any loop trigger of your own.


  • Dobble Orb
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dobble Orb
    • Actions
      • -------- SPELL SET UP --------
      • Set VariableSet Do_Caster = (Triggering unit)
      • Set VariableSet Do_Level = (Level of Dobble Orb for Do_Caster)
      • Set VariableSet Do_Damage = (90.00 x (Real(Do_Level)))
      • Set VariableSet Do_Owner = (Owner of Do_Caster)
      • -------- LOCATIONS --------
      • Set VariableSet Do_Start = (Position of Do_Caster)
      • Set VariableSet Do_Finish = (Target point of ability being cast)
      • -------- MISSILE SET UP --------
      • Set VariableSet MissileStart = Do_Start
      • Set VariableSet MissileFinish = Do_Finish
      • Set VariableSet MissileStartZ = 50.00
      • -------- -------------- --------
      • Set VariableSet MissileOwner = Do_Owner
      • Set VariableSet MissileDamage = Do_Damage
      • Set VariableSet MissileSpeed = 800.00
      • Set VariableSet MissileModel = Abilities\Weapons\ZigguratMissile\ZigguratMissile.mdl
      • -------- LAUNCH MISSILE --------
      • Set VariableSet Missile_onFinish = Dobble Orb Finish <gen>
      • Trigger - Run MissileCreate <gen> (ignoring conditions)
      • -------- CLEAN UP --------
      • Custom script: call RemoveLocation (udg_Do_Start)
      • Custom script: call RemoveLocation (udg_Do_Finish)
  • Dobble Orb Finish
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 225.00 of MissileFinish matching (((Matching unit) is alive) Equal to True).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of MissileSource).) Equal to True
              • ((Picked unit) is invulnerable) Equal to False
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
              • ((Picked unit) is An Ancient) Equal to False
            • Then - Actions
              • Unit - Create 1 (Unit-type of (Picked unit)) for MissileOwner at MissileFinish facing Default building facing degrees
              • Set VariableSet Do_Dummy = (Last created unit)
              • Unit - Add a 15.00 second Generic expiration timer to Do_Dummy
              • -------- And last here we could add the Do_Dummy to unit group or --------
              • -------- we could add a hidden ability for the 5X damage taken trigger --------
              • Unit - Cause MissileSource to damage (Picked unit), dealing MissileDamage damage of attack type Spells and damage type Magic
            • Else - Actions
              • -------- Filter Only --------
 
Level 15
Joined
Jul 19, 2007
Messages
855
I am still confused why would we always iterate trough the units twelve times if the idea is to launch one single orb.

Maybe you could just use an index counter. Also the loop is never turning off, which is bad.

I don't think the unit group(s) needs to be indexed either.

Check this:


Also this spell could be made with the realistic missile system, would be way more simpler. Also this would automatically turn the spell into MUI, since the missile code handles everything on from the trigger where you launch the missile. Also with the missile system it automatically checks if the missile has reached it's destination so you wouldn't need to run any loop trigger of your own.


  • Dobble Orb
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dobble Orb
    • Actions
      • -------- SPELL SET UP --------
      • Set VariableSet Do_Caster = (Triggering unit)
      • Set VariableSet Do_Level = (Level of Dobble Orb for Do_Caster)
      • Set VariableSet Do_Damage = (90.00 x (Real(Do_Level)))
      • Set VariableSet Do_Owner = (Owner of Do_Caster)
      • -------- LOCATIONS --------
      • Set VariableSet Do_Start = (Position of Do_Caster)
      • Set VariableSet Do_Finish = (Target point of ability being cast)
      • -------- MISSILE SET UP --------
      • Set VariableSet MissileStart = Do_Start
      • Set VariableSet MissileFinish = Do_Finish
      • Set VariableSet MissileStartZ = 50.00
      • -------- -------------- --------
      • Set VariableSet MissileOwner = Do_Owner
      • Set VariableSet MissileDamage = Do_Damage
      • Set VariableSet MissileSpeed = 800.00
      • Set VariableSet MissileModel = Abilities\Weapons\ZigguratMissile\ZigguratMissile.mdl
      • -------- LAUNCH MISSILE --------
      • Set VariableSet Missile_onFinish = Dobble Orb Finish <gen>
      • Trigger - Run MissileCreate <gen> (ignoring conditions)
      • -------- CLEAN UP --------
      • Custom script: call RemoveLocation (udg_Do_Start)
      • Custom script: call RemoveLocation (udg_Do_Finish)
  • Dobble Orb Finish
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 225.00 of MissileFinish matching (((Matching unit) is alive) Equal to True).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of MissileSource).) Equal to True
              • ((Picked unit) is invulnerable) Equal to False
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
              • ((Picked unit) is An Ancient) Equal to False
            • Then - Actions
              • Unit - Create 1 (Unit-type of (Picked unit)) for MissileOwner at MissileFinish facing Default building facing degrees
              • Set VariableSet Do_Dummy = (Last created unit)
              • Unit - Add a 15.00 second Generic expiration timer to Do_Dummy
              • -------- And last here we could add the Do_Dummy to unit group or --------
              • -------- we could add a hidden ability for the 5X damage taken trigger --------
              • Unit - Cause MissileSource to damage (Picked unit), dealing MissileDamage damage of attack type Spells and damage type Magic
            • Else - Actions
              • -------- Filter Only --------
Well if anyone could recreate this ability and make it work correctly then I would be very thankful. I know nothing about JASS or Lua so I do not even dare to try...
 
Level 13
Joined
Feb 5, 2018
Messages
567
Well if anyone could recreate this ability and make it work correctly then I would be very thankful. I know nothing about JASS or Lua so I do not even dare to try..
You don't really need to understand the code of the Missile System. Only how to use premade variables, which I used in my example. Same is with all of the systems, they are a really cool addition and with the combination of missile systmem + damage engine + knockback 2.5D you can really make something :D

The maps also come with example triggers which gives you lots of information. I understand using these systems and the editor can be a daunting task at times, but when you learn how to make the cool spells really just by using GUI the fun starts.

Anyways I don't want to be mean, so I made a testmap for you. I also fixed the position on one event so the units are now created to their respective positions instead of all of them being created on the "MissileFinish" point. I however left some parts out which you need to fill in:
-Recolor the animated units
-Add some special effect for eye candy
-Create custom text for your ability
-Create a unique ability or unit group and add that to the DO_UNITS so that they receive the 5X damage from all sources
-Create the damage trigger for the above

EDIT: Uploaded the map forgot one line of trigger
  • Set VariableSet MissileSource = Do_Caster
EDIT:2 Added a fixed map with the locations fixed as Uncle mentioned.
 

Attachments

  • Dobble Orb Fixed.w3m
    80.1 KB · Views: 4
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
FYI DoomBlade, you don't want those Do_Start and Do_Finish variables. The system will handle the memory leaks for you, just set MissileStart and MissileFinish to the desired positions -> Position of caster, Target point of ability being cast.

In fact, you're actually destroying the MissileStart and MissileFinish variables in your clean up step. This is unnecessary and could break the system. This is because you're pointing the MissileStart variable to the Do_Start variable which makes them represent the same "Location". So when you destroy Do_Start you will also destroy MissileStart as well.
 
Last edited:
Level 13
Joined
Feb 5, 2018
Messages
567
FYI DoomBlade, you don't want those Do_Start and Do_Finish variables. The system will handle the memory leaks for you, just set MissileStart and MissileFinish to the desired positions.
Woops forgot about that. I just took a very old example trigger from one of my projects. A fair point tho.
 
Level 15
Joined
Jul 19, 2007
Messages
855
You don't really need to understand the code of the Missile System. Only how to use premade variables, which I used in my example. Same is with all of the systems, they are a really cool addition and with the combination of missile systmem + damage engine + knockback 2.5D you can really make something :D

The maps also come with example triggers which gives you lots of information. I understand using these systems and the editor can be a daunting task at times, but when you learn how to make the cool spells really just by using GUI the fun starts.

Anyways I don't want to be mean, so I made a testmap for you. I also fixed the position on one event so the units are now created to their respective positions instead of all of them being created on the "MissileFinish" point. I however left some parts out which you need to fill in:
-Recolor the animated units
-Add some special effect for eye candy
-Create custom text for your ability
-Create a unique ability or unit group and add that to the DO_UNITS so that they receive the 5X damage from all sources
-Create the damage trigger for the above

EDIT: Uploaded the map forgot one line of trigger
  • Set VariableSet MissileSource = Do_Caster
EDIT:2 Added a fixed map with the locations fixed as Uncle mentioned.
Thanks but I tried to import it into my map but it ended up with 1000000000 of errors on the missile system...
 
Level 15
Joined
Jul 19, 2007
Messages
855
Did you enable jasshelper in the trigger editor? It automatically turns off when you open a new map (just blizzard features I guess).
No it's not because of that. Actually I already had some of the "Missiles" triggers in my map but an older version so they conflict with each other and also I got TimerUtilsEx instead of TimerUtils because I've read it's a better version but I removed the old "Missile" triggers and the "TimerUtils" trigger but still I get some errors.
error.png
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Did you enable jasshelper in the trigger editor? It automatically turns off when you open a new map (just blizzard features I guess).
ex.png

He may be experiencing issues with the systems that Missiles relies on. Also, make sure that the system folder is at the top of the trigger hierarchy.

Edit: Whoops, posted at the same time.
 
Level 15
Joined
Jul 19, 2007
Messages
855
Add those dopplegangers you created into a unit group.
Use damage engine or the new native to detect when a unit is taking damage.
If the unit's taking damage is in the unit group, it means they're one of the dopplegangers.
Make them receive 500% damage.
I'm not sure how to add them in to groups. I'm using Bribe's Damage Engine in my map so I guess I have to stick with it.
 
Level 15
Joined
Jul 19, 2007
Messages
855
It's called DamageEventAmount. It's literally in the description of the damage engine system... Please read it again.
Like this?
  • Dobble Orb Damage Amplification
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (DamageEventTarget is in DooplegangerGroup.) Equal to True
    • Actions
      • Set VariableSet DamageEventAmount = (DamageEventAmount x 5.00)
 

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
I think you have incorrect event for Bribe's Damage Engine. If I remember correctly, the event should be:
  • Dobble Orb Damage Amplification
    • Events
      • Game - OnDamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in DooplegangerGroup.) Equal to True
    • Actions
      • Set VariableSet DamageEventAmount = (DamageEventAmount x 5.00)
Please correct me if I'm wrong, I haven't used Bribe's Damage Engine for a while now.
 
Level 15
Joined
Jul 19, 2007
Messages
855
I think you have incorrect event for Bribe's Damage Engine. If I remember correctly, the event should be:
  • Dobble Orb Damage Amplification
    • Events
      • Game - OnDamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in DooplegangerGroup.) Equal to True
    • Actions
      • Set VariableSet DamageEventAmount = (DamageEventAmount x 5.00)
Please correct me if I'm wrong, I haven't used Bribe's Damage Engine for a while now.
Oh thank you it worked now!
 
Top