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

Advanced KnockBack 3D System V.3.2b

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Skyflash Presents:
GUI KnockBack 3D System
This a Full featured Multi-movement System
-------------------------------------------------------------------------------


Changelog


  • v3.2:
  • Default Animation speed removed user must consider a proper Animation speed
  • Some minor bugs fixed(view Bpower`s last post)
  • Dummy Creation Feature Fixed completely
  • You have to Specify the type of dummy unit in order to use it
  • Special effect mechanism changed now it doesn`t leak any more

    v3.0:
  • Removed Unwanted Features and Trim the system to a simple form but with most of the features
  • sound Feature , Order Feature , invulnerable feature , Hashtable Feature , and all of the minor Features Removed in order to reduce the volume of System
  • Added Initial and final Height to system`s Height Formula (check out Leap Example to see a incomplete Arc
  • Made System Leakless as possible my main purpose of Updating spell was to greatly reduce Handle Counts as they appear as Leak (Credit for SAUS for Helping me find Blizzard`s BJ Code Faults which is Creating a lot of Leaks )
    this time I claim to have one of the most leakless spells in the Hive resource you can test the Leak counts by typing -debug inside game
  • Damage Feature won`t use a bloated structure it would damage only Enemies thats it
  • Treekilling feature will apply the Ignore_Height mini feature automatically since it`s more realistic and flying over trees and chopping them down doesn`t make any sense to me
  • Increased the accuracy of Collision Detection Feature


    v2.5:
  • Sound Feature:You can Set a Sound track to be played during a knockback
  • Stoppable Condition : If the knockbacking unit get stunned during a knock-back he will be stopped configurable via Kb3d_Stoppable Boolean
  • Crow Form Ability glitch Fixed: a condition added to Core for filtering Units with Crow form ability
  • Order Feature Improved: the knock-backing units can get orders during a knock-back three form of ordering covered No targeted Orders - Unit targeted orders -Point targeted Orders
    -------------------------
    No targeted Orders: Jumper can easily issue an no targeted order during a knock-back for controlling the number of orders just consider a proper cooldown for your instant spells
    --------------------------
    Unit targeted Orders : jumper will cast spells on nearby Units during a knock-back the picking range related to damage feature because of it`s nice filtering condition and to reduce the Loop inside loops (can cause lag) consider proper targets in object editor
    -----------------------
    Point targeted Orders : Jumper will cast spells in specific points the priority of picking the point is the point type variable , random points near unit or origin of the unit
    -----------------------
  • Fixed Missile Death Bug: now the missile will show the death animation correctly
  • Missile Feature Improved: Added Death delay and missile duration variables to improve the function of Missile feature



    v2.0:
  • 2D Vertical Motion Added! you can now use 90 degree as initial Angle you will have to set Angle 90 and Set a Maximum height to Use this Motion
    (Use Massive Crush Spell near enemy units to see the new feature!)

  • there was a huge mistake in code that i thought i never gonna fix it now the system won`t use Unit-MaketoFace Function !
  • Facing Feature Added! : You can set a manual Facing Angle for Knockbacking unit and make him move toward that angle !
  • Circular Motion Added !: you can set a offset angle for unit this angle will be added to unit`s Face that creates an Circular Motion!

    v1.3:
  • There was a mui bug in the Recycling indexes now its fixed
    Order bug fixed because of the nature of this spell unit can attack move cast spell ... etc during a jump even when you pause him now this issue fixed
  • New feature: there is a boolean called kb3d_GetOrdersIntrupt if you set it true you can cancel a jump or knockback by ordering unit to do something else like moving it order to attack cast etc ... (like spirit`s charge in dota :D)
  • Changed damage Plugin completely : I noticed that the damage feature is not optimum at all in every cases the system picked up different type of units but what if picking them once then decide to what to do with them
    Most important change in Damage feature is damaging units once i`ve created a method to filter out the damaged units so units will be damaged once not multiply times ! if you want to damage them multiply times just add a immolation ability to Jumper then remove it later.
  • there is a boolean called kb3d_GetDamage_Buildings to determine whether system damages buildings too or not

    v1.0:
    Beta version and a total core remake of my previous System due to it`s problems i`ve updated it to a new beta version with a lot of fixes
    whats new in Beta version?
  • New Core: the Core of system has changed completely the last version used a save and load via hashtable method in order to run the System now it uses an effective Dynamic Indexing Method which is very faster than Hashtables
  • Better API: the input method changed completely the user no longer need to save any value and memorize every single hashtable labels to manage a jump i`ve changed the API and made it more User-Friendly now user just have to set Global Variables with a "Get" prefix for using the system please read "action" trigger to realize the input variables.
  • Better implementation of knockback : the last version didn`t have good implementation of a jump because of using a bad method to manage a jump this new version is using new method which is closer to reality and it`s governing equations of motion , now the jumper travels a Parabolic trajectory to reach his destination.
  • input variables Changed: in the previous version the input variables weren`t clear enough and maybe they confused the user ,memorizing Hashtables was hard enough and the Vz,V,T,effect1 .... etc didn`t make any point for the user ; in this new version you`ll need to set a velocity and an initial Angle a unit and 2 points in order to setup a simple knockback and every features using a Boolean like a button to turn them on or off
  • Animation Feature has changed a little bit :you can either define an animation speed or let system take care of that
  • Tree killer feature slightly changed , same function but this feature no longer use damage`s radius as checking trees and added a minor option called Kb3d_IgnoreHeight this option is true as default but if you set it false you`ll see the knockback only destroys trees when ever the Jumper unit`s flying height is lesser than height of the tree!

  • Damaged Feature has Changed completely you can manage any possible cases to damage or heal units when the jumper passes through them ( 4 cases)
    case 1: damages enemy units
    case 2: heals Allies
    case 3: damages anyone except the caster
    case 4: damages enemy units and heals allies
  • new feature called trigger feature this feature allows user to run a trigger right after the knockback is finished you can combine it with dummy creation feature

  • Removed every possible Location leaks the system only uses temporary location which is removed immediately after they allocated

  • Store last jump`s data into hashtable : well is saw a lot of hatred about hashtables from the code moderators and decided make it an optional feature to save some data from last jump like max height duration and traveled distance , kb3d_GetStoreData variable can be used to enable or disable this feature.
  • invulnerable jumpers: new feature that you can define whether your jumper unit appears as an invulnerable unit or not

  • the system no longer uses Unit_move function instead of that i used setX and SetY functions that means the unit can get order during the jump

  • Optional Pause unit feature:the previous system doesn`t support Unpaused units to knockback them now with the new core paused and unpaused units can be moved there is an boolean kb3d_GetPause to manage whether the knockbacking unit get paused during a jump or not
-------------------------------------------------------------------------------

What does the system do?
this an Multi-Motion system you can create any form of motion with this system

How to import it into my map?
To import this system to your map first when you are in Mapeditor go to 'File/Prefrences' and make sure the " Automatically Create unknown variables while pasting trigger data " is enabled
then simply copy and paste the KnockBack 3D Catagory to your map ..... you done :D


The system has 11 Main features

Missile Feature:this feather kills the jumper after a knockback which is very nice technique for calling it later

Pathability Feature:This feather determine whether the jumper can pass through unpathable objects or not

Collision Feature : the jumper will be stopped when ever he approach enough to an enemy unit

Effect Feature: 4 static and one dynamic feature for make your jump more graphical

Animation Feature: you can set an animation to be played during a jump

Tree killer Feature: this feature destroys tress when ever jumper passes through them and there is an optional feature that called realistic treekiller this feature destroys trees only when the jumper`s height is lesser than tree`s height

Damage Feature: a high configurable damage system that you can filter any possible cases to damage or heal units when the jumper passes through them

DummyCreation Feature: system will create specific units after a jump

Trigger Feature: the system automatically run specific Trigger after the jump finished

2D Vertical Motion : you can simulate a 2D Vertical Motion with a maximum Height

Circular Motion : you can make Circular motions as well as other forms of motions with an offset Angle


and a lot of minor features like store some useful data from last jump ,make jumper invulnerable during a jump, pause a unit during the jump and most important one you can cast spells during a jump!


Please read ' readme' and 'actions' to become familiar to system`s input variables
and don`t forget to credit me if you use this system in your map

Credit:Hanky for his Awesome Dynamic Indexing System my method mainly inspired from his template .


  • KnockBack 3D
    • Events
    • Conditions
    • Actions
      • -------- Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kb3d_Index Equal to 0
        • Then - Actions
          • Trigger - Turn on KnockBack 3D Loop <gen>
        • Else - Actions
      • Set kb3d_Index = (kb3d_Index + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kb3d_Index Greater than kb3d_IndexMax
        • Then - Actions
          • Set kb3d_IndexA[kb3d_Index] = kb3d_Index
          • Set kb3d_IndexMax = kb3d_Index
        • Else - Actions
      • Set kb3d_TempInt = kb3d_IndexA[kb3d_Index]
      • -------- initial Setting --------
      • Set kb3d_Unit[kb3d_TempInt] = kb3d_GetUnit
      • Set kb3d_TempLoc = kb3d_GetPointA
      • Set kb3d_TempLoc2 = kb3d_GetPointB
      • Set kb3d_Velocity[kb3d_TempInt] = kb3d_GetVelocity
      • Set kb3d_Angle[kb3d_TempInt] = kb3d_GetAngle
      • Set kb3d_Z0[kb3d_TempInt] = kb3d_GetZ0
      • Set kb3d_Zf[kb3d_TempInt] = kb3d_GetZf
      • Set kb3d_Face[kb3d_TempInt] = kb3d_GetFace
      • Set kb3d_FaceOffset[kb3d_TempInt] = kb3d_GetFaceOffset
      • Set kb3d_Player[kb3d_TempInt] = (Owner of kb3d_Unit[kb3d_TempInt])
      • Custom script: set udg_kb3d_Damage_Filter[udg_kb3d_TempInt]=CreateGroup()
      • Custom script: set udg_kb3d_DummyG=CreateGroup()
      • -------- Maximum Distance --------
      • Set kb3d_R[kb3d_TempInt] = (Distance between kb3d_TempLoc and kb3d_TempLoc2)
      • -------- Maximum Height --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kb3d_Angle[kb3d_TempInt] Equal to 90.00
        • Then - Actions
          • -------- Vertical Motion --------
          • Set kb3d_Zmax[kb3d_TempInt] = kb3d_GetZmax
          • Set kb3d_R[kb3d_TempInt] = (4.00 x kb3d_Zmax[kb3d_TempInt])
          • Set kb3d_Angle[kb3d_TempInt] = 45.00
          • Set kb3d_VerticalMotion[kb3d_TempInt] = True
        • Else - Actions
          • Set kb3d_Zmax[kb3d_TempInt] = ((kb3d_R[kb3d_TempInt] x (Tan(kb3d_Angle[kb3d_TempInt]))) / 4.00)
      • -------- Load Knockback Conditons --------
      • Set kb3d_Pause[kb3d_TempInt] = kb3d_GetPause
      • Set kb3d_StoreData[kb3d_TempInt] = kb3d_GetStoreData
      • Set kb3d_Missile[kb3d_TempInt] = kb3d_GetMissile
      • Set kb3d_invulnerability[kb3d_TempInt] = kb3d_GetInvulnerability
      • Set kb3d_OrdersIntrupt[kb3d_TempInt] = kb3d_GetOrdersIntrupt
      • Set kb3d_Stoppable[kb3d_TempInt] = kb3d_GetStoppable
      • -------- KnockBack Factor is the magnitude of a jump --------
      • Set kb3d_Factor[kb3d_TempInt] = kb3d_GetFactor
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kb3d_invulnerability[kb3d_TempInt] Equal to True
        • Then - Actions
          • Unit - Add Invulnerable (Neutral) to kb3d_Unit[kb3d_TempInt]
        • Else - Actions
      • -------- Required For Jumping --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Crow Form for kb3d_Unit[kb3d_TempInt]) Equal to 0
        • Then - Actions
          • Unit - Add Crow Form to kb3d_Unit[kb3d_TempInt]
          • Unit - Remove Crow Form from kb3d_Unit[kb3d_TempInt]
        • Else - Actions
      • Unit - Move kb3d_Unit[kb3d_TempInt] instantly to kb3d_TempLoc
      • Unit - Turn collision for kb3d_Unit[kb3d_TempInt] Off
      • Set kb3d_Finished[kb3d_TempInt] = False
      • Set kb3d_Stop[kb3d_TempInt] = False
      • -------- clean this --------
      • Custom script: call RemoveLocation(udg_kb3d_TempLoc)
      • Custom script: call RemoveLocation(udg_kb3d_TempLoc2)
      • -------- Load Plugins --------
      • -------- Dummy Creation Feature --------
      • -------- This Feature Will Create a dummy unit with given characteristics --------
      • Set kb3d_DummyCreation[kb3d_TempInt] = kb3d_GetDummyCreation
      • Set kb3d_DummyNum[kb3d_TempInt] = kb3d_GetDummyNum
      • Set kb3d_DummyType[kb3d_TempInt] = kb3d_GetDummyType
      • Set kb3d_DummyLifespan[kb3d_TempInt] = kb3d_GetDummyLifespan
      • -------- Animation Feature --------
      • -------- This Feature Force Jumping unit to play a specific animation --------
      • Set kb3d_Animation[kb3d_TempInt] = kb3d_GetAnimation
      • Set kb3d_AnimationIndex[kb3d_TempInt] = kb3d_GetAnimationIndex
      • Set kb3d_AnimationSpeed[kb3d_TempInt] = kb3d_GetAnimationSpeed
      • -------- Missile Feature --------
      • Set kb3d_Missile_DeathDelay[kb3d_TempInt] = kb3d_GetMissile_DeathDelay
      • Set kb3d_Missile_Duration[kb3d_TempInt] = kb3d_GetMissile_Duration
      • -------- TreeKiller Feature --------
      • Set kb3d_TreeKilling[kb3d_TempInt] = kb3d_GetTreeKilling
      • Set kb3d_TreeK_Radius[kb3d_TempInt] = kb3d_GetTreeK_Radius
      • Set kb3d_TreeK_IgnoreHeight[kb3d_TempInt] = kb3d_GetTreeK_IgnoreHeight
      • -------- Damage Feature --------
      • Set kb3d_Damage[kb3d_TempInt] = kb3d_GetDamage
      • Set kb3d_Damage_Amount[kb3d_TempInt] = kb3d_GetDamage_Amount
      • Set kb3d_Damage_Radius[kb3d_TempInt] = kb3d_GetDamage_Radius
      • Set kb3d_Damage_Type[kb3d_TempInt] = kb3d_GetDamage_Type
      • Set kb3d_Damage_Buildings[kb3d_TempInt] = kb3d_GetDamage_Buildings
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kb3d_Damage_Amount[kb3d_TempInt] Greater than 0.00
          • kb3d_Damage_Radius[kb3d_TempInt] Greater than 0.00
        • Then - Actions
          • Set kb3d_Damage[kb3d_TempInt] = True
        • Else - Actions
      • -------- Effects Feature --------
      • Set kb3d_Effect_1st[kb3d_TempInt] = kb3d_GetEffect_1st
      • Set kb3d_Effect_2nd[kb3d_TempInt] = kb3d_GetEffect_2nd
      • Set kb3d_Effect_3rd[kb3d_TempInt] = kb3d_GetEffect_3rd
      • Set kb3d_Effect_4th[kb3d_TempInt] = kb3d_GetEffect_4th
      • Set kb3d_Effect_Dy_model[kb3d_TempInt] = kb3d_GetEffect_Dy_model
      • Set kb3d_Effect_Dy_attach[kb3d_TempInt] = kb3d_GetEffect_Dy_attach
      • -------- Collision Feature --------
      • Set kb3d_Collide[kb3d_TempInt] = kb3d_GetCollide
      • Set kb3d_Collide_MaxRadius[kb3d_TempInt] = kb3d_GetCollide_MaxRadius
      • Set kb3d_Collide_MinRadius[kb3d_TempInt] = kb3d_GetCollide_MinRadius
      • -------- Pathability Feature --------
      • Set kb3d_Path[kb3d_TempInt] = kb3d_GetPath
      • -------- Trigger Run Feature Feature --------
      • Set kb3d_Trigger[kb3d_TempInt] = kb3d_GetTrigger
      • -------- Nulling Global Variables --------
      • -------- This is your Time saviour if your are to lazy like me to reset every feature`s varables for the new jump :D --------
      • Set kb3d_GetUnit = No unit
      • Set kb3d_GetVelocity = 0.00
      • Set kb3d_GetPause = True
      • Set kb3d_GetTreeKilling = False
      • Set kb3d_GetDummyCreation = False
      • Set kb3d_GetDummyNum = 1
      • Set kb3d_GetDummyType = No unit-type
      • Set kb3d_GetAngle = 45.00
      • Set kb3d_GetFactor = 1.00
      • Set kb3d_GetAnimation = False
      • Set kb3d_GetAnimationIndex = -1
      • Set kb3d_GetAnimationSpeed = 0.00
      • Set kb3d_GetCollide = False
      • Set kb3d_GetCollide_MaxRadius = 0.00
      • Set kb3d_GetCollide_MinRadius = 0.00
      • Set kb3d_GetDamage_Amount = 0.00
      • Set kb3d_GetDamage_Radius = 0.00
      • Set kb3d_GetDamage_Type = Magic
      • Set kb3d_GetDamage_Buildings = False
      • Set kb3d_GetDummyLifespan = 0.00
      • Set kb3d_GetEffect_Dy_attach = <Empty String>
      • Set kb3d_GetEffect_Dy_model = <Empty String>
      • Set kb3d_GetMissile = False
      • Set kb3d_GetPath = False
      • Set kb3d_GetTreeK_Radius = 0.00
      • Set kb3d_GetFace = 0.00
      • Set kb3d_GetFaceOffset = 0.00
      • Set kb3d_GetMissile_Duration = 0.00
      • Set kb3d_GetMissile_DeathDelay = 0.01
      • Set kb3d_GetMissile_RemainAtRest = False
      • Set kb3d_GetZ0 = 0.00
      • Set kb3d_GetZf = 0.00
      • Custom script: set udg_kb3d_GetTrigger = null
      • Custom script: set udg_kb3d_GetEffect_1st = null
      • Custom script: set udg_kb3d_GetEffect_2nd = null
      • Custom script: set udg_kb3d_GetEffect_3rd = null
      • Custom script: set udg_kb3d_GetEffect_4th = null
  • ll
  • KnockBack 3D Loop
    • KnockBack 3D Loop
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer kb3d_Int) from 1 to kb3d_Index, do (Actions)
          • Loop - Actions
            • -------- Periodic Setting --------
            • Set kb3d_TempInt = kb3d_IndexA[kb3d_Int]
            • Set kb3d_TempLoc = (Position of kb3d_Unit[kb3d_TempInt])
            • Set kb3d_TempLoc3 = (kb3d_TempLoc offset by (kb3d_Velocity[kb3d_TempInt] x (Cos(kb3d_Angle[kb3d_TempInt]))) towards kb3d_Face[kb3d_TempInt] degrees)
            • Set kb3d_X[kb3d_TempInt] = (X of kb3d_TempLoc3)
            • Set kb3d_Y[kb3d_TempInt] = (Y of kb3d_TempLoc3)
            • Set kb3d_r[kb3d_TempInt] = (kb3d_r[kb3d_TempInt] + (kb3d_Velocity[kb3d_TempInt] x (Cos(kb3d_Angle[kb3d_TempInt]))))
            • Set kb3d_h[kb3d_TempInt] = (((4.00 x kb3d_Zmax[kb3d_TempInt]) / kb3d_R[kb3d_TempInt]) x ((kb3d_R[kb3d_TempInt] - kb3d_r[kb3d_TempInt]) x ((kb3d_r[kb3d_TempInt] / kb3d_R[kb3d_TempInt]) x kb3d_Factor[kb3d_TempInt])))
            • Set kb3d_h[kb3d_TempInt] = (kb3d_h[kb3d_TempInt] + ((kb3d_r[kb3d_TempInt] x ((kb3d_Zf[kb3d_TempInt] - kb3d_Z0[kb3d_TempInt]) / kb3d_R[kb3d_TempInt])) + kb3d_Z0[kb3d_TempInt]))
            • Set kb3d_Z[kb3d_TempInt] = (Current flying height of kb3d_Unit[kb3d_TempInt])
            • Set kb3d_t[kb3d_TempInt] = (kb3d_t[kb3d_TempInt] + 0.03)
            • Set kb3d_Counter[kb3d_TempInt] = (kb3d_Counter[kb3d_TempInt] + 1)
            • -------- ======================= --------
            • -------- Plugins --------
            • -------- ======================= --------
            • -------- Order Bug Fixer --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_OrdersIntrupt[kb3d_TempInt] Equal to True
                • (Current order of kb3d_Unit[kb3d_TempInt]) Equal to (Order(smart))
              • Then - Actions
                • Set kb3d_Stop[kb3d_TempInt] = True
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Pause[kb3d_TempInt] Equal to True
              • Then - Actions
                • Unit - Order kb3d_Unit[kb3d_TempInt] to Stop
              • Else - Actions
            • -------- Animation Feature --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Animation[kb3d_TempInt] Equal to True
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • kb3d_AnimationIndex[kb3d_TempInt] Greater than -1
                  • Then - Actions
                    • Custom script: call SetUnitAnimationByIndex( udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_AnimationIndex[udg_kb3d_TempInt])
                    • Animation - Change kb3d_Unit[kb3d_TempInt]'s animation speed to kb3d_AnimationSpeed[kb3d_TempInt]% of its original speed
                  • Else - Actions
              • Else - Actions
            • -------- Effects Feature --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Effect_Dy_model[kb3d_TempInt] Not equal to <Empty String>
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • kb3d_Effect_Dy_attach[kb3d_TempInt] Not equal to <Empty String>
                  • Then - Actions
                    • Special Effect - Create a special effect attached to the kb3d_Effect_Dy_attach[kb3d_TempInt] of kb3d_Unit[kb3d_TempInt] using kb3d_Effect_Dy_model[kb3d_TempInt]
                    • Special Effect - Destroy (Last created special effect)
                  • Else - Actions
                    • Special Effect - Create a special effect at kb3d_TempLoc3 using kb3d_Effect_Dy_model[kb3d_TempInt]
                    • Special Effect - Destroy (Last created special effect)
              • Else - Actions
            • -------- Damage Feature --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Damage[kb3d_TempInt] Equal to True
              • Then - Actions
                • Custom script: set udg_kb3d_tempgroup=CreateGroup()
                • Custom script: call GroupEnumUnitsInRange(udg_kb3d_tempgroup, GetLocationX(udg_kb3d_TempLoc), GetLocationY(udg_kb3d_TempLoc), udg_kb3d_Damage_Radius[udg_kb3d_TempInt], null)
                • Unit Group - Pick every unit in kb3d_tempgroup and do (Actions)
                  • Loop - Actions
                    • Set kb3d_TempUnit = (Picked unit)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • kb3d_Damage_Buildings[kb3d_TempInt] Equal to False
                        • (kb3d_TempUnit is A structure) Equal to True
                      • Then - Actions
                        • Unit Group - Add kb3d_TempUnit to kb3d_Damage_Filter[kb3d_TempInt]
                      • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (kb3d_TempUnit is dead) Equal to False
                        • (kb3d_TempUnit is in kb3d_Damage_Filter[kb3d_TempInt]) Equal to False
                        • (kb3d_TempUnit belongs to an enemy of kb3d_Player[kb3d_TempInt]) Equal to True
                      • Then - Actions
                        • -------- Check If Buildings can be damaged or not --------
                        • Custom script: call RemoveLocation(udg_kb3d_TempLoc)
                        • Unit - Cause kb3d_Unit[kb3d_TempInt] to damage kb3d_TempUnit, dealing kb3d_Damage_Amount[kb3d_TempInt] damage of attack type Spells and damage type kb3d_Damage_Type[kb3d_TempInt]
                        • Unit Group - Add kb3d_TempUnit to kb3d_Damage_Filter[kb3d_TempInt]
                      • Else - Actions
                • Custom script: call DestroyGroup(udg_kb3d_tempgroup)
              • Else - Actions
            • -------- TreeKiller Feature --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_TreeKilling[kb3d_TempInt] Equal to True
              • Then - Actions
                • Custom script: set udg_kb3d_ktTempRec = GetRectFromCircleBJ(udg_kb3d_TempLoc,udg_kb3d_TreeK_Radius[udg_kb3d_TempInt])
                • Destructible - Pick every destructible in kb3d_ktTempRec and do (Actions)
                  • Loop - Actions
                    • Set kb3d_Des_Check = (Picked destructible)
                    • Trigger - Run Knockback DesFilter <gen> (checking conditions)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • kb3d_DesKillable Equal to True
                        • kb3d_Z[kb3d_TempInt] Less than 70.00
                      • Then - Actions
                        • Destructible - Kill (Picked destructible)
                      • Else - Actions
                • Custom script: call RemoveRect(udg_kb3d_ktTempRec)
              • Else - Actions
            • -------- Pathability Feature --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Path[kb3d_TempInt] Equal to True
              • Then - Actions
                • Set kb3d_CP_Point = kb3d_TempLoc3
                • Trigger - Run Knockback Walkability <gen> (checking conditions)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • kb3d_CP_PointIsWalkable Equal to False
                  • Then - Actions
                    • Set kb3d_Stop[kb3d_TempInt] = True
                  • Else - Actions
                • Custom script: call RemoveLocation(udg_kb3d_CP_Point)
              • Else - Actions
            • -------- Collision Feature --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Collide[kb3d_TempInt] Equal to True
              • Then - Actions
                • Custom script: set udg_kb3d_tempgroup1=CreateGroup()
                • Custom script: call GroupEnumUnitsInRange(udg_kb3d_tempgroup1, GetLocationX(udg_kb3d_TempLoc), GetLocationY(udg_kb3d_TempLoc), udg_kb3d_Collide_MaxRadius[udg_kb3d_TempInt], null)
                • Unit Group - Pick every unit in kb3d_tempgroup1 and do (Actions)
                  • Loop - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • ((Picked unit) belongs to an enemy of kb3d_Player[kb3d_TempInt]) Equal to True
                      • Then - Actions
                        • Set kb3d_TempLoc2 = (Position of (Picked unit))
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Distance between kb3d_TempLoc and kb3d_TempLoc2) Less than or equal to kb3d_Collide_MinRadius[kb3d_TempInt]
                          • Then - Actions
                            • Set kb3d_Stop[kb3d_TempInt] = True
                          • Else - Actions
                      • Else - Actions
                • Custom script: call DestroyGroup(udg_kb3d_tempgroup1)
              • Else - Actions
            • -------- Stop Conditons --------
            • -------- i don`t think any unit should cross borders --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Playable map area) contains kb3d_TempLoc3) Equal to False
              • Then - Actions
                • Set kb3d_Stop[kb3d_TempInt] = True
              • Else - Actions
            • -------- Remove the Points --------
            • Custom script: call RemoveLocation(udg_kb3d_TempLoc)
            • Custom script: call RemoveLocation(udg_kb3d_TempLoc2)
            • Custom script: call RemoveLocation(udg_kb3d_TempLoc3)
            • -------- Checking whether the unit reached to his destination or not --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (kb3d_R[kb3d_TempInt] - kb3d_r[kb3d_TempInt]) Less than or equal to 0.00
              • Then - Actions
                • Set kb3d_Stop[kb3d_TempInt] = True
              • Else - Actions
            • -------- End Of a Knockback --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • kb3d_Stop[kb3d_TempInt] Equal to True
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • kb3d_Missile[kb3d_TempInt] Equal to True
                  • Then - Actions
                    • Unit - Add a kb3d_Missile_DeathDelay[kb3d_TempInt] second Generic expiration timer to kb3d_Unit[kb3d_TempInt]
                  • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • kb3d_DummyCreation[kb3d_TempInt] Equal to True
                  • Then - Actions
                    • Set kb3d_TempLoc = (Position of kb3d_Unit[kb3d_TempInt])
                    • Unit - Create kb3d_DummyNum[kb3d_TempInt] kb3d_DummyType[kb3d_TempInt] for kb3d_Player[kb3d_TempInt] at kb3d_TempLoc facing Default building facing degrees
                    • Unit - Add a kb3d_DummyLifespan[kb3d_TempInt] second Generic expiration timer to (Last created unit)
                    • Unit Group - Add (Last created unit) to kb3d_DummyG
                    • Custom script: call RemoveLocation(udg_kb3d_TempLoc)
                  • Else - Actions
                • -------- Store Some Usefull Datas from knockback --------
                • Set kb3d_Finished[kb3d_TempInt] = True
                • -------- Runs a trigger after a jump --------
                • Trigger - Run kb3d_Trigger[kb3d_TempInt] (checking conditions)
                • -------- Reset Unit --------
                • Animation - Change kb3d_Unit[kb3d_TempInt] flying height to (Default flying height of kb3d_Unit[kb3d_TempInt]) at 0.00
                • Unit - Turn collision for kb3d_Unit[kb3d_TempInt] On
                • Unit - Unpause kb3d_Unit[kb3d_TempInt]
                • Animation - Reset kb3d_Unit[kb3d_TempInt]'s animation
                • Animation - Change kb3d_Unit[kb3d_TempInt]'s animation speed to 100.00% of its original speed
                • -------- Remove Leaks and reset values to default --------
                • Special Effect - Destroy kb3d_Effect_1st[kb3d_TempInt]
                • Special Effect - Destroy kb3d_Effect_2nd[kb3d_TempInt]
                • Special Effect - Destroy kb3d_Effect_3rd[kb3d_TempInt]
                • Special Effect - Destroy kb3d_Effect_4th[kb3d_TempInt]
                • Custom script: set udg_kb3d_Unit[udg_kb3d_TempInt] = null
                • Custom script: call DestroyGroup(udg_kb3d_Damage_Filter[udg_kb3d_TempInt])
                • Set kb3d_Velocity[kb3d_TempInt] = 0.00
                • Set kb3d_Zmax[kb3d_TempInt] = 0.00
                • Set kb3d_r[kb3d_TempInt] = 0.00
                • Set kb3d_h[kb3d_TempInt] = 0.00
                • Set kb3d_t[kb3d_TempInt] = 0.00
                • Set kb3d_X[kb3d_TempInt] = 0.00
                • Set kb3d_Y[kb3d_TempInt] = 0.00
                • Set kb3d_VerticalMotion[kb3d_TempInt] = False
                • Set kb3d_Counter[kb3d_TempInt] = 0
                • -------- Recycle --------
                • Set kb3d_IndexA[kb3d_Int] = kb3d_IndexA[kb3d_Index]
                • Set kb3d_IndexA[kb3d_Index] = kb3d_TempInt
                • Set kb3d_Index = (kb3d_Index - 1)
                • Set kb3d_Int = (kb3d_Int - 1)
              • Else - Actions
                • -------- Change X Y Z and Yaw of Jumper --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • kb3d_VerticalMotion[kb3d_TempInt] Equal to False
                  • Then - Actions
                    • Custom script: call SetUnitX(udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_X[udg_kb3d_TempInt])
                    • Custom script: call SetUnitY(udg_kb3d_Unit[udg_kb3d_TempInt] , udg_kb3d_Y[udg_kb3d_TempInt])
                  • Else - Actions
                • Animation - Change kb3d_Unit[kb3d_TempInt] flying height to kb3d_h[kb3d_TempInt] at 0.00
                • Set kb3d_Face[kb3d_TempInt] = (kb3d_Face[kb3d_TempInt] + kb3d_FaceOffset[kb3d_TempInt])
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • kb3d_Index Equal to 0
          • Then - Actions
            • Trigger - Turn off (This trigger)
          • Else - Actions




Keywords:
GUI,MUI,Jump,System,Knock,Back,Knockback,3D,Skyflash,Rush,Leap,Mirana,fly,arrow,boulder,missile,circular,motion,2d,vertical,horizontal,Magnataur,
Contents

Spells (Map)

Reviews
BPower: Once again I've wrote a review for you system ( link ), so you can adjust your code in your own map. I don't get the feeling that this develops towards approval, not even close. Furthermore we have many high quality resources in our...

Moderator

M

Moderator

BPower: Once again I've wrote a review for you system ( link ), so you can adjust your code in your own map.
I don't get the feeling that this develops towards approval, not even close.
Furthermore we have many high quality resources in our database,
which cover 2D and 3D unit motion.

BPower: I wrote a few questions into the comments.
Removed the rating I gave in the last review.
Otherwise refer to my old review.

13:47, 19th Feb 2016
BPower: Feature bloated code abomination.
I rather recommend using one of the approved well structured
knockback systems from our database.

13:51, 3th Feb 2016
BPower: Set back to Need Fix until [self=http://www.hiveworkshop.com/forums/spells-569/gui-knockback-3d-jump-system-beta-v1-0-a-269237/#post2783284] you wrote a changelog[/self]


10:00, 6th Oct 2015
Bribe:

Pros
+ Has a lot of features

Cons
- Pauses the unit being knocked back and there is no configurable to change this
- Pathing check is done with an item, so any unit with collision size greater than 16 can get stuck
- Paladon's deprecated Knockback had a better implementation of. knockback
- Uses unit groups and hashtables, making it extremely slow (knockbacks need to be as fast as possible and this is among the slowest)

Recommendation
? Build your stuff on top of one of the many approved knockback systems.

20.01.2016, BPower:
I say it directly. I don't see a chance for approval for this system. Only with a radical change in code.
Reasons:
  • Knockback / Missile systems must be fast, hence FroGroup + hashtable is a very bad choice.
    ---
  • Unit groups lose units which are removed, therefore you have high potential for leaks.
    ---
  • I found handles leaks in your code ( group and location )
    ---
  • Couldn't find where you flush a childkey in the hashtable.
    ---
  • The API is terrible. A user shouldn't save into a hashtable. Instead he / she assigns globals and the system transfers them to the table internally.
    ---
 
Level 5
Joined
Mar 6, 2015
Messages
130
thanks for reply

Actually i was very eager to find the same system in GUI I`ve downloaded a lot of jump systems here but unfortunately most of them were in jass and i didn`t like the GUI method that they used to execute a jump.here is my system by using my system you can make 2D and 3D knockbacks (launching knockback later) in one system! i think this is a new idea and maybe useful and i will add new features to this system like launching movement attach effects to jumper maybe some circular movement ...
anyway there are 3 type of spells in the map which is showing the system`s function
here is the simple leap spell :

  • Jump2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Jump2
    • Actions
      • -------- Adding Caster to Group for Calling it later --------
      • Unit Group - Add (Triggering unit) to KnockBack_Group
      • -------- Define Points and save in system`s Table --------
      • Set Jump_p1 = (Position of (Triggering unit))
      • Set Jump_p2 = (Jump_p1 offset by 1200.00 towards (Facing of (Triggering unit)) degrees)
      • Hashtable - Save Handle OfJump_p1 as (Key kb3d_P_A) of (Key (Triggering unit)) in KnockBack_Hashtable
      • Hashtable - Save Handle OfJump_p2 as (Key kb3d_P_B) of (Key (Triggering unit)) in KnockBack_Hashtable
      • -------- Set Velocity of Moving and Save it in Hashtable --------
      • Hashtable - Save 70.00 as (Key kb3d_V) of (Key (Triggering unit)) in KnockBack_Hashtable
      • -------- Set Velocity of Flying and Save it in Hashtable --------
      • Hashtable - Save 40.00 as (Key kb3d_Vz) of (Key (Triggering unit)) in KnockBack_Hashtable
      • -------- Execute the jumping Function --------
      • Trigger - Run Knockback 3D <gen> (checking conditions)
 
Last edited:
I tested the latest version of this and went through the code (skim reading) and some things were very notable

- The movement is very choppy (particularly the jumping, feeling generally mechanical and unclean)
- Using unit - move is not recommended over the use of set unit x/y as it can support many more units without generating lag
- There's no parabola when a unit is in-flight, you can correct this either using a fixed height arc (typically done via application of the formula Current Height = ((4 * MaxHeight) / Max Distance) * (Max Distance - Current Distance) * (Current Distance / Max Distance) if I'm remembering it right (been a long time since I used it) or it can be done via velocity calculations, notably z velocity which is subtracted by a force of gravity each step (consult "SUVAT" equations on how to do this also called the equations of motion)
- There's a lot of bloat to the system - unless referenced more than once, when you extract all the data from the hashtable into variables you are wasting processing, it makes the code easier to write but doesn't make it any better (rather the opposite)
- The variable names aren't particularly clear (effect 1 - 4 doesn't tell us anything about what they're for aside from being effects) without any real reason to do this since the code is not made any more efficient by doing so thankfully the comments do help with this somewhat
- You only need to check if the knockback group is empty when you remove a unit (with the trigger initially off) there's no point in checking every loop
- Crow form can be immediately removed from a unit after is has been applied and it will still allow you to manipulate the fly height
- You reference (Picked unit) many times without setting it to a variable in order to reduce processing
- There is no point having "do nothing" in your code (they do nothing), you can delete all of them and make the code shorter
- when you deallocate a unit from your system you should flush the child in order to not waste memory space
- you leak points while the unit is in transit (only cleaning the ones created/used in an instance when a unit has landed)
- There are unit group leaks in the system (when you pick units to do line damage with being the first I came across though there are more)

The big issue is that these are all the problems you have before beginning to address the issue raised by others - there are loads of these systems and they do it better, your system's strength is having many features but these would be better suited to be built on top of the existing better ones as add-on features. As such it may be better to think of this system as more in an experience in improving your own coding skills rather than as a submission you expect to get approved (as to get it approved it'd need to have merits to approve it alongside the others or to outright supersede them). I'd suggest fixing up the system and taking away the personal improvement which you can then be applied to future projects and submissions but it may never be approved due to the nature of the system you've produced

you seem to have good logical abilities so we may see some great things from you in future
I wish you luck in your coding endeavors
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
Can you enlighten us what changed in your latest update?
It's a huge system and I wish not to spend hours to evaluate every aspect
again, without knowing what you actually fixed in the latest update.

There is a lot of criticism about your code in the comments.
A quick answer like "Yes you are right. Fixed" or "No you're wrong because ..."
would show that you value those you took their time to rate your system.

Also something like a changelog would be appreciated by me and others.

It's a very special reasoning, but I will put your resource back to Need Fix until
you make a statement about what is new in this version.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
Criticism:


set udg_kb3d_DummyG=CreateGroup()
^
Here you create a unit group for no obvious purpose

The dummy unit type id should be stored in a global integer variable.

For units using crow form by default, this will remove the ability from their ability list.
JASS:
call UnitAddAbilityBJ( 'Amrf', udg_kb3d_Unit[udg_kb3d_TempInt] )
call UnitRemoveAbilityBJ( 'Amrf', udg_kb3d_Unit[udg_kb3d_TempInt] )

Paused units don't take order commands, therefore that order fixer block does nothing
for this condition.

The unit time scale is hardcoded to a base value of 140 and 120. Why is that so?
I guess it relates to a map/resource of yours. If so, such a feature is not wanted for public systems
which should be working for all users.

You have effect handle leaks. A lot.
Using 4 variables for periodic effects appears to be a random setup for me.

In a 3D projectile system a pitching angle could be considered for dummy units.
 
Level 5
Joined
Mar 6, 2015
Messages
130
Criticism:



Thanks to at least looking at the spell and evaluate the code

set udg_kb3d_DummyG=CreateGroup()
^
Here you create a unit group for no obvious purpose

I have an obvious Purpose for sure, you can see what would be happened if you disable this action , the Group will be removed forever after Destroying it(well you know if you don`t it will leaks) and there is no way to add any unit or using the dummy units again this little jass script is fixing this bug like a charm!

