How if possible do I keep Phoenix Fire, firing when unit goes out of sight?

HybriD

New Member
Reaction score
1
I'm making this Frozen Orb spell a bit like the one from Diablo 2.
It's really just a dummy unit, moving to a point with the Phoenix Fire(Ice Shards) ability added to it. But I've gotten a problem with the Phoenix Fire/Ice Shards not firing at enemy units when the dummy unit/Frozen Orb unit goes out of sight.

Here's my trigger so far:
Trigger:
  • Frozen Orb
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frozen Orb
    • Actions
      • Unit - Create 1 Dummy(FrozenOrb) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Move To ((Target point of ability being cast) offset by 800.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Frozen Orb for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Ice Shards to (Last created unit)
          • Unit - Set level of Ice Shards for (Last created unit) to 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Frozen Orb for (Triggering unit)) Equal to 2
            • Then - Actions
              • Unit - Add Ice Shards to (Last created unit)
              • Unit - Set level of Ice Shards for (Last created unit) to 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Frozen Orb for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Unit - Add Ice Shards to (Last created unit)
                  • Unit - Set level of Ice Shards for (Last created unit) to 3
                • Else - Actions
                  • Do nothing
          • Do nothing


Is there anyway to keep the Frozen Orb firing Ice Shards at the enemy units, after it goes out of sight without giving the Orb/Dummy sight of it's own?

Help is much appreciated =)
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You're leaking a lot;
And you don't need to put the "Do nothing" action in,
It's just assumed to do nothing (putting it in actually wastes resources) .

As for your spell, giving the orb sight of it's own would be a lot better IMO.
 

HybriD

New Member
Reaction score
1
Well I guess I could give it sight.
About the "leaking", I have no idea of what that means ><, could you explain :b?
 

Sajberhippie

New Member
Reaction score
30
The only way I know to make it continue firing after leaving LoS, is giving it a sight radius of it's own. I know of another way, but it's ugly, takes time, removes a player slot, and is generally just bad. I do know however to improve the trigger you have.

Well I guess I could give it sight.
About the "leaking", I have no idea of what that means ><, could you explain :b?
"Leaks" are bits of data stored in memory until you shut down the program (or exit the map, don't know which). They can slow down the game, and more or less freeze it if there's enough of them. The main types of data that leak are Unit Groups, Points, and Special Effects (there are other, but these are the most common).

What you need to do to avoid the first two is to store the values in variables, and later destroy the variables with a small custom script. The scripts are:
For point (location) leaks: call removelocation (udg_YOURVARIABLE)
For Unit Group leaks: call destroygroup (udg_YOURVARIABLE)

Special effects are easier - there is an GUI option called "Destroy Special Effect" which does what it says, with no leaks.

But aside from the leaks, there are other things you could do to optimize the spell.

This is a point leak:
Trigger:
  • Leak
    • Unit - Create 1 Dummy(FrozenOrb) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
    • Unit - Add a 2.50 second Generic expiration timer to (Last created unit)

This is how it should look:
Trigger:
  • Leak-free
    • Set FOCasterPoint = (Position of (Triggering Unit) <i>&lt;----- CasterPoint is a point variable</i>
    • Unit - Create 1 Dummy(FrozenOrb) for (Owner of (Triggering unit)) at (FOCasterPoint) facing Default building facing degrees
    • Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
    • /// REST OF TRIGGER ///
      • Custom Script: call RemoveLocation (udg_FOCasterPoint)

Same thing here:
Trigger:
  • Leak
    • Unit - Order (Last created unit) to Move To ((Target point of ability being cast) offset by 800.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees)

should be
Trigger:
  • Leak-free
    • Set FOTargetPoint = (Target point of ability being cast)
    • Set FOMovePoint = (FOTargetPoint offset by 800 towards (Angle from (FOCasterPoint) to (FOTargetPoint)) degrees)
    • Unit - Order (Last created unit) to Move To (FOMovePoint)
    • /// REST OF TRIGGER ///
      • Custom Script: call RemoveLocation (udg_FOTargetPoint)
      • Custom Script: call RemoveLocation (udg_FOMovePoint)


This could also be optimized much more fairly easy:
Trigger:
  • Many lines
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Frozen Orb for (Triggering unit)) Equal to 1
      • Then - Actions
        • Unit - Add Ice Shards to (Last created unit)
        • Unit - Set level of Ice Shards for (Last created unit) to 1
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Frozen Orb for (Triggering unit)) Equal to 2
          • Then - Actions
            • Unit - Add Ice Shards to (Last created unit)
            • Unit - Set level of Ice Shards for (Last created unit) to 2
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Level of Frozen Orb for (Triggering unit)) Equal to 3
              • Then - Actions
                • Unit - Add Ice Shards to (Last created unit)
                • Unit - Set level of Ice Shards for (Last created unit) to 3
              • Else - Actions
                • Do nothing
                • Do nothing

"Do nothing" does what it says; it does nothing, and is rarely needed (never in these circumstances). Also, all these conditions are quite unnecessary and both slows down the game a bit and are generally quite ugly. It looks far better like this:
Trigger:
  • Fewer lines
    • Unit - Add Ice Shards to (Last created unit)
    • Unit - Set level of Ice Shards for (Last created unit) to (Level of Frozen Orb for (Triggering Unit)


All in all, the trigger should look something like this:
Trigger:
  • Frozen Orb
    • Set FOCasterPoint = (Position of (Triggering Unit) <i>&lt;----- CasterPoint is a point variable</i>
    • Set FOTargetPoint = (Target point of ability being cast)
    • Set FOMovePoint = (FOTargetPoint offset by 800 towards (Angle from (FOCasterPoint) to (FOTargetPoint)) degrees)
    • Unit - Create 1 Dummy(FrozenOrb) for (Owner of (Triggering unit)) at (FOCasterPoint) facing Default building facing degrees
    • Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Move To (FOMovePoint)
    • Unit - Add Ice Shards to (Last created unit)
    • Unit - Set level of Ice Shards for (Last created unit) to (Level of Frozen Orb for (Triggering Unit)
    • Custom Script: call RemoveLocation (udg_FOCasterPoint)
    • Custom Script: call RemoveLocation (udg_FOTargetPoint)
    • Custom Script: call RemoveLocation (udg_FOMovePoint)


===============

One way to make it continue firing is to change the overall firing mechanism. You could make the casting run a trigger that continuously creates dummies that cast the ice bolt at a nearby target enemy.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top