Trouble converting missile system (Unit to SFX)

Status
Not open for further replies.
Problem Solved

Hello, can someone help me analyze the problem? I'm trying to convert my missile system, it is currently units as missiles and I am trying to convert it to Special Effects.

So this is the current system I have. It works perfectly but I'm trying to optimize my map because unit creation is so stressful for the game, and it's worse when there's too many units triggering this system, so I have to convert the system from using units to SFX.

Warning: This may be hard to read.

These are the triggers that uses units as missiles.
  • Shoot Player Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Attack (Taunt)
    • Actions
      • -------- --------
      • -------- Setup temp variables --------
      • Set Shoot_AllowCastRanged = False
      • Set Shoot_AllowCastMelee = False
      • -------- --------
      • Set Shoot_CasterPoint = (Position of (Casting unit))
      • Set Shoot_CasterX = (X of Shoot_CasterPoint)
      • Set Shoot_CasterY = (Y of Shoot_CasterPoint)
      • Set Shoot_TargetPoint = (Position of Global_MouseUnit)
      • Set Shoot_TargetX = (X of Shoot_TargetPoint)
      • Set Shoot_TargetY = (Y of Shoot_TargetPoint)
      • Unit - Make (Casting unit) face Shoot_TargetPoint over 0.00 seconds
      • Custom script: call RemoveLocation(udg_Shoot_CasterPoint)
      • Custom script: call RemoveLocation(udg_Shoot_TargetPoint)
      • -------- Check ammo and weapon --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weapon_WeaponType Not equal to No Item
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Weapon_WeaponIsMelee Equal to True
            • Then - Actions
              • Set Shoot_AllowCastMelee = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Weapon_AmmoCurrentIndex Greater than 0
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UI_RegAmmoStoredArray[Weapon_AmmoCurrentIndex] Greater than 0
                    • Then - Actions
                      • Set Shoot_AllowCastRanged = True
                    • Else - Actions
                      • Game - Display to (All players) the text: [Hero has no ammuni...
                      • Custom script: call TriggerSleepAction( 0.001 )
                      • Unit - Order (Casting unit) to Stop
                • Else - Actions
                  • Game - Display to (All players) the text: [Hero has not selec...
                  • Custom script: call TriggerSleepAction( 0.001 )
                  • Unit - Order (Casting unit) to Stop
        • Else - Actions
          • Game - Display to (All players) the text: [Hero has no weapon]
          • Custom script: call TriggerSleepAction( 0.001 )
          • Unit - Order (Casting unit) to Stop
  • Shoot Player Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack (Taunt)
    • Actions
      • -------- --------
      • -------- Check if unit is a melee unit or a ranged unit --------
      • -------- --------
      • -------- MELEE --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Shoot_AllowCastRanged Equal to False
              • Shoot_AllowCastMelee Equal to True
        • Then - Actions
          • Set Shoot_CasterPoint = (Point(Shoot_CasterX, Shoot_CasterY))
          • Set Shoot_TargetPoint = (Shoot_CasterPoint offset by 100.00 towards (Facing of Shoot_MeleeCaster) degrees)
          • Set Shoot_MeleeCaster = (Casting unit)
          • Set Shoot_MeleeDetectAOE = 125.00
          • Set Shoot_MeleeDamage = Weapon_WeaponDamage
          • -------- --------
          • Set Shoot_MeleeDamageSource = Shoot_MeleeCaster
          • Set Shoot_MeleeDamagePoint = Shoot_TargetPoint
          • Set Shoot_MeleeDamageUnit = No unit
          • Trigger - Run Shoot Melee <gen> (ignoring conditions)
          • -------- --------
          • Custom script: call RemoveLocation(udg_Shoot_CasterPoint)
          • Custom script: call RemoveLocation(udg_Shoot_TargetPoint)
          • Custom script: call RemoveLocation(udg_Shoot_MeleeDamagePoint)
        • Else - Actions
      • -------- --------
      • -------- RANGED --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Shoot_AllowCastRanged Equal to True
              • Shoot_AllowCastMelee Equal to False
        • Then - Actions
          • -------- --------
          • -------- Dynamic index --------
          • Set Shoot_MaxIndex = (Shoot_MaxIndex + 1)
          • -------- --------
          • -------- Fetch variables from full inventory --------
          • Set Shoot_Damage[Shoot_MaxIndex] = Weapon_WeaponDamage
          • Set Shoot_DummyType = Weapon_AmmoDummyType
          • Set Shoot_MaxLifetime = Weapon_AmmoLifetime
          • Set Shoot_Speed = Weapon_AmmoProjectileSpeed
          • Set Shoot_IsExploding[Shoot_MaxIndex] = Weapon_AmmoIsExploding
          • Set Shoot_DetectAOE[Shoot_MaxIndex] = 125.00
          • -------- --------
          • -------- Reduce charges --------
          • Set UI_RegAmmoStoredArray[Weapon_AmmoCurrentIndex] = (UI_RegAmmoStoredArray[Weapon_AmmoCurrentIndex] - 1)
          • Trigger - Run Inventory Update Ammo Desc and Icon <gen> (ignoring conditions)
          • -------- --------
          • -------- Create missile --------
          • Set Shoot_SpeedInterval = (Shoot_Speed x 0.03)
          • Set Shoot_Caster[Shoot_MaxIndex] = (Casting unit)
          • Set Shoot_CasterPoint = (Point(Shoot_CasterX, Shoot_CasterY))
          • Set Shoot_TargetPoint = (Point(Shoot_TargetX, Shoot_TargetY))
          • Set Shoot_Angle[Shoot_MaxIndex] = (Angle from Shoot_CasterPoint to Shoot_TargetPoint)
          • Set Shoot_FrontPoint = (Shoot_CasterPoint offset by 100.00 towards Shoot_Angle[Shoot_MaxIndex] degrees)
          • Custom script: set udg_Shoot_AngleX[udg_Shoot_MaxIndex] = udg_Shoot_SpeedInterval * Cos(bj_DEGTORAD * udg_Shoot_Angle[udg_Shoot_MaxIndex])
          • Custom script: set udg_Shoot_AngleY[udg_Shoot_MaxIndex] = udg_Shoot_SpeedInterval * Sin(bj_DEGTORAD * udg_Shoot_Angle[udg_Shoot_MaxIndex])
          • Unit - Create 1 Shoot_DummyType for (Triggering player) at Shoot_FrontPoint facing Shoot_Angle[Shoot_MaxIndex] degrees
          • Set Shoot_Dummy[Shoot_MaxIndex] = (Last created unit)
          • Unit - Add a Shoot_MaxLifetime second Generic expiration timer to Shoot_Dummy[Shoot_MaxIndex]
          • Custom script: call RemoveLocation(udg_Shoot_CasterPoint)
          • Custom script: call RemoveLocation(udg_Shoot_TargetPoint)
          • Custom script: call RemoveLocation(udg_Shoot_FrontPoint)
          • Trigger - Turn on Shoot Ranged <gen>
        • Else - Actions
      • -------- --------
      • -------- ILLEGAL ATTACK --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Shoot_AllowCastRanged Equal to True
              • Shoot_AllowCastMelee Equal to True
        • Then - Actions
          • -------- --------
          • -------- Warn that the unit is not registered --------
          • Set Debug_WarningCode = 5
          • Set Debug_WarningSource = (Triggering unit)
          • Trigger - Run Test Warning <gen> (ignoring conditions)
        • Else - Actions
  • Shoot Ranged
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Shoot_CurrentIndex) from 1 to Shoot_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Shoot_Dummy[Shoot_CurrentIndex] is dead) Equal to True
            • Then - Actions
              • -------- --------
              • -------- Dynamic indexing --------
              • Set Shoot_Angle[Shoot_CurrentIndex] = Shoot_Angle[Shoot_MaxIndex]
              • Set Shoot_AngleX[Shoot_CurrentIndex] = Shoot_AngleX[Shoot_MaxIndex]
              • Set Shoot_AngleY[Shoot_CurrentIndex] = Shoot_AngleY[Shoot_MaxIndex]
              • Set Shoot_Dummy[Shoot_CurrentIndex] = Shoot_Dummy[Shoot_MaxIndex]
              • Set Shoot_Caster[Shoot_CurrentIndex] = Shoot_Caster[Shoot_MaxIndex]
              • Set Shoot_Damage[Shoot_CurrentIndex] = Shoot_Damage[Shoot_MaxIndex]
              • Set Shoot_IsExploding[Shoot_CurrentIndex] = Shoot_IsExploding[Shoot_MaxIndex]
              • Set Shoot_DetectAOE[Shoot_CurrentIndex] = Shoot_DetectAOE[Shoot_MaxIndex]
              • Set Shoot_DamageAOE[Shoot_CurrentIndex] = Shoot_DamageAOE[Shoot_MaxIndex]
              • Set Shoot_CurrentIndex = (Shoot_CurrentIndex - 1)
              • Set Shoot_MaxIndex = (Shoot_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Shoot_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Custom script: call SetUnitX(udg_Shoot_Dummy[udg_Shoot_CurrentIndex], GetUnitX(udg_Shoot_Dummy[udg_Shoot_CurrentIndex]) + udg_Shoot_AngleX[udg_Shoot_CurrentIndex])
              • Custom script: call SetUnitY(udg_Shoot_Dummy[udg_Shoot_CurrentIndex], GetUnitY(udg_Shoot_Dummy[udg_Shoot_CurrentIndex]) + udg_Shoot_AngleY[udg_Shoot_CurrentIndex])
              • Set Shoot_TempPoint = (Position of Shoot_Dummy[Shoot_CurrentIndex])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains Shoot_TempPoint) Equal to True
                • Then - Actions
                  • -------- --------
                  • -------- TERRAIN --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Terrain type at Shoot_TempPoint) Equal to Black Citadel - Flat Stones
                          • (Terrain type at Shoot_TempPoint) Equal to Ashenvale - Grass
                          • (Terrain type at Shoot_TempPoint) Equal to Barrens - Dirt
                    • Then - Actions
                      • -------- --------
                      • -------- Kill dummy --------
                      • Unit - Kill Shoot_Dummy[Shoot_CurrentIndex]
                    • Else - Actions
                  • -------- --------
                  • -------- UNITS --------
                  • Set Shoot_TempInt = 0
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within Shoot_DetectAOE[Shoot_CurrentIndex] of Shoot_TempPoint) and do (Actions)
                    • Loop - Actions
                      • Set Shoot_TempUnit = (Picked unit)
                      • Set Shoot_TempUnitPoint = (Position of Shoot_TempUnit)
                      • Set Shoot_TempInt = (Shoot_TempInt + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • Shoot_TempInt Less than or equal to 1
                              • (Shoot_TempUnit is alive) Equal to True
                              • (Shoot_TempUnit is invulnerable) Equal to False
                              • Shoot_TempUnit Not equal to Shoot_Caster[Shoot_CurrentIndex]
                        • Then - Actions
                          • -------- --------
                          • -------- Check ammo type before giving damage --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Shoot_IsExploding[Shoot_CurrentIndex] Equal to True
                            • Then - Actions
                              • -------- --------
                              • -------- Double AOE for explosive --------
                              • Set Shoot_DamageAOE[Shoot_CurrentIndex] = (Shoot_DetectAOE[Shoot_CurrentIndex] x 2.00)
                              • -------- --------
                              • -------- Group setup --------
                              • Set Shoot_KBSourceUnit = Shoot_TempUnit
                              • Set Shoot_KBSourceUnitLoc = (Position of Shoot_TempUnit)
                              • Set Shoot_KBAOEGroup = (Units within Shoot_DamageAOE[Shoot_CurrentIndex] of Shoot_KBSourceUnitLoc)
                              • -------- --------
                              • -------- Cause damage in radius --------
                              • Custom script: set bj_wantDestroyGroup = true
                              • Unit Group - Pick every unit in Shoot_KBAOEGroup and do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Shoot_KBSourceUnit Not equal to No unit
                                      • (Shoot_KBAOEGroup is empty) Equal to False
                                    • Then - Actions
                                      • Set Shoot_KBTargetUnit = (Picked unit)
                                      • Set DMG_AllowDamage = True
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Shoot_KBTargetUnit is A ground unit) Equal to True
                                          • (Shoot_KBTargetUnit is Mechanical) Equal to False
                                        • Then - Actions
                                          • -------- --------
                                          • -------- 1.5x damage to organic units --------
                                          • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_KBTargetUnit, dealing (Shoot_Damage[Shoot_CurrentIndex] x 1.50) damage of attack type Spells and damage type Normal
                                        • Else - Actions
                                          • -------- --------
                                          • -------- Normal damage to mech units --------
                                          • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_KBTargetUnit, dealing Shoot_Damage[Shoot_CurrentIndex] damage of attack type Spells and damage type Normal
                                      • Set DMG_AllowDamage = False
                                    • Else - Actions
                              • Custom script: call RemoveLocation(udg_Shoot_KBSourceUnitLoc)
                            • Else - Actions
                              • Set DMG_AllowDamage = True
                              • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_TempUnit, dealing Shoot_Damage[Shoot_CurrentIndex] damage of attack type Spells and damage type Normal
                              • Set DMG_AllowDamage = False
                          • -------- --------
                          • -------- Check unit classification for FX --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Shoot_TempUnit is Mechanical) Equal to False
                              • (Shoot_TempUnit is A structure) Equal to False
                              • (Shoot_TempUnit is Summoned) Equal to False
                            • Then - Actions
                              • -------- --------
                              • -------- Spill blood --------
                              • Special Effect - Create a special effect at Shoot_TempUnitPoint using war3mapImported\EffectSmallBloodEX.mdx
                              • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
                              • Special Effect - Destroy (Last created special effect)
                              • Special Effect - Create a special effect at Shoot_TempUnitPoint using war3mapImported\EffectSplatBleed.mdx
                              • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                          • -------- --------
                          • -------- Kill dummy --------
                          • Unit - Kill Shoot_Dummy[Shoot_CurrentIndex]
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_Shoot_TempUnitPoint)
                  • -------- --------
                  • -------- DESTRUCTIBLES --------
                  • Set Shoot_TempInt = 0
                  • Destructible - Pick every destructible within Shoot_DetectAOE[Shoot_CurrentIndex] of Shoot_TempPoint and do (Actions)
                    • Loop - Actions
                      • Set Shoot_TempDestructible = (Picked destructible)
                      • Set Shoot_TempDestructiblePoint = (Position of Shoot_TempDestructible)
                      • Set Shoot_TempInt = (Shoot_TempInt + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Shoot_TempInt Less than or equal to 1
                          • (Shoot_TempDestructible is alive) Equal to True
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Destructible-type of Shoot_TempDestructible) Equal to Invisible Platform
                                  • (Destructible-type of Shoot_TempDestructible) Equal to Invisible Platform (small)
                            • Then - Actions
                              • -------- Do absolutely nothing --------
                            • Else - Actions
                              • -------- Play hit animation --------
                              • Animation - Play Shoot_TempDestructible's hit animation
                              • Animation - Queue Shoot_TempDestructible's stand animation
                              • -------- --------
                              • -------- Cause damage --------
                              • Destructible - Set life of Shoot_TempDestructible to ((Current life of Shoot_TempDestructible) - Shoot_Damage[Shoot_CurrentIndex])
                              • -------- --------
                              • -------- Kill dummy --------
                              • Unit - Kill Shoot_Dummy[Shoot_CurrentIndex]
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_Shoot_TempDestructiblePoint)
                • Else - Actions
                  • -------- --------
                  • -------- Kill dummy --------
                  • Unit - Kill Shoot_Dummy[Shoot_CurrentIndex]
              • Custom script: call RemoveLocation(udg_Shoot_TempPoint)