The dummy unit type id should be stored in a global integer variable.
sorry i don`t understand whats the advantage of using CreateUnitAtLoc and storing UnitID over using the original GUI method? (since this spell assumed to be GUI why using jass function in unnecessary situations?) but if you tell me the reason of that i will do what you want to see :D

For units using crow form by default, this will remove the ability from their ability list.
JASS:
call UnitAddAbilityBJ( 'Amrf', udg_kb3d_Unit[udg_kb3d_TempInt] )
call UnitRemoveAbilityBJ( 'Amrf', udg_kb3d_Unit[udg_kb3d_TempInt] )

yes that`s right i will add a condition to filter those units thanks to inform me
i didn`t in hell considered that scenario


Paused units don't take order commands, therefore that order fixer block does nothing
for this condition.

No, Not at all , the bug fixer is one of the most important parts of my system in my opinion , to find out why that`s so important just disable this condition and test it for example use dash spell to run through enemy units the only thing you would see is that the jumper (that assumed to be paused!) turns back and trying to attack units while he is being knockbacked !
i don`t think a little condition harms at all instead of having a unit attacks and changes his face during a jump that's totally make knockbacks inaccurate
but as always its configurable maybe someone likes to create those kind of knockbacks

The unit time scale is hardcoded to a base value of 140 and 120. Why is that so?
I guess it relates to a map/resource of yours. If so, such a feature is not wanted for public systems
which should be working for all users.
you can`t be serious ,why i ever define kb3d_AnimationSpeed ? first of 120 and 140 values were completely experimental achievements by testing animation speeds with different Initial Velocities then i find out this value is perfectly suits my system and why even i did some thing like that instead of just suffice the AnimationSpeed Variable ?
well the answer is to make it more user-friendly that would save time for user to use animation feature instead of testing more than 10 animation speeds to find the proper animation speed but it`s still configurable.
about 120 value this a custom made animation called sliding animation and it has a -1 index(which is not exist in any unit`s animations) and it`s completely optional if some one don`t like it simply don`t use -1 as animation index pretend that it`s not existing .



