• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Spell] Trigger

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2012
Messages
101
Something's wrong please help

  • Invisibility 1 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Entering unit) Equal to InvisibilityCasterCopy1
    • Actions
      • Unit - Order InvisibilityCasterCopy1 to Move To (Random point in (Playable map area))
      • Wait 1.50 seconds
      • Unit Group - Add all units of (Units within 210.00 of (Position of InvisibilityCasterCopy1)) to InvisibilityGroup[1]
      • Set InvisibilityGroup[1] = (Last created unit group)
      • Unit Group - Pick every unit in InvisibilityGroup[1] and do (Actions)
        • Loop - Actions
          • Unit Group - Remove InvisibilityCaster1 from InvisibilityGroup[1]
          • Unit - Cause InvisibilityCaster1 to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Normal
      • Unit - Kill InvisibilityCasterCopy1
      • Special Effect - Create a special effect at (Position of InvisibilityCasterCopy1) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
Units within 210 range doesn't take damage.
 
Level 6
Joined
Mar 9, 2013
Messages
189
the Loop-Actions removes the unit from the pick group before it is damaged, it then won't take damage because it is no longer in the group, so no longer a picked unit. I think swapping the two around might help.
 
Level 25
Joined
May 11, 2007
Messages
4,650
Also, not sure if this is needed..
Unit Group - Add all units of (Units within 210.00 of (Position of InvisibilityCasterCopy1)) to InvisibilityGroup[1]
Set InvisibilityGroup[1] = (Last created unit group)

As you are already adding the units to InvisibilityGroup[1].
And as always, fix the leaks.
 
Level 6
Joined
Nov 5, 2013
Messages
132
[Fixin' Mode status ON]

Remove the Set variable action :)

You already are adding the units to the group with the Unit group action so you don't need set any var.
Oh, and you can pick every unit within x of the InvisibilityCasterCopy1 to start the loop action (more easy for you).
 
Level 10
Joined
Apr 18, 2009
Messages
576
As the two posters above me already pointed out, remove this line:
  • Set InvisibilityGroup[1] = (Last created unit group)
In addition to that indispensable wisdom, I can also contribute with an emotionally deep and highly accurate manifestation of your feelings when discovering this problem (see attached piece of art).
Something's wrong please help
 

Attachments

  • somethingwrong.mp3
    19.6 KB · Views: 47
Level 5
Joined
Jul 15, 2012
Messages
101
If i remove that, then i take the damage. I want that skill to make that casting unit invisible, make his copy, and then explode that copy and i want casting unit not to take the damage.
 
Level 25
Joined
May 11, 2007
Messages
4,650
What I would probably do, would just to have your spell create a unit, add 1.5 seconds of timed life, then have another trigger that checks for when a unit of the unit-type dies.

Then set temppoint1 = position of dying unit
set tempgroup1 = all units matching unit is an enemy of owner of dying unit within 210 radius
create a tempunit or use the dying unit to damage the units in the tempgroup1,
create a specialeffect with the flamestrike
destroy it

clearup temppoint1 and destroy the tempggroup1.
 
Level 10
Joined
Apr 18, 2009
Messages
576
Here's how I'd probably do it (if I understand what you want to do correctly):

Make two triggers. The first trigger adds a 1.5 second expiration timer to the InvisibilityCasterCopy1 unit when that unit enters the map. Then the trigger issues InvisibilityCasterCopy1 to move to a random location.
  • Caster Copy Enters Map
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Entering unit) Equal to InvisibilityCasterCopy1
    • Actions
      • Unit - Add a 1.50 second Generic expiration timer to InvisibilityCasterCopy1
      • Unit - Order InvisibilityCasterCopy1 to Move To (Random point in (Playable map area))
When the expiration timer on InvisibilityCasterCopy1 expires after 1.5 seconds, InvisibilityCasterCopy1 dies. The other trigger will fire off when InvisibilityCasterCopy1 dies. This second trigger would then create a special effect on the position of InvisibilityCasterCopy1. Then it picks every unit within 210 range of InvisibilityCasterCopy1 that are not InvisibilityCaster1, and cause InvisibilityCasterCopy1 to damage them.
  • Caster Copy Death Explosion
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to InvisibilityCasterCopy1
    • Actions
      • Special Effect - Create a special effect at (Position of InvisibilityCasterCopy1) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in (Units within 210.00 of (Position of InvisibilityCasterCopy1) matching ((Matching unit) Not equal to InvisibilityCaster1)) and do (Actions)
        • Loop - Actions
          • Unit - Cause InvisibilityCasterCopy1 to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Normal
Here are the same two triggers rewritten in a more optimal fashion with no memory leaks:
  • Caster Copy Enters Map OPTIMIZED
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Triggering unit) Equal to InvisibilityCasterCopy1
    • Actions
      • Unit - Add a 1.50 second Generic expiration timer to InvisibilityCasterCopy1
      • Set Temp_Point_A = (Random point in (Playable map area))
      • Unit - Order InvisibilityCasterCopy1 to Move To Temp_Point_A
      • Custom script: call RemoveLocation(udg_Temp_Point_A)
  • Caster Copy Death Explosion OPTIMIZED
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to InvisibilityCasterCopy1
    • Actions
      • Set Temp_Point_A = (Position of InvisibilityCasterCopy1)
      • Special Effect - Create a special effect at Temp_Point_A using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set Temp_Group_A = (Units within 210.00 of Temp_Point_A matching ((Matching unit) Not equal to InvisibilityCaster1))
      • Custom script: call RemoveLocation(udg_Temp_Point_A)
      • Unit Group - Pick every unit in Temp_Group_A and do (Actions)
        • Loop - Actions
          • Unit - Cause InvisibilityCasterCopy1 to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Normal
      • Custom script: call DestroyForce(udg_Temp_Group_A)
The same triggers are also in the attached map.
 

Attachments

  • Example Triggers.w3x
    17 KB · Views: 49
Status
Not open for further replies.
Top