• 🏆 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!

Dat's 2D SFX Projectiles

Status
Not open for further replies.
Been trying to improve this and seeing if I can make it any better, have no idea how to improve it any further and was wondering if anyone had any idea's. The max projectile count is at 2900, after that it starts to lag. Lumber is projectile count. Also would like to know how to turn the system 3D though that's for another time.


  • [trigger=Starting and Collision]
  • SFX Coolision Copy
    • Events
    • Conditions
    • Actions
      • Set Tempint = (Player number of (Owner of (Damage source)))
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Damage source)) Equal to Footman
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) belongs to an enemy of (Owner of (Damage source))) Equal to True
              • (Owner of (Triggering unit)) Not equal to (Owner of (Damage source))
            • Then - Actions
              • Set uh1int[(Integer((Damage taken)))] = 0
              • Event Response - Set Damage of Unit Damaged Event to uh5real2[(Integer((Damage taken)))]
            • Else - Actions
              • Event Response - Set Damage of Unit Damaged Event to 0.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player number of (Owner of (Damage source))) Less than or equal to 10
              • (Damage source) Equal to PHero[Tempint]
            • Then - Actions
              • Event Response - Set Damage of Unit Damaged Event to 0.00
              • Set uhmax = (uhmax + 1)
              • -------- ------------------------------------------------------------------------------------------ --------
              • Set dumunit = (Damage source)
              • Set uh1unit[uhmax] = uh1damager[(Player number of (Owner of (Damage source)))]
              • Set uh1point1 = (Position of dumunit)
              • Set uh1point2 = (Position of (Triggering unit))
              • -------- ------------------------------------------------------------------------------------------ --------
              • -------- 1uh = X --------
              • Set uh1real2[uhmax] = (X of uh1point1)
              • -------- 2uh = Y --------
              • Set uh2real2[uhmax] = (Y of uh1point1)
              • -------- 3uh = Direction/angle --------
              • Set uh3real2[uhmax] = (Angle from uh1point1 to uh1point2)
              • -------- 4uh = damage identifier --------
              • Set uh4real2[uhmax] = (Real(uhmax))
              • -------- 5uh = damage --------
              • Set uh5real2[uhmax] = 2.00
              • -------- ------------------------------------------------------------------------------------------ --------
              • -------- 6uh = speed --------
              • Set uh6speed[uhmax] = 36.00
              • -------- ------------------------------------------------------------------------------------------ --------
              • -------- 7uh = collision --------
              • Set uh7aoe[uhmax] = 16.00
              • -------- collision check --------
              • Set uh1int[uhmax] = 1
              • -------- ------------------------------------------------------------------------------------------ --------
              • Special Effect - Create a special effect at uh1point1 using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Set uh1sfx[uhmax] = (Last created special effect)
              • Special Effect - Set Scale of uh1sfx[uhmax] to 2.00
              • Custom script: call BlzSetSpecialEffectRoll( udg_uh1sfx[udg_uhmax], ( udg_uh3real2[udg_uhmax] * bj_DEGTORAD ) )
              • -------- ------------------------------------------------------------------------------------------ --------
            • Else - Actions
      • Trigger - Turn on (This trigger)
  • [trigger=Loop]
  • uhk Copy
    • Events
      • Time - uhtimer expires
    • Conditions
    • Actions
      • For each (Integer uhloop) from 1 to uhmax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • uh1int[uhloop] Equal to 1
            • Then - Actions
              • Set uh4real2[uhloop] = (Real(uhloop))
              • -------- 1uh = X --------
              • -------- 2uh = Y --------
              • -------- 3uh = Direction/angle --------
              • -------- 4uh = damage identifier --------
              • Custom script: set udg_uh1real2[udg_uhloop]=udg_uh1real2[udg_uhloop] +udg_uh6speed[udg_uhloop]*Cos(udg_uh3real2[udg_uhloop]*bj_DEGTORAD)
              • Custom script: set udg_uh2real2[udg_uhloop]=udg_uh2real2[udg_uhloop] +udg_uh6speed[udg_uhloop]*Sin(udg_uh3real2[udg_uhloop]*bj_DEGTORAD)
              • Special Effect - Set Position of uh1sfx[uhloop] to x: uh1real2[uhloop], y: uh2real2[uhloop], z: (0.00 + 75.00)
              • Custom script: call UnitDamagePoint(udg_uh1unit[udg_uhloop],0,udg_uh7aoe[udg_uhloop],udg_uh1real2[udg_uhloop],udg_uh2real2[udg_uhloop],udg_uh4real2[udg_uhloop],true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • uh1int[uhloop] Equal to 0
                • Then - Actions
                  • Set uh1int[uhloop] = 1
                  • Special Effect - Destroy uh1sfx[uhloop]
                  • Set uh1unit[uhloop] = uh1unit[uhmax]
                  • Set uh1unit[uhmax] = No unit
                  • Set uh1real2[uhloop] = uh1real2[uhmax]
                  • Set uh2real2[uhloop] = uh2real2[uhmax]
                  • Set uh3real2[uhloop] = uh3real2[uhmax]
                  • Set uh4real2[uhloop] = uh4real2[uhmax]
                  • Set uh5real2[uhloop] = uh5real2[uhmax]
                  • Set uh6speed[uhloop] = uh6speed[uhmax]
                  • Set uh7aoe[uhloop] = uh7aoe[uhmax]
                  • Set uh1int[uhloop] = uh1int[uhmax]
                  • Set uh1sfx[uhloop] = uh1sfx[uhmax]
                  • Set uhmax = (uhmax - 1)
                  • Set uhloop = (uhloop - 1)
                • Else - Actions
      • -------- A second has passed, so update --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • Player - Set Player 1 (Red) Current lumber to uhloop


Would linked list or double linked list be better then dynamic indexing?
 

Attachments

  • datproj testmap.w3x
    33.6 KB · Views: 27
Status
Not open for further replies.
Top