You have effect handle leaks. A lot.
Using 4 variables for periodic effects appears to be a random setup for me.
they are not periodic those 4 variables are just for preventing leaks and removing the user`s special effect correctly
because once they created you lose access from them unless you store them into variables so user can create 4 static effect (means they have noting to do with periodic loop) and once they allocated user can make sure the effects will be destroyed after the knock-back
periodic special effect which is called dynamic effect will be removed immediately when ever they created ( except effect duration feature that won`t work due to leaking that`s horrible i will fix it in next update


In a 3D projectile system a pitching angle could be considered for dummy units.
i don`t understand the pitching angle i have defined a Angle offset for creating circular motion(too simple but still has room to develop )




any comment about changes and new features?
 
Last edited:

Deleted member 247165

D

Deleted member 247165

This one actually works! I've just checked it on a testing map,made by myself and it worked with no problems! Good job! ^_^
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
The system is bloated with features which should not be in there.
Also they are bad impelemted for example the sound or order pluggin.

I have no intention to approve this system as it's of much less
quality than others we have in our database.

Obviously you have a flawed cleanup in you code.
The handle id counter explodes when you test the map for some time.
 
Level 5
Joined
Mar 6, 2015
Messages
130
The system is bloated with features which should not be in there.
Also they are bad impelemted for example the sound or order pluggin.

