• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Need help if this leaks

Status
Not open for further replies.
Level 10
Joined
Feb 18, 2008
Messages
262
Hi. I'm in trouble with my new ranged attack system. After a while, my map lags like hell when a shoot an arrow with this system, however, LeakCheck program and my knowledge says this is leak-free. This trigger is a big one but if anyone can help, i'll be grateful. It's just so annoying after weeks of work, your map is unplayable just because of leak issues.

  • Poison Arrow
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Poison Arrow)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than or equal to 1
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
              • Set TempPoint = (Position of (Picked unit))
              • Set TempPoint2 = (TempPoint offset by 30.00 towards (Facing of (Picked unit)) degrees)
              • Set TempRegion = (Region centered at TempPoint2 with size (75.00, 75.00))
              • Destructible - Pick every destructible in (Playable map area) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Destructible-type of (Picked destructible)) Equal to Pathing Blocker (Both)
                    • Then - Actions
                      • Set TempPoint3 = (Position of (Picked destructible))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (TempRegion contains TempPoint3) Equal to True
                        • Then - Actions
                          • Unit - Kill (Picked unit)
                          • Unit - Remove (Picked unit) from the game
                          • Trigger - Run Poison Arrow Explosion <gen> (ignoring conditions)
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_TempPoint3)
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Custom value of (Picked unit)) Equal to 4) or (((Custom value of (Picked unit)) Equal to 8) or (((Custom value of (Picked unit)) Equal to 12) or (((Custom value of (Picked unit)) Equal to 16) or (((Custom value of (Picked unit)) Equal to 20) or (((Custom value of (Picked unit)) Equal to 24) or (((Custom
                • Then - Actions
                  • Unit - Create 1 Poison Cloud (Poison Arrow) for (Owner of (Picked unit)) at TempPoint facing Default building facing degrees
                  • Unit - Add a 1.25 second Generic expiration timer to (Last created unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Terrain pathing at TempPoint2 of type Walkability is off) Equal to True
                      • (Terrain pathing at TempPoint2 of type Flyability is off) Equal to True
                • Then - Actions
                  • Unit - Kill (Picked unit)
                  • Unit - Remove (Picked unit) from the game
                  • Trigger - Run Poison Arrow Explosion <gen> (ignoring conditions)
                • Else - Actions
                  • Unit - Move (Picked unit) instantly to TempPoint2, facing (Facing of (Picked unit)) degrees
              • Custom script: call RemoveRect(udg_TempRegion)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units within 75.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))) Greater than or equal to 1
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Set TempGroup3 = (Units within 75.00 of TempPoint matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
                  • Set ArrowDamageTarget[(Player number of (Owner of (Picked unit)))] = (Random unit from TempGroup3)
                  • Custom script: call DestroyGroup(udg_TempGroup3)
                  • Set CriticalChance[(Player number of (Owner of (Picked unit)))] = (8.00 + ((Real(((Agility of Hero[(Player number of (Owner of (Picked unit)))] (Include bonuses)) - 10))) x 0.50))
                  • Trigger - Run Bow Critical Modifier <gen> (ignoring conditions)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • CriticalChance[(Player number of (Owner of (Picked unit)))] Greater than or equal to (Random real number between 0.00 and 100.00)
                          • (Hero[(Player number of (Owner of (Picked unit)))] has buff Critical Strike ) Equal to True
                    • Then - Actions
                      • Set RangedCritScored[(Player number of (Owner of (Picked unit)))] = True
                      • Set Damage[(Player number of (Owner of (Picked unit)))] = ((2.25 x (Random real number between 12.00 and 28.00)) + ((Real((Agility of Hero[(Player number of (Owner of (Picked unit)))] (Include bonuses)))) - 10.00))
                      • Trigger - Run Bow Damage Modifier <gen> (ignoring conditions)
                      • Trigger - Run Ranged Damage Critical <gen> (ignoring conditions)
                      • Set KBA_DistancePerLevel = 60.00
                    • Else - Actions
                      • Set RangedCritScored[(Player number of (Owner of (Picked unit)))] = False
                      • Set Damage[(Player number of (Owner of (Picked unit)))] = ((Random real number between 12.00 and 28.00) + ((Real((Agility of Hero[(Player number of (Owner of (Picked unit)))] (Include bonuses)))) - 10.00))
                      • Trigger - Run Bow Damage Modifier <gen> (ignoring conditions)
                      • Trigger - Run Ranged Damage Normal <gen> (ignoring conditions)
                      • Set KBA_DistancePerLevel = 40.00
                  • Trigger - Run Poison Arrow Explosion <gen> (ignoring conditions)
                  • Trigger - Run Knockback Ranged <gen> (checking conditions)
                  • Set ArrowDamageTarget[(Player number of (Owner of (Picked unit)))] = No unit
                  • Unit - Kill (Picked unit)
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • Do nothing
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Custom script: call RemoveLocation(udg_TempPoint2)
            • Else - Actions
              • Unit - Kill (Picked unit)
              • Unit - Remove (Picked unit) from the game
              • Set TempPoint = (Position of (Picked unit))
              • Trigger - Run Poison Arrow Explosion <gen> (ignoring conditions)
              • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This condition leaks:
  • (Number of units in (Units within 75.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and...
This:
  • ((Custom value of (Picked unit)) Equal to 4) or (((Custom value of (Picked unit)) Equal to 8) or (((Custom value of (Picked unit)) Equal to 12) or...
Could be shortened to Custom value modulo 4 = 0.

That will return true when the custom value is 4, 8, 12, 16, 20, 24...
 
Level 10
Joined
Feb 18, 2008
Messages
262
This:
  • ((Custom value of (Picked unit)) Equal to 4) or (((Custom value of (Picked unit)) Equal to 8) or (((Custom value of (Picked unit)) Equal to 12) or...
Could be shortened to Custom value modulo 4 = 0.

That will return true when the custom value is 4, 8, 12, 16, 20, 24...[/QUOTE]

Can you explain this a bit more? How i can i fix that? I'll appreciate it.
 
Level 10
Joined
Feb 18, 2008
Messages
262
Thank you. I'll check on it

Edit: It worked and seems fine, thank you. That condition was really annoying, now its simple and clean. However, i still need to check the map if it still leaks
 
Last edited:
Level 10
Joined
Feb 18, 2008
Messages
262
Game still leaks on lower computers :/ My friend said it had 50-60 fps normally, but when i shoot, it dropped to 10-15, then return to a higher value again.

I'll better try that Maker.

Edit: I tried that, same thing happens. I don't know what's wrong and i have no idea... *sigh*
 
Last edited:
Status
Not open for further replies.
Top