• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Triggers Leaks and bugs

Status
Not open for further replies.
Level 13
Joined
Oct 25, 2009
Messages
995
Does this triggers have leaks and bugs?The one who help me check will +Rep :)
also,sometimes the ball will keep moving when 2 unit casted...
  • SB Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Solar Ball
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SB_IndexSize Equal to 0
        • Then - Actions
          • Trigger - Turn on SB Loop <gen>
          • Trigger - Turn on SB Stop <gen>
        • Else - Actions
      • Set SB_IndexSize = (SB_IndexSize + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SB_IndexSize Greater than SB_IndexMaxSize
        • Then - Actions
          • Set SB_Index[SB_IndexSize] = SB_IndexSize
          • Set SB_IndexMaxSize = SB_IndexSize
        • Else - Actions
      • Set SB_TempInt = SB_Index[SB_IndexSize]
      • Set SB_Caster[SB_TempInt] = (Triggering unit)
      • Set SB_CasterPoint = (Position of SB_Caster[SB_TempInt])
      • Set SB_Angle[SB_TempInt] = 0.00
      • Set SB_TargetPoint = (Target point of ability being cast)
      • Set SB_Boolean[SB_TempInt] = True
      • Unit - Create 1 Dummy for (Owner of SB_Caster[SB_TempInt]) at SB_CasterPoint facing (Facing of SB_Caster[SB_TempInt]) degrees
      • Set SB_Dummy[SB_TempInt] = (Last created unit)
      • Unit - Turn collision for SB_Dummy[SB_TempInt] Off
      • Set SB_DummyPoint = (Position of SB_Dummy[SB_TempInt])
      • Set SB_AreaPoint = (SB_DummyPoint offset by 200.00 towards SB_Angle[SB_TempInt] degrees)
      • Lightning - Create a Finger of Death lightning effect from source SB_DummyPoint to target SB_AreaPoint
      • Set SB_LightningEffect[SB_TempInt] = (Last created lightning effect)
      • Set SB_MaxDistance[SB_TempInt] = (Distance between SB_DummyPoint and SB_TargetPoint)
      • Unit Group - Add SB_Caster[SB_TempInt] to SB_CasterGroup
      • Set SB_Points[1] = (Position of SB_Dummy[SB_TempInt])
      • Custom script: call RemoveLocation(udg_SB_DummyPoint)
      • Custom script: call RemoveLocation(udg_SB_AreaPoint)
      • Custom script: call RemoveLocation(udg_SB_CasterPoint)
      • Custom script: call RemoveLocation(udg_SB_Points[1])
  • SB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SB_IndexLoop) from 1 to SB_IndexSize, do (Actions)
        • Loop - Actions
          • Set SB_TempInt = SB_Index[SB_IndexLoop]
          • Set SB_Points[1] = (Position of SB_Dummy[SB_TempInt])
          • Set SB_MaxDistance[SB_TempInt] = (Distance between SB_Points[1] and SB_TargetPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SB_Caster[SB_TempInt] is alive) Equal to True
              • (SB_Caster[SB_TempInt] is in SB_CasterGroup) Equal to True
              • SB_MaxDistance[SB_TempInt] Greater than or equal to 100.00
            • Then - Actions
              • Set SB_Angle[SB_TempInt] = (SB_Angle[SB_TempInt] + 2.00)
              • Set SB_DummyPoint = (Position of SB_Dummy[SB_TempInt])
              • Set SB_AreaPoint = (SB_DummyPoint offset by 200.00 towards SB_Angle[SB_TempInt] degrees)
              • Set SB_Points[2] = (Position of SB_Dummy[SB_TempInt])
              • Set SB_OffPoint = (SB_Points[2] offset by 10.00 towards (Facing of SB_Dummy[SB_TempInt]) degrees)
              • Unit - Move SB_Dummy[SB_TempInt] instantly to SB_OffPoint
              • Lightning - Move SB_LightningEffect[SB_TempInt] to source SB_DummyPoint and target SB_AreaPoint
              • Custom script: set bj_wantDestroyGroup=true
              • Unit Group - Pick every unit in (Units within 200.00 of SB_AreaPoint matching ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of SB_Caster[SB_TempInt])) Equal to True)))) and do (Actions)
                • Loop - Actions
                  • Unit - Cause SB_Dummy[SB_TempInt] to damage (Picked unit), dealing 10.00 damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\DemolisherFireMissile\DemolisherFireMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_SB_Points[2])
              • Custom script: call RemoveLocation(udg_SB_OffPoint)
              • Custom script: call RemoveLocation(udg_SB_DummyPoint)
              • Custom script: call RemoveLocation(udg_SB_AreaPoint)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SB_Boolean[SB_TempInt] Equal to True
                • Then - Actions
                  • Lightning - Destroy SB_LightningEffect[SB_TempInt]
                  • Set SB_Points[3] = (Position of SB_Dummy[SB_TempInt])
                  • Unit - Explode SB_Dummy[SB_TempInt]
                  • Unit - Create 1 Phoenix for (Owner of SB_Caster[SB_TempInt]) at SB_Points[3] facing Default building facing degrees
                  • Unit - Add Solar Stun to (Last created unit)
                  • Unit - Set level of Solar Stun for (Last created unit) to (Level of Solar Ball for SB_Caster[SB_TempInt])
                  • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                  • Unit - Order SB_Caster[SB_TempInt] to Stop
                  • Custom script: call RemoveLocation(udg_SB_Points[3])
                  • Set SB_Boolean[SB_TempInt] = False
                  • Set SB_Index[SB_IndexLoop] = SB_Index[SB_IndexSize]
                  • Set SB_Index[SB_IndexSize] = SB_TempInt
                  • Set SB_IndexSize = (SB_IndexSize - 1)
                  • Set SB_IndexLoop = (SB_IndexLoop - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SB_IndexSize Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                      • Trigger - Turn off SB Stop <gen>
                    • Else - Actions
                • Else - Actions
          • Custom script: call RemoveLocation(udg_SB_Points[1])
  • SB Stop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Solar Ball
    • Actions
      • Unit Group - Remove SB_Caster[SB_TempInt] from SB_CasterGroup
Here the map...
Solar Ball :goblin_boom:
 
Level 12
Joined
Aug 12, 2008
Messages
350
From my view, it's leakless (who knows there might be mistake) :p
But why do you use arrays for the points in the loop trigger? Don't use array unless it's needed. If I'm not mistaken it reduces the efficiency of the trigger.
Then, in the loop trigger, I don't see any usage of SB_Points[1]; I guess you can remove it :)
 
Level 15
Joined
Oct 18, 2008
Messages
1,591
Interesting approach, tons of variables, and wonderful work :) I see no leaks at all, and it even turns off itself-sometimes I forget to make the same for my spells, and if I ever finish my map with 300 spells, I guess it'd be better if I would correct them. Anyways, good job!
:thumbs_up::goblin_yeah:
 
- Owner of SB_Caster[SB_TempInt]) >>> TriggeringPlayer
- SB_CasterPoint is the same as SB_DummyPoint
- You should index this >>> SB_TargetPoint
- This is not necessary >>> Set SB_MaxDistance[SB_TempInt] = (Distance between SB_DummyPoint and SB_TargetPoint) coz you enumerate it in the loop everytime, you dont even need to array it...
- You really dont need the SB Stop trigger, remove the caster when the spell is finished or after this line >>> Unit - Order SB_Caster[SB_TempInt] to Stop
- Btw SB_TargetPoint leaks

These are my observations in the trigger without testing the map...
 
Status
Not open for further replies.
Top