I have no intention to approve this system as it's of much less
quality than others we have in our database.

Obviously you have a flawed cleanup in you code.
The handle id counter explodes when you test the map for some time.

I will fix them surly the handle id got really low when i disable other resources in map and use only the system without any feature and it`s leakless or very very minor leak like 1 count per jump i guess most of the time its constant maybe it`s the error of the debugging method but i will trim and clean my system from leaks and unwanted features
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
It's not clear to me when effect 1 - effect 4 happen.
Knockback systems normally come along with an on motion effect, eventually
an on collide. Please explain when effect 1, 2, 3, 4 take place.
---
  • Set kb3d_GetEffect_Dy_model = <Empty String>
^ This line is exists twice in your main trigger.
---
You're missing a setup trigger, where a user can define i.e. the default dummy unit.
---
What is the idea behind a minimum and maximum collision radius?
I think it's enough to use one collision member.
---
  • Set kb3d_GetTrigger = Visibility <gen>
^Change it to = null or kb3d_GetTrigger = kb3d_GetTrigger
---
  • kb3d_AnimationIndex[kb3d_TempInt] Greater than 0
^ 0 is also a valid animation index. Use -1 instead for no animation.
  • Animation - Change kb3d_Unit[kb3d_TempInt]'s animation speed to (140.00 + (kb3d_Velocity[kb3d_TempInt] x (Cos(kb3d_Angle[kb3d_TempInt]))))% of its original speed
