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

[Trigger] Creating A Dying Unit At the Spell Location

Status
Not open for further replies.
Level 23
Joined
Jul 26, 2008
Messages
1,321
  • Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Skill_FeralImpact = Feral Impact
      • Set g = -10000.00
      • Set FI_DefaultHeight = 750.00
      • Set FI_EffectA = Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Set FI_EffectB = Abilities\Spells\Human\Feedback\SpellBreakerAttack.mdl
      • Set FI_Sound = units\orc\hellscream\GromYesAttack2.wav
      • Set BF_DefautInterval = 3
  • Shake Camera
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Shake = (Shake - 5.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Shake Greater than 0.00
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Camera - Shake the camera for (Picked player) with magnitude Shake
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Camera - Stop swaying/shaking the camera for (Picked player)
  • Knockback Index
    • Events
    • Conditions
    • Actions
      • Set KB_Max = (KB_Max + 1)
      • Set kb = KB_Max
  • Knockback Move
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer kb) from 1 to KB_Max, do (Actions)
        • Loop - Actions
          • Set point = (Position of KB_Unit[kb])
          • Set point2 = (point offset by KB_Speed[kb] towards KB_Angle[kb] degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain pathing at point2 of type Walkability is off) Equal to True
                  • KB_Dist[kb] Greater than or equal to KB_MaxDist[kb]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KB_Max Equal to 1
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
                  • -------- Recycle index --------
                  • Set KB_Angle[kb] = KB_Angle[KB_Max]
                  • Set KB_Dist[kb] = KB_Dist[KB_Max]
                  • Set KB_MaxDist[kb] = KB_MaxDist[KB_Max]
                  • Set KB_Speed[kb] = KB_Speed[KB_Max]
                  • Set KB_Unit[kb] = KB_Unit[KB_Max]
                  • Set kb = (kb - 1)
              • Set KB_Max = (KB_Max - 1)
            • Else - Actions
              • Unit - Move KB_Unit[kb] instantly to point2
              • Special Effect - Create a special effect at point2 using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set KB_Dist[kb] = (KB_Dist[kb] + KB_Speed[kb])
          • Custom script: call RemoveLocation( udg_point )
          • Custom script: call RemoveLocation( udg_point2 )
  • Feral Impact Index
    • Events
    • Conditions
    • Actions
      • Set FI_Max = (FI_Max + 1)
      • Set fi = FI_Max
  • Feral Impact
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Skill_FeralImpact
    • Actions
      • Trigger - Run Feral Impact Index <gen> (ignoring conditions)
      • Set point = (Position of (Triggering unit))
      • Set point2 = (Target point of ability being cast)
      • Custom script: set udg_tmpCasterZ = GetLocationZ( udg_point )
      • Custom script: set udg_tmpTargetZ = GetLocationZ( udg_point2 )
      • Set tmpDiffHeight = (tmpTargetZ - tmpCasterZ)
      • Set tmpHeight = ((Max(0.00, tmpDiffHeight)) + FI_DefaultHeight)
      • Set tmpDistance = (Distance between point and point2)
      • -------- Setting up data --------
      • Set FI_Hero[fi] = (Triggering unit)
      • Set FI_z[fi] = tmpCasterZ
      • Set FI_Angle[fi] = (Angle from point to point2)
      • Set FI_Vz[fi] = (Square root((-2.00 x (g x tmpHeight))))
      • Set FI_Height[fi] = tmpCasterZ
      • Set tmpTime = (((-1.00 x FI_Vz[fi]) / g) - ((Square root(((-2.00 x g) x (tmpHeight - tmpDiffHeight)))) / g))
      • Set FI_Vp[fi] = (tmpDistance / tmpTime)
      • Set FI_AnimSpeed[fi] = (0.50 / tmpTime)
      • -------- Setting up the rest --------
      • Animation - Change FI_Hero[fi]'s animation speed to (FI_AnimSpeed[fi] x 100.00)% of its original speed
      • Unit - Turn collision for FI_Hero[fi] Off
      • Unit - Add Storm Crow Form to FI_Hero[fi]
      • Unit - Remove Storm Crow Form from FI_Hero[fi]
      • Unit - Make FI_Hero[fi] Invulnerable
      • Special Effect - Create a special effect at point using FI_EffectA
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the chest of FI_Hero[fi] using FI_EffectB
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FI_Sound Not equal to <Empty String>
        • Then - Actions
          • Custom script: set udg_tmpSound = CreateSound( udg_FI_Sound, false, true, false, 12700, 12700, "" )
          • Sound - Play tmpSound at 100.00% volume, attached to FI_Hero[fi]
          • Custom script: call KillSoundWhenDone( udg_tmpSound )
        • Else - Actions
      • -------- Activate! --------
      • Trigger - Turn on Feral Impact Move <gen>
      • Custom script: call RemoveLocation( udg_point )
      • Custom script: call RemoveLocation( udg_point2 )
  • Feral Impact Move
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer fi) from 1 to FI_Max, do (Actions)
        • Loop - Actions
          • Set point = (Position of FI_Hero[fi])
          • Set point2 = (point offset by (FI_Vp[fi] x 0.02) towards FI_Angle[fi] degrees)
          • Unit - Move FI_Hero[fi] instantly to point2
          • Custom script: set udg_real = GetLocationZ( udg_point2 )
          • Set FI_z[fi] = (FI_z[fi] + (FI_Vz[fi] x 0.02))
          • Set FI_Vz[fi] = (FI_Vz[fi] + (g x 0.02))
          • Set real2 = (FI_z[fi] - real)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • real2 Greater than 0.00
            • Then - Actions
              • -------- Barbarian is still flying. --------
              • Animation - Change FI_Hero[fi] flying height to real2 at 0.00
              • Custom script: call RemoveLocation( udg_point2 )
            • Else - Actions
              • -------- Barbarian has landed. Tremble, mortals! --------
              • -------- Animation --------
              • Animation - Change FI_Hero[fi] flying height to 0.00 at 0.00
              • Unit - Turn collision for FI_Hero[fi] On
              • Animation - Change FI_Hero[fi]'s animation speed to 100.00% of its original speed
              • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
              • -------- #2 CUSTOMIZE: change here to change the landing effect --------
              • Special Effect - Create a special effect at point2 using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
              • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
              • Set FI_AnimSpeed[fi] = 1.00
              • Unit - Make FI_Hero[fi] Vulnerable
              • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
              • -------- #3 CUSTOMIZE: change here to set the camera shake magnitude --------
              • Set Shake = 60.00
              • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
              • Trigger - Turn on Shake Camera <gen>
              • -------- Damage and Knockback --------
              • Set FI_FallHeight = (((Max(FI_Height[fi], real)) + FI_DefaultHeight) - real)
              • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
              • -------- #4 CUSTOMIZE: change here to set the damage and AoE --------
              • Set real = (((Real((Level of Skill_FeralImpact for FI_Hero[fi]))) x 75.00) + 225.00)
              • Set real2 = ((((Real((Level of Skill_FeralImpact for FI_Hero[fi]))) x 75.00) + 75.00) x (FI_FallHeight / FI_DefaultHeight))
              • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
              • Floating Text - Create floating text that reads ((String((Integer((FI_FallHeight / (FI_DefaultHeight / 100.00)))))) + %!) above FI_Hero[fi] with Z offset 0.00, using font size 13.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
              • Set group = (Units within real of point2 matching (((Matching unit) belongs to an enemy of (Owner of FI_Hero[fi])) Equal to True))
              • Custom script: call RemoveLocation( udg_point2 )
              • Unit Group - Pick every unit in group and do (Actions)
                • Loop - Actions
                  • Unit - Cause FI_Hero[fi] to damage (Picked unit), dealing real2 damage of attack type Spells and damage type Normal
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A structure) Equal to False
                    • Then - Actions
                      • Trigger - Run Knockback Index <gen> (ignoring conditions)
                      • Set KB_Unit[kb] = (Picked unit)
                      • Set point2 = (Position of KB_Unit[kb])
                      • Set KB_Angle[kb] = (Angle from point to point2)
                      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
                      • -------- #5 CUSTOMIZE: change here to set the knockback range/speed --------
                      • Set KB_MaxDist[kb] = 300.00
                      • Set KB_Speed[kb] = 50.00
                      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
                      • Set KB_Dist[kb] = 0.00
                      • Trigger - Turn on Knockback Move <gen>
                      • Custom script: call RemoveLocation( udg_point2 )
                    • Else - Actions
              • -------- Finish --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FI_Max Equal to 1
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
                  • -------- Recycle index --------
                  • Set FI_Angle[fi] = FI_Angle[FI_Max]
                  • Set FI_AnimSpeed[fi] = FI_AnimSpeed[FI_Max]
                  • Set FI_Height[fi] = FI_Height[FI_Max]
                  • Set FI_Hero[fi] = FI_Hero[FI_Max]
                  • Set FI_Vp[fi] = FI_Vp[FI_Max]
                  • Set FI_Vz[fi] = FI_Vz[FI_Max]
                  • Set FI_z[fi] = FI_z[FI_Max]
                  • Set fi = (fi - 1)
              • Set FI_Max = (FI_Max - 1)
              • Custom script: call DestroyGroup( udg_group )
          • Custom script: call RemoveLocation( udg_point )