Now these are the triggers that uses SFX as missiles instead of units. This is my attempt converting the first triggers, but I can't make it work.

  • Shoot Player Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Attack (Taunt)
    • Actions
      • -------- --------
      • -------- Setup temp variables --------
      • Set Shoot_AllowCastRanged = False
      • Set Shoot_AllowCastMelee = False
      • -------- --------
      • Set Shoot_CasterPoint = (Position of (Casting unit))
      • Set Shoot_CasterX = (X of Shoot_CasterPoint)
      • Set Shoot_CasterY = (Y of Shoot_CasterPoint)
      • Set Shoot_TargetPoint = (Position of Global_MouseUnit)
      • Set Shoot_TargetX = (X of Shoot_TargetPoint)
      • Set Shoot_TargetY = (Y of Shoot_TargetPoint)
      • Unit - Make (Casting unit) face Shoot_TargetPoint over 0.00 seconds
      • Custom script: call RemoveLocation(udg_Shoot_CasterPoint)
      • Custom script: call RemoveLocation(udg_Shoot_TargetPoint)
      • -------- Check ammo and weapon --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weapon_WeaponType Not equal to No Item
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Weapon_WeaponIsMelee Equal to True
            • Then - Actions
              • Set Shoot_AllowCastMelee = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Weapon_AmmoCurrentIndex Greater than 0
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UI_RegAmmoStoredArray[Weapon_AmmoCurrentIndex] Greater than 0
                    • Then - Actions
                      • Set Shoot_AllowCastRanged = True
                    • Else - Actions
                      • Game - Display to (All players) the text: [Hero has no ammuni...
                      • Custom script: call TriggerSleepAction( 0.001 )
                      • Unit - Order (Casting unit) to Stop
                • Else - Actions
                  • Game - Display to (All players) the text: [Hero has not selec...
                  • Custom script: call TriggerSleepAction( 0.001 )
                  • Unit - Order (Casting unit) to Stop
        • Else - Actions
          • Game - Display to (All players) the text: [Hero has no weapon]
          • Custom script: call TriggerSleepAction( 0.001 )
          • Unit - Order (Casting unit) to Stop
  • Shoot Player Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack (Taunt)
    • Actions
      • -------- --------
      • -------- Check if unit is a melee unit or a ranged unit --------
      • -------- --------
      • -------- MELEE --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Shoot_AllowCastRanged Equal to False
              • Shoot_AllowCastMelee Equal to True
        • Then - Actions
          • Set Shoot_CasterPoint = (Point(Shoot_CasterX, Shoot_CasterY))
          • Set Shoot_TargetPoint = (Shoot_CasterPoint offset by 100.00 towards (Facing of Shoot_MeleeCaster) degrees)
          • Set Shoot_MeleeCaster = (Casting unit)
          • Set Shoot_MeleeDetectAOE = 125.00
          • Set Shoot_MeleeDamage = Weapon_WeaponDamage
          • -------- --------
          • Set Shoot_MeleeDamageSource = Shoot_MeleeCaster
          • Set Shoot_MeleeDamagePoint = Shoot_TargetPoint
          • Set Shoot_MeleeDamageUnit = No unit
          • Trigger - Run Shoot Melee <gen> (ignoring conditions)
          • -------- --------
          • Custom script: call RemoveLocation(udg_Shoot_CasterPoint)
          • Custom script: call RemoveLocation(udg_Shoot_TargetPoint)
          • Custom script: call RemoveLocation(udg_Shoot_MeleeDamagePoint)
        • Else - Actions
      • -------- --------
      • -------- RANGED --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Shoot_AllowCastRanged Equal to True
              • Shoot_AllowCastMelee Equal to False
        • Then - Actions
          • -------- --------
          • -------- Dynamic index --------
          • Set Shoot_MaxIndex = (Shoot_MaxIndex + 1)
          • -------- --------
          • -------- Fetch variables from full inventory --------
          • Set Shoot_Damage[Shoot_MaxIndex] = Weapon_WeaponDamage
          • Set Shoot_DummyType = Weapon_AmmoDummyType
          • Set Shoot_MaxLifetime = Weapon_AmmoLifetime
          • Set Shoot_Speed = Weapon_AmmoProjectileSpeed
          • Set Shoot_IsExploding[Shoot_MaxIndex] = Weapon_AmmoIsExploding
          • Set Shoot_DetectAOE[Shoot_MaxIndex] = 125.00
          • -------- --------
          • -------- Reduce charges --------
          • Set UI_RegAmmoStoredArray[Weapon_AmmoCurrentIndex] = (UI_RegAmmoStoredArray[Weapon_AmmoCurrentIndex] - 1)
          • Trigger - Run Inventory Update Ammo Desc and Icon <gen> (ignoring conditions)
          • -------- --------
          • -------- Create missile --------
          • Set Shoot_SpeedInterval = (Shoot_Speed x 0.03)
          • Set Shoot_Caster[Shoot_MaxIndex] = (Casting unit)
          • Set Shoot_CasterPoint = (Point(Shoot_CasterX, Shoot_CasterY))
          • Set Shoot_TargetPoint = (Point(Shoot_TargetX, Shoot_TargetY))
          • Set Shoot_Angle[Shoot_MaxIndex] = (Angle from Shoot_CasterPoint to Shoot_TargetPoint)
          • Set Shoot_FrontPoint = (Shoot_CasterPoint offset by 100.00 towards Shoot_Angle[Shoot_MaxIndex] degrees)
          • Custom script: set udg_Shoot_AngleX[udg_Shoot_MaxIndex] = udg_Shoot_SpeedInterval * Cos(bj_DEGTORAD * udg_Shoot_Angle[udg_Shoot_MaxIndex])
          • Custom script: set udg_Shoot_AngleY[udg_Shoot_MaxIndex] = udg_Shoot_SpeedInterval * Sin(bj_DEGTORAD * udg_Shoot_Angle[udg_Shoot_MaxIndex])
          • Special Effect - Create a special effect at Shoot_FrontPoint using war3mapImported\Shot Yellow.mdl
          • Special Effect - Set Scale of (Last created special effect) to 1.25
          • Special Effect - Set Height of (Last created special effect) to: 80.00
          • Set NewShoot_MissileSFX[Shoot_MaxIndex] = (Last created special effect)
          • Custom script: call RemoveLocation(udg_Shoot_CasterPoint)
          • Custom script: call RemoveLocation(udg_Shoot_TargetPoint)
          • Custom script: call RemoveLocation(udg_Shoot_FrontPoint)
          • Trigger - Turn on Shoot Ranged <gen>
        • Else - Actions
      • -------- --------
      • -------- ILLEGAL ATTACK --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Shoot_AllowCastRanged Equal to True
              • Shoot_AllowCastMelee Equal to True
        • Then - Actions
          • -------- --------
          • -------- Warn that the unit is not registered --------
          • Set Debug_WarningCode = 5
          • Set Debug_WarningSource = (Triggering unit)
          • Trigger - Run Test Warning <gen> (ignoring conditions)
        • Else - Actions
  • Shoot Ranged
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Shoot_CurrentIndex) from 1 to Shoot_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NewShoot_MissileIsAlive[Shoot_CurrentIndex] Equal to False
            • Then - Actions
              • -------- --------
              • -------- Dynamic indexing --------
              • Set Shoot_Angle[Shoot_CurrentIndex] = Shoot_Angle[Shoot_MaxIndex]
              • Set Shoot_AngleX[Shoot_CurrentIndex] = Shoot_AngleX[Shoot_MaxIndex]
              • Set Shoot_AngleY[Shoot_CurrentIndex] = Shoot_AngleY[Shoot_MaxIndex]
              • Set NewShoot_MissileSFX[Shoot_CurrentIndex] = NewShoot_MissileSFX[Shoot_MaxIndex]
              • Set NewShoot_MissilePosition[Shoot_CurrentIndex] = NewShoot_MissilePosition[Shoot_MaxIndex]
              • Set NewShoot_MissileIsAlive[Shoot_CurrentIndex] = NewShoot_MissileIsAlive[Shoot_MaxIndex]
              • Set Shoot_Caster[Shoot_CurrentIndex] = Shoot_Caster[Shoot_MaxIndex]
              • Set Shoot_Damage[Shoot_CurrentIndex] = Shoot_Damage[Shoot_MaxIndex]
              • Set Shoot_IsExploding[Shoot_CurrentIndex] = Shoot_IsExploding[Shoot_MaxIndex]
              • Set Shoot_DetectAOE[Shoot_CurrentIndex] = Shoot_DetectAOE[Shoot_MaxIndex]
              • Set Shoot_DamageAOE[Shoot_CurrentIndex] = Shoot_DamageAOE[Shoot_MaxIndex]
              • Set Shoot_CurrentIndex = (Shoot_CurrentIndex - 1)
              • Set Shoot_MaxIndex = (Shoot_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Shoot_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Set Shoot_TempPoint = (Point(((X of NewShoot_MissilePosition[Shoot_CurrentIndex]) + Shoot_AngleX[Shoot_CurrentIndex]), ((Y of NewShoot_MissilePosition[Shoot_CurrentIndex]) + Shoot_AngleY[Shoot_CurrentIndex])))
              • Special Effect - Set Position of NewShoot_MissileSFX[Shoot_CurrentIndex] to Shoot_TempPoint
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains Shoot_TempPoint) Equal to True
                • Then - Actions
                  • -------- --------
                  • -------- TERRAIN --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Terrain type at Shoot_TempPoint) Equal to Black Citadel - Flat Stones
                          • (Terrain type at Shoot_TempPoint) Equal to Ashenvale - Grass
                          • (Terrain type at Shoot_TempPoint) Equal to Barrens - Dirt
                    • Then - Actions
                      • -------- --------
                      • -------- Kill dummy --------
                      • Special Effect - Destroy NewShoot_MissileSFX[Shoot_CurrentIndex]
                      • Set NewShoot_MissileIsAlive[Shoot_CurrentIndex] = False
                    • Else - Actions
                  • -------- --------
                  • -------- UNITS --------
                  • Set Shoot_TempInt = 0
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within Shoot_DetectAOE[Shoot_CurrentIndex] of Shoot_TempPoint) and do (Actions)
                    • Loop - Actions
                      • Set Shoot_TempUnit = (Picked unit)
                      • Set Shoot_TempUnitPoint = (Position of Shoot_TempUnit)
                      • Set Shoot_TempInt = (Shoot_TempInt + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • Shoot_TempInt Less than or equal to 1
                              • (Shoot_TempUnit is alive) Equal to True
                              • (Shoot_TempUnit is invulnerable) Equal to False
                              • Shoot_TempUnit Not equal to Shoot_Caster[Shoot_CurrentIndex]
                        • Then - Actions
                          • -------- --------
                          • -------- Check ammo type before giving damage --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Shoot_IsExploding[Shoot_CurrentIndex] Equal to True
                            • Then - Actions
                              • -------- --------
                              • -------- Double AOE for explosive --------
                              • Set Shoot_DamageAOE[Shoot_CurrentIndex] = (Shoot_DetectAOE[Shoot_CurrentIndex] x 2.00)
                              • -------- --------
                              • -------- Group setup --------
                              • Set Shoot_KBSourceUnit = Shoot_TempUnit
                              • Set Shoot_KBSourceUnitLoc = (Position of Shoot_TempUnit)
                              • Set Shoot_KBAOEGroup = (Units within Shoot_DamageAOE[Shoot_CurrentIndex] of Shoot_KBSourceUnitLoc)
                              • -------- --------
                              • -------- Cause damage in radius --------
                              • Custom script: set bj_wantDestroyGroup = true
                              • Unit Group - Pick every unit in Shoot_KBAOEGroup and do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Shoot_KBSourceUnit Not equal to No unit
                                      • (Shoot_KBAOEGroup is empty) Equal to False
                                    • Then - Actions
                                      • Set Shoot_KBTargetUnit = (Picked unit)
                                      • Set DMG_AllowDamage = True
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Shoot_KBTargetUnit is A ground unit) Equal to True
                                          • (Shoot_KBTargetUnit is Mechanical) Equal to False
                                        • Then - Actions
                                          • -------- --------
                                          • -------- 1.5x damage to organic units --------
                                          • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_KBTargetUnit, dealing (Shoot_Damage[Shoot_CurrentIndex] x 1.50) damage of attack type Spells and damage type Normal
                                        • Else - Actions
                                          • -------- --------
                                          • -------- Normal damage to mech units --------
                                          • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_KBTargetUnit, dealing Shoot_Damage[Shoot_CurrentIndex] damage of attack type Spells and damage type Normal
                                      • Set DMG_AllowDamage = False
                                    • Else - Actions
                              • Custom script: call RemoveLocation(udg_Shoot_KBSourceUnitLoc)
                            • Else - Actions
                              • Set DMG_AllowDamage = True
                              • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_TempUnit, dealing Shoot_Damage[Shoot_CurrentIndex] damage of attack type Spells and damage type Normal
                              • Set DMG_AllowDamage = False
                          • -------- --------
                          • -------- Check unit classification for FX --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Shoot_TempUnit is Mechanical) Equal to False
                              • (Shoot_TempUnit is A structure) Equal to False
                              • (Shoot_TempUnit is Summoned) Equal to False
                            • Then - Actions
                              • -------- --------
                              • -------- Spill blood --------
                              • Special Effect - Create a special effect at Shoot_TempUnitPoint using war3mapImported\EffectSmallBloodEX.mdx
                              • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
                              • Special Effect - Destroy (Last created special effect)
                              • Special Effect - Create a special effect at Shoot_TempUnitPoint using war3mapImported\EffectSplatBleed.mdx
                              • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                          • -------- --------
                          • -------- Kill dummy --------
                          • Special Effect - Destroy NewShoot_MissileSFX[Shoot_CurrentIndex]
                          • Set NewShoot_MissileIsAlive[Shoot_CurrentIndex] = False
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_Shoot_TempUnitPoint)
                  • -------- --------
                  • -------- DESTRUCTIBLES --------
                  • Set Shoot_TempInt = 0
                  • Destructible - Pick every destructible within Shoot_DetectAOE[Shoot_CurrentIndex] of Shoot_TempPoint and do (Actions)
                    • Loop - Actions
                      • Set Shoot_TempDestructible = (Picked destructible)
                      • Set Shoot_TempDestructiblePoint = (Position of Shoot_TempDestructible)
                      • Set Shoot_TempInt = (Shoot_TempInt + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Shoot_TempInt Less than or equal to 1
                          • (Shoot_TempDestructible is alive) Equal to True
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Destructible-type of Shoot_TempDestructible) Equal to Invisible Platform
                                  • (Destructible-type of Shoot_TempDestructible) Equal to Invisible Platform (small)
                            • Then - Actions
                              • -------- Do absolutely nothing --------
                            • Else - Actions
                              • -------- Play hit animation --------
                              • Animation - Play Shoot_TempDestructible's hit animation
                              • Animation - Queue Shoot_TempDestructible's stand animation
                              • -------- --------
                              • -------- Cause damage --------
                              • Destructible - Set life of Shoot_TempDestructible to ((Current life of Shoot_TempDestructible) - Shoot_Damage[Shoot_CurrentIndex])
                              • -------- --------
                              • -------- Kill dummy --------
                              • Special Effect - Destroy NewShoot_MissileSFX[Shoot_CurrentIndex]
                              • Set NewShoot_MissileIsAlive[Shoot_CurrentIndex] = False
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_Shoot_TempDestructiblePoint)
                • Else - Actions
                  • -------- --------
                  • -------- Kill dummy --------
                  • Special Effect - Destroy NewShoot_MissileSFX[Shoot_CurrentIndex]
                  • Set NewShoot_MissileIsAlive[Shoot_CurrentIndex] = False
              • Custom script: call RemoveLocation(udg_Shoot_TempPoint)

Edit: Updated
 
Last edited:
If you're not telling us what doesn't work you wont receive much help.

I just want to change the idea of using units as missiles to SFX. The triggers at the first spoiler works (it uses UNITS as missiles) while the second one doesn't (it is using SFX as missiles). Unfortunately I am having trouble converting the unit missiles to SFX missiles, I tried to replicate the conditions and formulas from the triggers at the first one to the triggers at the second one but I can't identify the problem, it doesn't work, the SFX missile doesn't move at the right direction.
 
Last edited:
Status
Not open for further replies.
Top