^Why is 140% the default offset instead of 100%?
---
  • Custom script: set udg_kb3d_Effect_Dy[udg_kb3d_TempInt] = AddSpecialEffectTarget(udg_kb3d_Effect_Dy_model[udg_kb3d_TempInt],udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_Effect_Dy_attach[udg_kb3d_TempInt])
This can be one line
  • Custom script: call DestroyEffect( AddSpecialEffectTarget(udg_kb3d_Effect_Dy_model[udg_kb3d_TempInt],udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_Effect_Dy_attach[udg_kb3d_TempInt]))
 
Level 5
Joined
Mar 6, 2015
Messages
130
It's not clear to me when effect 1 - effect 4 happen.
Knockback systems normally come along with an on motion effect, eventually
an on collide. Please explain when effect 1, 2, 3, 4 take place.
---

okey here is an example
i want to manage a knockback that the target point marked with a flag
i create an flag with special effects and set it as one of the effects for example effect 1 the system will remove it when the jump completes eventually the created effect must be removed after a knock back there is no way to access it later and remove it because no one can estimate how long the jump would be (at least needs a lot of calculation) the system will remove all of created effects i gave user more room to set up to 4 of these effects

  • Set kb3d_GetEffect_Dy_model = <Empty String>
^ This line is exists twice in your main trigger.

