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

Persistent beam + looking_for_help's PDD

Status
Not open for further replies.
Hey everyone

I've implemented Persistent beam into my map but I have a little problem... I use looking_for_help's PDD and not Bribe's. So I modified Persistent beam's attack trigger to look like this:

  • Persistent Beam Attack
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • DamageEventType Equal to 0
      • Beam_IsABeamer[(Custom value of PDD_source)] Equal to True
      • IsDamageSpell Equal to False
    • Actions
      • Custom script: local real xA
      • Custom script: local real yA
      • Custom script: local real xB
      • Custom script: local real yB
      • Custom script: local real xC
      • Custom script: local real yC
      • Custom script: local real dx
      • Custom script: local real dy
      • Custom script: local real distance
      • Custom script: local real angle
      • Set PDD_amount = 0.00
      • Set DamageEventType = DamageTypeBlocked
      • Set BeamID = (Custom value of PDD_source)
      • Set Beam_HitStack[BeamID] = (Beam_HitStack[BeamID] + 1)
      • Set Beam_DamageStack[BeamID] = (Beam_DamageStack[BeamID] + PDD_pureAmount)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (PDD_source is in Beam_MainGroup) Equal to False
        • Then - Actions
          • Set Beam_IntervalDMGTrigger[BeamID] = (33 / BeamConfig_HitsPerSecond[BeamID])
          • Set BeamOwner[BeamID] = (Owner of PDD_source)
          • Custom script: if udg_BeamConfig_AttackType[udg_BeamID] == ATTACK_TYPE_MAGIC then
          • Set Beam_CannotHitMagicImmune[BeamID] = True
          • Custom script: endif
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • Custom script: set xA = GetUnitX(udg_PDD_source)
          • Custom script: set yA = GetUnitY(udg_PDD_source)
          • Custom script: set xB = GetUnitX(udg_PDD_target)
          • Custom script: set yB = GetUnitY(udg_PDD_target)
          • Custom script: set dx = xB-xA
          • Custom script: set dy = yB-yA
          • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
          • Custom script: set angle = Atan2(yA-yB, xA-xB)
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BeamConfig_CasterOffset[BeamID] Greater than 0.00
            • Then - Actions
              • Custom script: set xC = xA + Cos(angle) * udg_BeamConfig_CasterOffset[udg_BeamID]
              • Custom script: set yC = yA + Sin(angle) * udg_BeamConfig_CasterOffset[udg_BeamID]
              • Custom script: set udg_BeamCaster[udg_BeamID] = CreateUnit(udg_BeamOwner[udg_BeamID], udg_BeamConfig_DummyType[udg_BeamID], xC, yC, angle)
            • Else - Actions
              • Custom script: set udg_BeamCaster[udg_BeamID] = CreateUnit(udg_BeamOwner[udg_BeamID], udg_BeamConfig_DummyType[udg_BeamID], xA, yA, angle)
          • Unit - Pause BeamCaster[BeamID]
          • Animation - Change BeamCaster[BeamID] flying height to ((Current flying height of PDD_source) + BeamConfig_CasterHeight[BeamID]) at 0.00
          • Animation - Change BeamCaster[BeamID]'s size to (BeamConfig_CasterScale[BeamID]%, BeamConfig_CasterScale[BeamID]%, BeamConfig_CasterScale[BeamID]%) of its original size
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • Custom script: set udg_BeamMover[udg_BeamID] = CreateUnit(udg_BeamOwner[udg_BeamID], udg_BeamConfig_DummyType[udg_BeamID], xB, yB, angle)
          • Unit - Pause BeamMover[BeamID]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BeamConfig_IsMoverGrounded[BeamID] Equal to True
            • Then - Actions
              • Animation - Change BeamMover[BeamID] flying height to 0.00 at 0.00
            • Else - Actions
              • Animation - Change BeamMover[BeamID] flying height to ((Current flying height of PDD_target) + 50.00) at 0.00
          • Animation - Change BeamMover[BeamID]'s size to (BeamConfig_MoverScale[BeamID]%, BeamConfig_MoverScale[BeamID]%, BeamConfig_MoverScale[BeamID]%) of its original size
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • Set BeamTarget[BeamID] = PDD_target
          • Unit Group - Add PDD_source to Beam_MainGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Persistent Beam Tracking <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on Persistent Beam Cancel A <gen>
              • Trigger - Turn on Persistent Beam Cancel B <gen>
              • Trigger - Turn on Persistent Beam Tracking <gen>
            • Else - Actions
          • Set BeamEvent_Source = PDD_source
          • Set BeamEvent_Target = PDD_target
          • Set BeamEvent_Caster = BeamCaster[BeamID]
          • Set BeamEvent_Mover = BeamMover[BeamID]
          • Set BeamEvent_Damage = PDD_pureAmount
          • Set BeamEvent = 1.00
          • Set BeamEvent = 0.00
          • Set BeamEvent_Source = No unit
          • Set BeamEvent_Target = No unit
          • Set BeamEvent_Caster = No unit
          • Set BeamEvent_Mover = No unit
          • Set BeamEvent_Damage = 0.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PDD_target Not equal to BeamTarget[BeamID]
            • Then - Actions
              • Set BeamTarget[BeamID] = PDD_target
            • Else - Actions
  • [/hidden]
