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

Best GUI knockback systems? My current GUI Knockback lags.

Level 7
Joined
Mar 16, 2014
Messages
152
The knockback system by bribe no longer functions despite being the most impressive one with all of the features I would want. Updates seem to have killed it.

Which knockback systems are recommended, both in general and strictly for ones that can be called by GUI? I see many of them but they're all rejected.

My current GUI knockback system seems to consistently decrease my game's FPS by 15 or so.

  • Knockback Call
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KnockbackCall_Dist Less than 0.00
        • Then - Actions
          • Set VariableSet KnockbackCall_Dist = 0.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KnockbackCall_Dur Less than 0.00
        • Then - Actions
          • Set VariableSet KnockbackCall_Dur = 0.00
        • Else - Actions
      • Set VariableSet KnockbackSys_Index = (KnockbackSys_Index + 1)
      • Set VariableSet KnockbackSys_Unit[KnockbackSys_Index] = KnockbackCall_Unit
      • Set VariableSet KnockbackSys_Dist[KnockbackSys_Index] = KnockbackCall_Dist
      • Set VariableSet KnockbackSys_Angle[KnockbackSys_Index] = KnockbackCall_Angle
      • Set VariableSet KnockbackSys_SFXPath[KnockbackSys_Index] = KnockbackCall_SFX
      • Set VariableSet KnockbackSys_TickCount[KnockbackSys_Index] = (Integer((KnockbackCall_Dur / 0.04)))
      • Set VariableSet KnockbackSys_Tick[KnockbackSys_Index] = 0
      • Set VariableSet KnockbackSys_Sin[KnockbackSys_Index] = (90.00 / (Real(KnockbackSys_TickCount[KnockbackSys_Index])))
      • Set VariableSet KnockbackSys_DestroyTree[KnockbackSys_Index] = KnockbackCall_DestroyTree
      • Set VariableSet KnockbackSys_NoStun[KnockbackSys_Index] = KnockbackCall_NoStun
  • Knockback Execute
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer KnockbackSys_Looper) from 1 to KnockbackSys_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KnockbackSys_Tick[KnockbackSys_Looper] Greater than KnockbackSys_TickCount[KnockbackSys_Looper]
            • Then - Actions
              • Set VariableSet KnockbackSys_Index = (KnockbackSys_Index - 1)
              • For each (Integer A) from KnockbackSys_Looper to KnockbackSys_Index, do (Actions)
                • Loop - Actions
                  • Set VariableSet TempInt = (Integer A)
                  • Set VariableSet KnockbackSys_Unit[TempInt] = KnockbackSys_Unit[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_Dist[TempInt] = KnockbackSys_Dist[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_Angle[TempInt] = KnockbackSys_Angle[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_SFXPath[TempInt] = KnockbackSys_SFXPath[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_TickCount[TempInt] = KnockbackSys_TickCount[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_Tick[TempInt] = KnockbackSys_Tick[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_Sin[TempInt] = KnockbackSys_Sin[(TempInt + 1)]
                  • Set VariableSet KnockbackSys_DestroyTree[TempInt] = KnockbackSys_DestroyTree[(TempInt + 1)]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KnockbackSys_Tick[KnockbackSys_Looper] Less than or equal to KnockbackSys_TickCount[KnockbackSys_Looper]
            • Then - Actions
              • Set VariableSet KnockbackSys_Tick[KnockbackSys_Looper] = (KnockbackSys_Tick[KnockbackSys_Looper] + 1)
              • Set VariableSet TempReal = (KnockbackSys_Dist[KnockbackSys_Looper] x (Sin((KnockbackSys_Sin[KnockbackSys_Looper] x (Real((KnockbackSys_Tick[KnockbackSys_Looper] - 1)))))))
              • Set VariableSet TempReal2 = (KnockbackSys_Dist[KnockbackSys_Looper] x (Sin((KnockbackSys_Sin[KnockbackSys_Looper] x (Real(KnockbackSys_Tick[KnockbackSys_Looper]))))))
              • Set VariableSet TempLoc = (Position of KnockbackSys_Unit[KnockbackSys_Looper])
              • Set VariableSet TempLoc2 = (TempLoc offset by (TempReal2 - TempReal) towards KnockbackSys_Angle[KnockbackSys_Looper] degrees.)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Matching unit) Not equal to RibCageImpaleVictim
                  • ((Matching unit) is in HohenHookGroup.) Equal to False
                  • ((Matching unit) is in MayHookGroup.) Equal to False
                  • ((Matching unit) is in SeduceNoClip.) Equal to False
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Matching unit) is A Hero) Equal to True
                      • (Custom value of (Matching unit)) Equal to 420
                • Then - Actions
                  • Set VariableSet CP_Point = TempLoc2
                  • Trigger - Run Check Walkability <gen> (ignoring conditions)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CP_PointIsWalkable Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • KnockbackCall_NoStun Equal to False
                            • Then - Actions
                              • Unit - Move KnockbackSys_Unit[KnockbackSys_Looper] instantly to TempLoc2
                            • Else - Actions
                              • Set VariableSet CP_Point = TempLoc2
                              • Trigger - Run Check Walkability <gen> (ignoring conditions)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CP_PointIsWalkable Equal to True
                                • Then - Actions
                                  • Custom script: call SetUnitX(udg_KnockbackSys_Unit[udg_KnockbackSys_Looper], GetLocationX(udg_TempLoc2))
                                  • Custom script: call SetUnitY(udg_KnockbackSys_Unit[udg_KnockbackSys_Looper], GetLocationY(udg_TempLoc2))
                                • Else - Actions
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Matching unit)) Not equal to Boat (Yok Island)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • KnockbackCall_NoStun Equal to False
                        • Then - Actions
                          • Unit - Move KnockbackSys_Unit[KnockbackSys_Looper] instantly to TempLoc2
                        • Else - Actions
                          • Set VariableSet CP_Point = TempLoc2
                          • Trigger - Run Check Walkability <gen> (ignoring conditions)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CP_PointIsWalkable Equal to True
                            • Then - Actions
                              • Custom script: call SetUnitX(udg_KnockbackSys_Unit[udg_KnockbackSys_Looper], GetLocationX(udg_TempLoc2))
                              • Custom script: call SetUnitY(udg_KnockbackSys_Unit[udg_KnockbackSys_Looper], GetLocationY(udg_TempLoc2))
                            • Else - Actions
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KnockbackSys_DestroyTree[KnockbackSys_Looper] Equal to True
                • Then - Actions
                  • Destructible - Pick every destructible within 200.00 of TempLoc2 and do (Actions)
                    • Loop - Actions
                      • Destructible - Kill (Picked destructible)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KnockbackSys_SFXPath[KnockbackSys_Looper] Not equal to <Empty String>
                • Then - Actions
                  • Special Effect - Create a special effect at TempLoc2 using KnockbackSys_SFXPath[KnockbackSys_Looper]
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
              • Custom script: call RemoveLocation( udg_TempLoc )
              • Custom script: call RemoveLocation( udg_TempLoc2 )
            • Else - Actions
  • Check Walkability Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet CP_Rect = (Region(0.00, 0.00, 128.00, 128.00))
      • Custom script: set udg_CP_Item = CreateItem('wtlg', 0, 0)
      • Item - Hide CP_Item
      • -------- Variables For Copy and Paste --------
      • Set VariableSet CP_HiddenItemsIndex = 0
      • Set VariableSet CP_HiddenItems[0] = No item
      • Set VariableSet CP_Point = (Target point of ability being cast)
      • Set VariableSet CP_PointIsWalkable = False
  • Check Walkability
    • Events
    • Conditions
    • Actions
      • Custom script: local real x = GetLocationX(udg_CP_Point)
      • Custom script: local real y = GetLocationY(udg_CP_Point)
      • Custom script: local real x2 = 0
      • Custom script: local real y2 = 0
      • Custom script: call MoveRectTo(udg_CP_Rect, x, y)
      • Item - Pick every item in CP_Rect and do (Actions)
        • Loop - Actions
          • Custom script: if IsItemVisible(GetEnumItem()) then
          • Set VariableSet CP_HiddenItems[CP_HiddenItemsIndex] = (Picked item)
          • Custom script: call SetItemVisible(udg_CP_HiddenItems[udg_CP_HiddenItemsIndex], false)
          • Set VariableSet CP_HiddenItemsIndex = (CP_HiddenItemsIndex + 1)
          • Custom script: endif
      • Custom script: call SetItemPosition(udg_CP_Item, x, y)
      • Custom script: set x2 = GetItemX(udg_CP_Item)
      • Custom script: set y2 = GetItemY(udg_CP_Item)
      • Custom script: call SetItemVisible(udg_CP_Item, false)
      • Custom script: loop
      • Custom script: exitwhen udg_CP_HiddenItemsIndex <= 0
      • Custom script: set udg_CP_HiddenItemsIndex = udg_CP_HiddenItemsIndex - 1
      • Custom script: call SetItemVisible(udg_CP_HiddenItems[udg_CP_HiddenItemsIndex], true)
      • Custom script: set udg_CP_HiddenItems[udg_CP_HiddenItemsIndex] = null
      • Custom script: endloop
      • Custom script: set udg_CP_PointIsWalkable = ((x2-x)[I](x2-x) + (y2-y)[/I](y2-y) <= 100) and (not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY))
 
Level 20
Joined
Feb 27, 2019
Messages
592
Knockback 2.5D breaks with larger maps so if you recently increased the playable map size its possible it started malfunctioning then. Read the changelog or latest posts for fix.

Regarding the system you posted I didnt look at it all but a special effect is created every period but every third or fourth period should probably be enough and Matching unit is being used incorrectly.
 
Level 7
Joined
Mar 16, 2014
Messages
152
Knockback 2.5D breaks with larger maps so if you recently increased the playable map size its possible it started malfunctioning then. Read the changelog or latest posts for fix.

Regarding the system you posted I didnt look at it all but a special effect is created every period but every third or fourth period should probably be enough and Matching unit is being used incorrectly.
Editing the knockback 2.5D map whatsoever breaks it, even within the test map posted. There are many comments in the thread with people who have had similar experiences.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
Editing the knockback 2.5D map whatsoever breaks it, even within the test map posted. There are many comments in the thread with people who have had similar experiences.
Not sure about that, I just used the system on the latest patch in here:
I applied the fix suggested in some of the latest posts as well. Seems to work fine, although I'm using a rather basic knockback.

Perhaps it's related to your version of the map or Warcraft 3.
 
Top