Help with a spell trigger?

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
So, I have always wanted to make a spell like the arrow of the Priestess of the Moon from DotA. I have finally found a way to make such a spell - hashtables.
But there is something I can not figure out.
Here is the trigger problem:

  • Toxin Projectile Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TP_Group and do (Actions)
        • Loop - Actions
          • Set TP_Posit = (Position of (Picked unit))
          • Set TP_Degree = (Load (Key Toxin_Angle) of (Key (Picked unit)) from Toxin_Pr_Hash)
          • Set TP_Time = (Load (Key Toxin_Time) of (Key (Picked unit)) from Toxin_Pr_Hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TP_Time Greater than 0.00
            • Then - Actions
              • Unit - Order (Picked unit) to Move To (TP_Posit offset by 135.00 towards TP_Degree degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Region centered at TP_Posit with size (70.00, 70.00)) contains (Random unit from (Units owned by (Random player from (All enemies of (Owner of (Picked unit))))))) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at TP_Posit using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
                  • Special Effect - Create a special effect at TP_Posit using Units\NightElf\Wisp\WispExplode.mdl
                  • Unit - Order (Picked unit) to Neutral - Kaboom! TP_Posit
                  • Unit Group - Remove (Picked unit) from TP_Group
                  • Custom script: call RemoveLocation( udg_TP_Posit )
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Toxin_Pr_Hash
                • Else - Actions
                  • Hashtable - Save (TP_Time - 1.00) as (Key Toxin_Time) of (Key (Picked unit)) in Toxin_Pr_Hash
            • Else - Actions
              • Special Effect - Create a special effect at TP_Posit using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
              • Special Effect - Create a special effect at TP_Posit using Units\NightElf\Wisp\WispExplode.mdl
              • Unit - Order (Picked unit) to Neutral - Kaboom! TP_Posit
              • Unit Group - Remove (Picked unit) from TP_Group
              • Custom script: call RemoveLocation( udg_TP_Posit )
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Toxin_Pr_Hash



I wanted to ask what the condition in the SECOND If/Then/Else func should be ? (The one when the projectile meets a hostile unit) I just can't figure it out ...
That is the problem part:

  • If - Conditions
    • ((Region centered at TP_Posit with size (70.00, 70.00)) contains (Random unit from (Units owned by (Random player from (All enemies of (Owner of (Picked unit))))))) Equal to True

Please give some ideas
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Set the position of the projectile into a variable, then pick every hostile unit within some range and save that unit group into a variable also. Then check whether the unit group is empty or not. That's more accurate than using a rectangle.

  • Unit - Order (Picked unit) to Move To (TP_Posit offset by 135.00 towards TP_Degree degrees)

The offset location leaks.

You need to destroy those special effects.
 
Last edited:
Level 15
Joined
Nov 26, 2005
Messages
1,151
Set the position of the projectile into a variable, then pick every hostile unit within some range and save that unit group into a variable also. Then check wheter the unit griup is empty or not. That's more accurate than using a rectangle.

  • Unit - Order (Picked unit) to Move To (TP_Posit offset by 135.00 towards TP_Degree degrees)

The offset location leaks.

You need to destroy those special effects.

Thank you! Here are my answers:
1. Isn't it already a variable ? (TP_Posit) ? Can you explain how that is going to happen, please

2. How should I fix that leak ?

3. Why and how ?



You can also do it with custom values ...take a look at the spell in my signature.

BUT hashtables is a better way to do it for sure.

Thank you, too!

Can you tell me what are you suggesting custom values for? The exact problem, that I have or the whole trigger ?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Thank you! Here are my answers:
1. Isn't it already a variable ? (TP_Posit) ? Can you explain how that is going to happen, please

2. How should I fix that leak ?

3. Why and how ?

1:
  • Set Temp_Group_1 = (Units within 640.00 of TP_Posit matching ((((Matching unit) is alive) Equal to True)and (*add more conditions if needed*))
  • If (number of units in Temp_Group_1) equal to 0 // you can also use Temp_Group_1 is empty boolean comparison.
  • Then
  • Else
2:
  • TP_Posit2 = TP_Posit offset by...
3:
  • Special Effect - Destroy (last created special effect)
If you don't destroy them, they still eat resources, causing lag.
 
Status
Not open for further replies.
Top