Trigger spell help

Sivert

New Member
Reaction score
0
I'm playing around with triggers creating a spell here, but after I use the spell ing and some time (seconds) passes a massive lag starts, and I can't figure it out.. Another thing is that, if I don't use the spell at lvl 1 before leveling it up it fails to trigger the damage. It's probably not totally optimized, but I haven't made very many custom spells so, and I've done some reworks. I guess I'm gonna need more, but I'm not sure how.

I uploaded a map containing the spell/trigger/dummy and so on.
I'll appreciate all help =)

Here's the trigger:

Trigger:
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to |cffffcc00Z|r Navn
    • Actions
      • Set B_loc = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 1
        • Then - Actions
          • -------- hhere the integer is set, used to calculate dmg --------
          • Set B_integer = (Number of units in (Units within 150.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) or ((((Matching unit) is alive) Equal to True) or ((((Matching unit) is Magic Immune) Equal to False) or (((Owner of (Matching unit)) is an enemy of
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • B_integer Less than or equal to 2
              • B_integer Not equal to 0
            • Then - Actions
              • -------- here is the minimum dmg that only triggers when less than 2 units get hit --------
              • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing 60.00 damage of attack type Spells and damage type Normal
            • Else - Actions
              • -------- the damage is calculated here --------
              • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing ((Real(B_integer)) x 25.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • B_integer Less than or equal to 2
                  • B_integer Not equal to 0
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing 100.00 damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing ((Real(B_integer)) x 35.00) damage of attack type Spells and damage type Normal
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 3
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • B_integer Less than or equal to 2
                      • B_integer Not equal to 0
                    • Then - Actions
                      • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing 140.00 damage of attack type Spells and damage type Normal
                    • Else - Actions
                      • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing ((Real(B_integer)) x 50.00) damage of attack type Spells and damage type Normal
                • Else - Actions
      • -------- i want it to destroy trees too, so I tried to fix that ^^ --------
      • Destructible - Pick every destructible within (75.00 + (75.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) of B_loc and do (Destructible - Kill (Picked destructible))
      • -------- And I figured a little slow could do - --------
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at B_loc facing Default building facing degrees
      • Unit - Add DummySlam (Neutral Hostile) to (Last created unit)
      • Unit - Order (Last created unit) to Neutral - Slam
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • -------- and the special effects - the removal is kinda improvised, but it should work? --------
      • Special Effect - Create a special effect at (B_loc offset by 150.00 towards 90.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE1 = (Last created special effect)
      • Special Effect - Create a special effect at (B_loc offset by 150.00 towards 180.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE2 = (Last created special effect)
      • Special Effect - Create a special effect at (B_loc offset by 150.00 towards 270.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE3 = (Last created special effect)
      • Special Effect - Create a special effect at (B_loc offset by 150.00 towards 360.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE4 = (Last created special effect)
      • Wait 2.00 seconds
      • Special Effect - Destroy B_SE1
      • Special Effect - Destroy B_SE2
      • Special Effect - Destroy B_SE3
      • Special Effect - Destroy B_SE4
      • Custom script: call RemoveLocation(udg_B_loc)
 

Attachments

  • Test Map.w3x
    47.4 KB · Views: 202

Weep

Godspeed to the sound of the pounding
Reaction score
400
Another thing is that, if I don't use the spell at lvl 1 before leveling it up it fails to trigger the damage.

That's because you only set B_integer in the section for when the spell is at level 1. It never gets set if the spell is never cast at level 1 so the spell deals ((Real(B_integer)) x multiplier) = 0 damage.

Also your trigger leaks a lot of memory; points and unit groups. You ought to look at this tutorial.

Lastly, if your spell gets cast again by any unit before ~2 seconds have passed, the variables you use to store the special effects will get overwritten, and the first set of SFX will never be destroyed.
 

Sivert

New Member
Reaction score
0
Trigger:
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to |cffffcc00Z|r Navn
    • Actions
      • Set B_loc = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set B_unitgroup = (Units within 150.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
          • Set B_integer = (Number of units in B_unitgroup)
          • Special Effect - Create a special effect at B_loc using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Set B_SE = (Last created special effect)
          • Special Effect - Create a special effect at (B_loc offset by 125.00 towards 90.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
          • Set B_SE1 = (Last created special effect)
          • Special Effect - Create a special effect at (B_loc offset by 125.00 towards 180.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
          • Set B_SE2 = (Last created special effect)
          • Special Effect - Create a special effect at (B_loc offset by 125.00 towards 270.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
          • Set B_SE3 = (Last created special effect)
          • Special Effect - Create a special effect at (B_loc offset by 125.00 towards 360.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
          • Set B_SE4 = (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • B_integer Less than or equal to 2
              • B_integer Not equal to 0
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing 60.00 damage of attack type Spells and damage type Normal
            • Else - Actions
              • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing ((Real(B_integer)) x 25.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 2
            • Then - Actions
              • Set B_unitgroup = (Units within 225.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
              • Set B_integer = (Number of units in B_unitgroup)
              • Special Effect - Create a special effect at B_loc using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
              • Set B_SE = (Last created special effect)
              • Special Effect - Create a special effect at (B_loc offset by 175.00 towards 90.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
              • Set B_SE1 = (Last created special effect)
              • Special Effect - Create a special effect at (B_loc offset by 175.00 towards 180.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
              • Set B_SE2 = (Last created special effect)
              • Special Effect - Create a special effect at (B_loc offset by 175.00 towards 270.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
              • Set B_SE3 = (Last created special effect)
              • Special Effect - Create a special effect at (B_loc offset by 175.00 towards 360.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
              • Set B_SE4 = (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • B_integer Less than or equal to 2
                  • B_integer Not equal to 0
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing 100.00 damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing ((Real(B_integer)) x 35.00) damage of attack type Spells and damage type Normal
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Set B_unitgroup = (Units within 300.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
                  • Set B_integer = (Number of units in B_unitgroup)
                  • Special Effect - Create a special effect at B_loc using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                  • Set B_SE = (Last created special effect)
                  • Special Effect - Create a special effect at (B_loc offset by 250.00 towards 90.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                  • Set B_SE1 = (Last created special effect)
                  • Special Effect - Create a special effect at (B_loc offset by 250.00 towards 180.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                  • Set B_SE2 = (Last created special effect)
                  • Special Effect - Create a special effect at (B_loc offset by 250.00 towards 270.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                  • Set B_SE3 = (Last created special effect)
                  • Special Effect - Create a special effect at (B_loc offset by 250.00 towards 360.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                  • Set B_SE4 = (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • B_integer Less than or equal to 2
                      • B_integer Not equal to 0
                    • Then - Actions
                      • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing 140.00 damage of attack type Spells and damage type Normal
                    • Else - Actions
                      • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing ((Real(B_integer)) x 50.00) damage of attack type Spells and damage type Normal
                • Else - Actions
      • Destructible - Pick every destructible within (75.00 + (75.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) of B_loc and do (Destructible - Kill (Picked destructible))
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at B_loc facing Default building facing degrees
      • Unit - Add DummySlam (Neutral Hostile) to (Last created unit)
      • Unit - Set level of DummySlam (Neutral Hostile) for (Last created unit) to (Level of |cffffcc00Z|r Navn for (Triggering unit))
      • Unit - Order (Last created unit) to Neutral - Slam
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Custom script: call DestroyGroup(udg_B_unitgroup)
      • Wait 1.00 seconds
      • Special Effect - Destroy B_SE
      • Special Effect - Destroy B_SE1
      • Special Effect - Destroy B_SE2
      • Special Effect - Destroy B_SE3
      • Special Effect - Destroy B_SE4


I missed that I didn't set the loc at lvl 2/3, thanks for pointing that out :)

I tried taking away some leaks. I added the effects on every level, and are removed at the end of the trigger (I think). I added a unit group that is removed at the end of the trigger, as the point is also. Now I would think I removed the leaks, but I'm still insecure about the destructable thing at the end:

Trigger:
  • Destructible - Pick every destructible within (75.00 + (75.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) of B_loc and do (Destructible - Kill (Picked destructible))


I'm not familiar with any way of removing that group, if it even leaks. Sometimes lag occurs, but its situational - not sure why.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Almost there :thup: - you're still leaking points when creating the special effects. You need to set a new point variable to the point-with-offset result, and destroy that before re-setting it to a new value.

It still has the problem where the variables you're using to store the SFX could be overwritten if the spell is cast again within that 1 second wait. Not much you can do about that without getting into JASS and local variables.

I've read that destructible groups don't leak.
 

Sivert

New Member
Reaction score
0
Was this the correct way to go? The spell effects are working properly atleast. Thank you very much for your help btw =)

Trigger:
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to |cffffcc00Z|r Navn
    • Actions
      • Set B_loc = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set B_unitgroup = (Units within 150.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
          • Set B_integer = (Number of units in B_unitgroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • B_integer Less than or equal to 2
              • B_integer Not equal to 0
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing 60.00 damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_B_unitgroup)
            • Else - Actions
              • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing ((Real(B_integer)) x 25.00) damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_B_unitgroup)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 2
            • Then - Actions
              • Set B_unitgroup = (Units within 225.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
              • Set B_integer = (Number of units in B_unitgroup)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • B_integer Less than or equal to 2
                  • B_integer Not equal to 0
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing 100.00 damage of attack type Spells and damage type Normal
                  • Custom script: call DestroyGroup(udg_B_unitgroup)
                • Else - Actions
                  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing ((Real(B_integer)) x 35.00) damage of attack type Spells and damage type Normal
                  • Custom script: call DestroyGroup(udg_B_unitgroup)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Set B_unitgroup = (Units within 300.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
                  • Set B_integer = (Number of units in B_unitgroup)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • B_integer Less than or equal to 2
                      • B_integer Not equal to 0
                    • Then - Actions
                      • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing 140.00 damage of attack type Spells and damage type Normal
                      • Custom script: call DestroyGroup(udg_B_unitgroup)
                    • Else - Actions
                      • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing ((Real(B_integer)) x 50.00) damage of attack type Spells and damage type Normal
                      • Custom script: call DestroyGroup(udg_B_unitgroup)
                • Else - Actions
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Set B_SE = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards 90.00 degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE1 = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards 180.00 degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE2 = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards 270.00 degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE3 = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards 360.00 degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set B_SE4 = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Set B_loc = (Target point of ability being cast)
      • Destructible - Pick every destructible within (75.00 + (75.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) of B_loc and do (Destructible - Kill (Picked destructible))
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at B_loc facing Default building facing degrees
      • Unit - Add DummySlam (Neutral Hostile) to (Last created unit)
      • Unit - Set level of DummySlam (Neutral Hostile) for (Last created unit) to (Level of |cffffcc00Z|r Navn for (Triggering unit))
      • Unit - Order (Last created unit) to Neutral - Slam
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_B_loc)
      • Wait 1.00 seconds
      • Special Effect - Destroy B_SE
      • Special Effect - Destroy B_SE1
      • Special Effect - Destroy B_SE2
      • Special Effect - Destroy B_SE3
      • Special Effect - Destroy B_SE4
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
No need for Variables just after you create it do. Destroy effect (last created effect) no need to store them in variables
 

Ayanami

칼리
Reaction score
288
Well you could simplify your code by not using If/Then/Else actions. You can simply do it like this.

Trigger:
  • Set B_unitgroup = (Units within (100.00 x (Real(Level of |cffffcc00Z|r Navn for (Triggering unit)) of B_loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))


Something like that. By the way, circular area damage deals damage to allies, it's okay if you wanted it that way.

For your Special Effect part, it can be simplified too.

Trigger:
  • Actions
    • Set RealAngle = 180.00
    • For each (Integer A) from 1 to 3, do (Actions)
      • Loop - Actions
        • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards RealAngle degrees)
        • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
        • Special Effect - Destroy (Last created special effect)
        • Set RealAngle = (RealAngle + 90.00)
        • Custom script: call RemoveLocation(udg_B_loc)
 

Sivert

New Member
Reaction score
0
Trigger:
  • Set RealAngle = 45.00
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards RealAngle degrees)
        • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
        • Special Effect - Destroy (Last created special effect)
        • Set RealAngle = (RealAngle + 45.00)
        • Custom script: call RemoveLocation(udg_B_loc)


Thanks for the optimizing tips!

The only problem I'm experiencing now is that as long as the special effect is destroyed without a pause it doesn't show. Is there a way around that?
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
So the efect doesnt show up like that ?
 

Sivert

New Member
Reaction score
0
With the trigger in my last post it doesn't shoow - however, if I remove the destroy last effect trigger, it shows, like this:

Trigger:
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards RealAngle degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set RealAngle = (RealAngle + 45.00)
      • Custom script: call RemoveLocation(udg_B_loc)


But then it leaks..
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
K do this. Sory for saying to do something then say no but store the special efect in a variable with an array eg fx[integer a] = last created efect then put in a new loop underneath the on that is ther but must be interer b then in the loop do destroy efect fx[integer b]
 

Sivert

New Member
Reaction score
0
Trigger:
  • For each (Integer A) from 1 to 4, do (Actions)
    • Loop - Actions
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards RealAngle degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set RealAngle = (RealAngle + 90.00)
      • Set B_fx[(Integer A)] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)


I didn't quite catch that. Capture the special effects in an array and then loop the destroying how?
 

Ayanami

칼리
Reaction score
288
To remove the special effect, use this.

Trigger:
  • Actions
    • For each (Integer A) from 1 to 4, do (Actions)
      • Special Effect - Destroy B_fx[(IntegerA)]


Hope this helps.
 

Sivert

New Member
Reaction score
0
Now it's set up like this, and the effect still doesn't show. It's being destroyed too soon I think, as it works if I remove the destroy last special effect. I can upload map if wanted.

Trigger:
  • For each (Integer A) from 1 to 4, do (Actions)
    • Loop - Actions
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards RealAngle degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set RealAngle = (RealAngle + 90.00)
      • Set B_fx[(Integer A)] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
    • For each (Integer A) from 1 to 4, do (Actions)
      • Loop - Actions
        • Special Effect - Destroy B_fx[(Integer A)]


EDIT:

This works though, but I'm not sure if it's "correct".

Trigger:
  • For each (Integer A) from 1 to 4, do (Actions)
    • Loop - Actions
      • Set B_loc = ((Target point of ability being cast) offset by (100.00 + (25.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) towards RealAngle degrees)
      • Special Effect - Create a special effect at B_loc using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
      • Set RealAngle = (RealAngle + 90.00)
      • Set B_fx[(Integer A)] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_B_loc)
    • Wait 0.10 seconds
    • For each (Integer A) from 1 to 4, do (Actions)
      • Loop - Actions
        • Special Effect - Destroy B_fx[(Integer A)]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top