i will fix it
---
You're missing a setup trigger, where a user can define i.e. the default dummy unit.
I don`t understand what is the default dummy unit
if you mean the type of creating dummy unit there is a kb3d_GetDummyType variable to set type of dummy unit
all of the default settings done inside of Knockback3d else it`s null the user have to specify what would the Dummy unit`s type be
i fixed it now the default unit type is null user must specify the type of dummy
---
What is the idea behind a minimum and maximum collision radius?
I think it's enough to use one collision member.

the maximum Collision Radius is the picking range and the Minimum Radius Refers to minimum radius that the collision happens in the reality a collision happens when an object reaches the nearest object in it`s way this is my method and its highly configurable as it`s should be.
i think 2 inputs make this feature more Accurate for picking a unit or a group of units
---

  • Set kb3d_GetTrigger = Visibility <gen>
^Change it to = null or kb3d_GetTrigger = kb3d_GetTrigger

this custom script was included in clean up section of KnockBack3d trigger tha
  • set udg_kb3d_GetTrigger = null
I will fix that okey i found the problem

---
  • kb3d_AnimationIndex[kb3d_TempInt] Greater than 0
^ 0 is also a valid animation index. Use -1 instead for no animation.
I didn`t know that okey

  • Animation - Change kb3d_Unit[kb3d_TempInt]'s animation speed to (140.00 + (kb3d_Velocity[kb3d_TempInt] x (Cos(kb3d_Angle[kb3d_TempInt]))))% of its original speed