Here is a simple setup trigger
  • Beams
    • Events
      • Game - UnitIndexEvent becomes Equal to 1.00
      • Game - UnitIndexEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitIndexEvent Equal to 1.00
        • Then - Actions
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • -------- CONFIGURE HERE -------- -------- -------- -------- --------
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of UDexUnits[UDex]) Equal to Storm argentavis [alternate]
            • Then - Actions
              • Set BeamConfig_BeamType[UDex] = BLUE
              • Set BeamConfig_RED[UDex] = 1.00
              • Set BeamConfig_GREEN[UDex] = 1.00
              • Set BeamConfig_BLUE[UDex] = 1.00
              • Set BeamConfig_APLHA[UDex] = 1.00
              • Set BeamConfig_AbilityCasterFX[UDex] = Inferno
              • Set BeamConfig_AbilityMoverFX[UDex] = Tranquility
              • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
              • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
              • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
              • Set BeamConfig_AttackType[UDex] = Magic
              • Set BeamConfig_DamageType[UDex] = DamageTypeBeam
              • Set BeamConfig_HitsPerSecond[UDex] = 11
              • Set BeamConfig_IntervalFXLimit[UDex] = 4
              • Set BeamConfig_CasterScale[UDex] = 100.00
              • Set BeamConfig_MoverScale[UDex] = 150.00
              • Set BeamConfig_ChargeLimit[UDex] = 33
              • Set BeamConfig_CasterOffset[UDex] = 70.00
              • Set BeamConfig_CasterAngle[UDex] = 0.00
              • Set BeamConfig_CasterHeight[UDex] = 60.00
              • Set BeamConfig_Range[UDex] = 700.00
              • Set BeamConfig_SweepSpeed[UDex] = 300.00
              • Set BeamConfig_DamageAOE[UDex] = 150.00
              • Set BeamConfig_SweepAOE[UDex] = 600.00
              • Set BeamConfig_FollowRange[UDex] = 400.00
              • Set BeamConfig_IsImmobilised[UDex] = False
              • Set BeamConfig_IsMoverGrounded[UDex] = False
              • Set BeamConfig_HitAll[UDex] = False
              • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
              • Set BeamConfig_DummyType[UDex] = Dummy Caster
              • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
            • Else - Actions
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • -------- END CONFIGURATION -------- -------- -------- -------- --------
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Beam_IsABeamer[UDex] Equal to True
            • Then - Actions
              • Set BeamConfig_BeamType[UDex] = <Empty String>
              • Set BeamConfig_RED[UDex] = 1.00
              • Set BeamConfig_GREEN[UDex] = 1.00
              • Set BeamConfig_BLUE[UDex] = 1.00
              • Set BeamConfig_APLHA[UDex] = 1.00
              • Custom script: set udg_BeamConfig_AbilityCasterFX[udg_UDex] = 0
              • Custom script: set udg_BeamConfig_AbilityMoverFX[udg_UDex] = 0
              • Set BeamConfig_ImpactPeriodicFX[UDex] = <Empty String>
              • Set BeamConfig_CasterPeriodicFX[UDex] = <Empty String>
              • Set BeamConfig_ChargeUpFX[UDex] = <Empty String>
              • Custom script: set udg_BeamConfig_AttackType[udg_UDex] = null
              • Set BeamConfig_DamageType[UDex] = 0
              • Set BeamConfig_HitsPerSecond[UDex] = 3
              • Set BeamConfig_IntervalFXLimit[UDex] = 4
              • Set BeamConfig_CasterScale[UDex] = 100.00
              • Set BeamConfig_MoverScale[UDex] = 100.00
              • Set BeamConfig_ChargeLimit[UDex] = 66
              • Set BeamConfig_CasterOffset[UDex] = 0.00
              • Set BeamConfig_CasterHeight[UDex] = 0.00
              • Set BeamConfig_Range[UDex] = 0.00
              • Set BeamConfig_SweepSpeed[UDex] = 0.00
              • Set BeamConfig_DamageAOE[UDex] = 0.00
              • Set BeamConfig_SweepAOE[UDex] = 0.00
              • Set BeamConfig_FollowRange[UDex] = 400.00
              • Set BeamConfig_IsImmobilised[UDex] = False
              • Set BeamConfig_IsMoverGrounded[UDex] = False
              • Set BeamConfig_HitAll[UDex] = False
              • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
              • Set BeamConfig_DummyString[UDex] = <Empty String>
              • Custom script: set udg_Beam_IsABeamer[udg_UDex] = false
            • Else - Actions
  • I'm using the advanced dummy model
  • I changed projectile speed and art to its proper values

I deleted the old damage event's following variables: source, target, events and amounts, without disabling any triggers. By that I assume that no triggers in my map are still depended on that variables.

Result:
If I attack a building, only the lightning effect is displayed after the charge is finish but the charge itself is not displayed. However the looping damage does not work. The unit deals damage like without the presistent beam. When attacking a normal unit, the beam system doesn't work at all.

I think the problem might be at damage type (as added in the beam's dds) but I might be wrong. Help will be appreciated.

EDIT:
Storm lizards have 'lightning attack' that shoots out lightning when they attack a unit. My test unit had by accident the same ability and apparently it doesn't work so well with the beam system. (I know I have a lot of bad luck when it comes to programming in general :p) I still can't get the charge effect to display but I should be able to figure that out soon enough.
 
Last edited:
Status
Not open for further replies.
Top