Hi guys, as i mentioned below, the spell is working fine, its just that at the location i jump to, it creates one of my custom units that dies instantly. The unit is created when i click on the jump location, not after i land. I keep looking through the code for where it would be creating a dummy unit or something that i didn't copy over but i cannot find a place where i should input a unit.

Link to Jump spell ("Feral Impact") Barbarian Skills 1.1
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,321
Hi LordDz haha its funny that you posted before i even managed to make finish my post. I am currently having trouble posting the trigger to the site. What i meant to say is there is a spell i have copied that works perfectly, a leap spell, but when i click on the target location it creates a dying unit instantly. Everything else works fine. I am trying to post the trigger, but here is the link for your reference while i am trying to fix it.

Barbarian Skills 1.1

Its the feral impact spell ( with the knock back )/
 
Level 23
Joined
Jul 26, 2008
Messages
1,321
Ok so i kept playing around with the trigger. I made my own test map and deleted every other trigger and it still greated the dying unit. I then went back to the spell map that i downloaded the leap spell from and deleted everything trigger/object data in hoping of recreating this unit bug in hope that it was something i was missing. This did not work either. I then decided to delete the custom unit from my map that was the dying unit itself and guess what there is no more issue. Can i ask, is there anyway for me to get around this without removing the custom unit itself?


Edit 1: I have recreated the unit in the spell map, and after importing the unit the spell in the spellmap also has the exact same bug. The unit is based off a grunt, and it only has 4 fields changed: Its model, its sound, its portrait and its name. I will check all 4 things now and get back to you guys.

Edit 2: Ok I did trial by error with all 4 attributes and reverting them back to normal did not do anything to change the issue. I then tried starting a new version of the spell map, and created a custom grunt without changing any of the 4 attributes. When i started using leap it then caused the bug with the normal grunt model. So, i have confirmed, if you download the map from the link below, and if you copy and paste a grunt (creating a custom unit, which is a still a normal grunt, in the object editor) then this bug triggers.
Barbarian Skills 1.1

So my question is, does anyone know of why a spell like this would have a link to a unit such that i cannot use a grunt as my base unit for any of my custom units unless i want to forsake using this spell? Haha thanks guys!
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,321
Ah i see. But why would it matter then that it is only a custom unit based on a grunt that triggers it while nothing else does. Or are there some questions that do not have answers with the world editor lol
 
Status
Not open for further replies.
Top