^Why is 140% the default offset instead of 100%?
because it was to slow this is the third time i explain that i`v tested a lot of values with different velocities they were slow or to fast 140 was the best choice anyway i will remove that and the user must consider a proper animation speed and use kb3d_GetAnimationSpeed

---
  • Custom script: set udg_kb3d_Effect_Dy[udg_kb3d_TempInt] = AddSpecialEffectTarget(udg_kb3d_Effect_Dy_model[udg_kb3d_TempInt],udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_Effect_Dy_attach[udg_kb3d_TempInt])
This can be one line
  • Custom script: call DestroyEffect( AddSpecialEffectTarget(udg_kb3d_Effect_Dy_model[udg_kb3d_TempInt],udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_Effect_Dy_attach[udg_kb3d_TempInt]))

i don`t think its necessary i will change the method of allocating Special effect since i found there is no problem with GUI`s Effect Creation

i will fix these issues as soon as possible
thanks
 
Last edited:
Level 19
Joined
Mar 18, 2012
Messages
1,716
I would like to requote my colleague:

Pros: It has a lot of features
Cons: It has a lot of features
So let's discuss what you implemented.

"Order Bug Fixer":
  • -------- Order Bug Fixer --------
  • (Current order of kb3d_Unit[kb3d_TempInt]) Equal to (Order(smart))
^First of all some nitpicking. There is no "bug" at least I'm not aware of it.
If OrderInterupt is true the unit motion stops, if the current order equals "smart".
Why exactly smart? In my opinion you have to compare the current unit order to the one
which triggered the knockback in the first place
. If they are unequal the knockback motion should stop.
On knockback start set UnitOrderSaved[index] = GetUnitCurrentOrder(Source[index])
Then periodically if UnitOrderSaved[index] != GetUnitCurrentOrder(Source[index]) then

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • kb3d_Pause[kb3d_TempInt] Equal to True
    • Then - Actions
      • Unit - Order kb3d_Unit[kb3d_TempInt] to Stop
    • Else - Actions
^I'm not very happy with what you did here.
It will not work for all unit orders, because there are instant orders like windwalk.
In my understanding a paused unit is either really paused PauseUnit(whichUnit, true)
or unable to change the trajectory meaning you base your unit motion on cached x/y/z values, while ignoring the actual unit x/y and fly height value.
For example: set x = x + velocity*Cos(angle) vs set x = GetUnitX(whichUnit) + velocity*Cos(angle)
Can you explain your idea behind constantly ordering "stop"?
"Animation feature":
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • kb3d_Animation[kb3d_TempInt] Equal to True
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kb3d_AnimationIndex[kb3d_TempInt] Greater than -1
        • Then - Actions
          • Custom script: call SetUnitAnimationByIndex( udg_kb3d_Unit[udg_kb3d_TempInt], udg_kb3d_AnimationIndex[udg_kb3d_TempInt])
          • Animation - Change kb3d_Unit[kb3d_TempInt]'s animation speed to kb3d_AnimationSpeed[kb3d_TempInt]% of its original speed
        • Else - Actions
    • Else - Actions
^The upper condition, animation == true is not required. You could only use the lower condition animation index greater than - 1.
It's a bit odd as you update the animation index every 0.03 seconds. Do animations override each other or does the function do nothing
if the previous animation is still running and equals the one you wish to display? I'm curious, because I never tested it myself.
"Effect feature":
Just a quick hint towards variable naming practise. "kb3d_GetEffect_Dy_model" is the file path, which is used for a periodically special effect.
For example kb3d_GetPeriodicEffectModel, kb3d_GetPeriodicFx, kb3d_PeriodicEffect ...would be much more descriptive, hence easy to understand for users.
From the shortcut _Dy_ I couldn't associate a periodic effect feature.
Also some consistency in lower and upper case, in general naming convention is appreciated.
Compare kb3d_GetEffect_Model vs kb3d_GetEffect_model vs kb3d_GetEffectModel. Which one do you think is the best?
"Damage feature":
  • Custom script: call RemoveLocation(udg_kb3d_TempLoc)
^This line provokes internal Warcraft III mechanisms to compensate a potential bug.
A there is a chance that you remove the location handle multiple times while executing the for group actions and
B you use just that location in further features like the tree killer.
"TreeKiller feature":
  • kb3d_Z[kb3d_TempInt] Less than 70.00
^I'm not a fan of hardcoded values, but as long as it's just about trees a value between 50 and 200 seems suitable.
Sidenote: Finally it's still inaccurate in a few special cases, imagine a tree stands on a cliff and the
knockback unit is 2 terrain levels below but in collision range in plane x / y.
"Collision feature":
  • Custom script: set udg_kb3d_tempgroup1=CreateGroup()
^Why not use the kb3d_tempgroup variable instead?
  • ((Picked unit) belongs to an enemy of kb3d_Player[kb3d_TempInt]) Equal to True
^Unit collision should be detected for all units, except the knocback unit itself.
In that context I don't really understand the naming Collide_MinRadius.
Can you explain where the difference between minimum and maximum collision radius is?
  • Set kb3d_TempLoc2 = (Position of (Picked unit))
^Here is a potential location handle leak.

Dummy creation feature​
  • Unit Group - Add (Last created unit) to kb3d_DummyG
^Does kb3d_DummyG has a specific purpose? I couldn't find it elsewhere in your code.
What's the general idea behind the dummy creation feature?

Cleanup​
  • Unit - Unpause kb3d_Unit[kb3d_TempInt]
^Here you unpause the knockback unit, however I don't see where you pause it in the first place?
  • Animation - Reset kb3d_Unit[kb3d_TempInt]'s animation
That line shouldn't be there by default.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • kb3d_Index Equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
^This statement should only run after the cleanup process and not for each periodic timer interval.

Furthermore:
  • You allocate an hashtable, but the system doesn't require it at all.
    ---
  • Set kb3d_GetAngle = 45.00 --> That one should be named "arc".
Conclusion:
For a single map your system might work out ok. For a public resource I see a lot of weaknesses.
In general it's much better to seperate the unit motion part from other "optional features".
In GUI the trigger variable event helps you to modularize code very easy.
It let's the user inject the motion process during important events.

For example the dummy creation or the four special effects appear to be very random toggle to me.

I can only recommend to base you spells on already existing knockback systems, we have a lot well working submissions.
For you personal usage I outlined most weaknesses, so you can improve your own code.
 
Level 7
Joined
Feb 9, 2021
Messages
301
The question I have is whether it is possible to change the angle of the bounce? For instance, I want target-units to bounce in the opposite direction of the missile's direction.
 
Top