System Knockback (GUI)

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
Knockback System
by Tom_Kazansky​

There are many Knockback Systems but most of them are written in Jass.
I make this system because GUI is easier to understand than Jass ("easier" not "easy")


Some informations about this system:
- easy to use (well, of course) (but Romek think It isn't :( )
- use 1 timer (how could I use many timers, GUI )
- changeable "arguments"
- it's MUI and a "stand alone" system

The triggers:

Trigger:
  • Knocback Call
    • Events
    • Conditions
    • Actions
      • Set KnockbackSys_Index = (KnockbackSys_Index + 1)
      • Set KnockbackSys_Unit[KnockbackSys_Index] = KnockbackCall_Unit
      • Set KnockbackSys_Dist[KnockbackSys_Index] = KnockbackCall_Dist
      • Set KnockbackSys_Angle[KnockbackSys_Index] = KnockbackCall_Angle
      • Set KnockbackSys_SFXPath[KnockbackSys_Index] = KnockbackCall_SFX
      • Set KnockbackSys_TickCount[KnockbackSys_Index] = (Integer((KnockbackCall_Dur / 0.04)))
      • Set KnockbackSys_Tick[KnockbackSys_Index] = 0
      • Set KnockbackSys_Sin[KnockbackSys_Index] = (90.00 / (Real(KnockbackSys_TickCount[KnockbackSys_Index])))
      • Set KnockbackSys_DestroyTree[KnockbackSys_Index] = KnockbackCall_DestroyTree


Trigger:
  • Knocback 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 KnockbackSys_Index = (KnockbackSys_Index - 1)
              • For each (Integer A) from KnockbackSys_Looper to KnockbackSys_Index, do (Actions)
                • Loop - Actions
                  • Set TempInt = (Integer A)
                  • Set KnockbackSys_Unit[TempInt] = KnockbackSys_Unit[(TempInt + 1)]
                  • Set KnockbackSys_Dist[TempInt] = KnockbackSys_Dist[(TempInt + 1)]
                  • Set KnockbackSys_Angle[TempInt] = KnockbackSys_Angle[(TempInt + 1)]
                  • Set KnockbackSys_SFXPath[TempInt] = KnockbackSys_SFXPath[(TempInt + 1)]
                  • Set KnockbackSys_TickCount[TempInt] = KnockbackSys_TickCount[(TempInt + 1)]
                  • Set KnockbackSys_Tick[TempInt] = KnockbackSys_Tick[(TempInt + 1)]
                  • Set KnockbackSys_Sin[TempInt] = KnockbackSys_Sin[(TempInt + 1)]
                  • Set 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 KnockbackSys_Tick[KnockbackSys_Looper] = (KnockbackSys_Tick[KnockbackSys_Looper] + 1)
              • Set TempReal = (KnockbackSys_Dist[KnockbackSys_Looper] x (Sin((KnockbackSys_Sin[KnockbackSys_Looper] x (Real((KnockbackSys_Tick[KnockbackSys_Looper] - 1)))))))
              • Set TempReal2 = (KnockbackSys_Dist[KnockbackSys_Looper] x (Sin((KnockbackSys_Sin[KnockbackSys_Looper] x (Real(KnockbackSys_Tick[KnockbackSys_Looper]))))))
              • Set TempLoc = (Position of KnockbackSys_Unit[KnockbackSys_Looper])
              • Set TempLoc2 = (TempLoc offset by (TempReal2 - TempReal) towards KnockbackSys_Angle[KnockbackSys_Looper] degrees)
              • Unit - Move KnockbackSys_Unit[KnockbackSys_Looper] instantly to TempLoc2
              • 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

Readme

Requirements:
¯¯¯¯¯¯¯¯¯¯¯¯¯
World Editor

Implementation Instructions:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Copy and Paste the category "Knockback System"
Remember to check: File \ Preferences \ General \ Automatically create unknown variables while pasting trigger data.

How to use:
¯¯¯¯¯¯¯¯¯¯¯¯¯
To use this system, you need the following lines:

Set KnockbackCall_Unit = <unit that you want it to be knocked>
Set KnockbackCall_Dur = <total duration of knockback>
Set KnockbackCall_Dist = <distance of knockback>
Set KnockbackCall_Angle = <angle of knockback>
Set KnockbackCall_SFX = <knockback effect, put an <Empty String> if you don't want any effects to show>
Set KnockbackCall_DestroyTree = True <If you don't want to destroy trees, use "False" )
Trigger - Run Knocback Call <gen> (ignoring conditions) <- do not change this line


'KnockbackCall_Unit' will be knocked back 'KnockbackCall_Dist' over 'KnockbackCall_Dur' seconds towards 'KnockbackCall_Angle' degrees.

Some sample spells:

Force Push:

Trigger:
  • Force Push
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Force Push
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempLoc = (Position of TempUnit)
      • Set TempGroup = (Units within 300.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of TempUnit)) Equal to True))))
      • Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempLoc2 = (Position of (Picked unit))
          • Unit - Cause TempUnit to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Force
          • -------- call knockback --------
          • Set KnockbackCall_Unit = (Picked unit)
          • Set KnockbackCall_Dur = 0.80
          • Set KnockbackCall_Dist = (500.00 - (Distance between TempLoc and TempLoc2))
          • Set KnockbackCall_Angle = (Angle from TempLoc to TempLoc2)
          • Set KnockbackCall_SFX = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
          • Set KnockbackCall_DestroyTree = True
          • Trigger - Run Knocback Call &lt;gen&gt; (ignoring conditions)
          • -------- --- done --- --------
          • Custom script: call RemoveLocation( udg_TempLoc2 )
      • Custom script: call DestroyGroup( udg_TempGroup )
      • Custom script: call RemoveLocation( udg_TempLoc )


attachment.php


Storm Hammer

Trigger:
  • Storm Hammer
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Storm Hammers for (Attacking unit)) Greater than 0
      • (Random integer number between 1 and 100) Less than or equal to 20
    • Actions
      • Set TempUnit = (Attacking unit)
      • Set TempUnit2 = (Attacked unit)
      • Set TempLoc = (Position of TempUnit)
      • Set TempLoc2 = (Position of TempUnit2)
      • Animation - Play TempUnit&#039;s Attack Slam animation
      • Unit - Cause TempUnit to damage TempUnit2, dealing 50.00 damage of attack type Chaos and damage type Force
      • -------- call knockback --------
      • Set KnockbackCall_Unit = TempUnit2
      • Set KnockbackCall_Dur = 1.00
      • Set KnockbackCall_Dist = 300.00
      • Set KnockbackCall_Angle = (Angle from TempLoc to TempLoc2)
      • Set KnockbackCall_SFX = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Set KnockbackCall_DestroyTree = True
      • Trigger - Run Knocback Call &lt;gen&gt; (ignoring conditions)
      • -------- --- done --- --------
      • Custom script: call RemoveLocation( udg_TempLoc )
      • Custom script: call RemoveLocation( udg_TempLoc2 )
-----------------
Credits are not needed, but appreciated.
---
(+rep are also appreciated :D)
--------------
Enjoy ! :thup:
 

Attachments

  • KBS.JPG
    KBS.JPG
    51.1 KB · Views: 3,310
  • [System] Knocback.w3x
    49.6 KB · Views: 1,099

Dinowc

don't expect anything, prepare for everything
Reaction score
223
you got so many variables...

I think mine is better :p
http://www.thehelper.net/forums/showthread.php?p=983349#post983349

all you need to do is every time you want to run the knock back, increase the Knock_count by 1, set the angle where you want the unit to slide and add him to the group

the group is universal and can be used on any knock backing spell
for instance, I have made a knocking water form that knock backs any unit along the way while dashing just by adding the unit to the group
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
yes, many variables are used, but it's for the sake of "changeable arguments" ;)

your Knockback, the speed of the knockback are constant and also the duration of the knock depends on level of an abilitiy

and I think there are better uses for the "Custom Value"
 

Romek

Super Moderator
Reaction score
964
> easy to use (well, of course)
So you think your huge variable and trigger running thing is easier to use than:
Custom Script: call Knockback(udg_Unit, distance, speed, trees) ?

GUI does definitely not make things easier. It's harder to configure too, as vJass systems always have configuration at the top of the script.
Can this accelerate/decelerate the units?

GUI is also much less efficient, and more difficult to read. You can't really say that the code is easily editable and customizable.

I wonder how many instances of this an average computer can have running before it starts to lag.
 

Azlier

Old World Ghost
Reaction score
461
>easy to use (well, of course)

I say it's overly complicated. I do find the vJass versions to be much faster and easier to use.

>GUI is easier to understand than Jass

I find GUI so confusing. :p
 

wraithseeker

Tired.
Reaction score
122
This is a great system for persistant GUI aka humans who does not want to fall to the plague of the cult of the damned. I don't see why this is bad, it just needs more documention as it seems hella confusing for me, I can't read scrolls of GUI text sorry.

Some more sample spells perhaps? One, seems too little. Also, why don't you use locals in GUI to MUI it easier and remove leaks.

Pure GUI is badass. Anyway, nice system for GUI people + REP
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
>why don't you use locals in GUI to MUI it easier and remove leaks.

I don't get what do you mean by "to MUI it easier", but for removing leaks, those variables are used instantly, so I think there shouldn't be a problem.
-------
I'm a JASS-er so my method of making this GUI system maybe a little "JASS-like" ( "too many" arguments :nuts: )
---
I hope my system will be useful for some GUI-er :D
 

emjlr3

Change can be a good thing
Reaction score
395
> easy to use (well, of course)
So you think your huge variable and trigger running thing is easier to use than:
Custom Script: call Knockback(udg_Unit, distance, speed, trees) ?

GUI does definitely not make things easier. It's harder to configure too, as vJass systems always have configuration at the top of the script.
Can this accelerate/decelerate the units?

GUI is also much less efficient, and more difficult to read. You can't really say that the code is easily editable and customizable.

I wonder how many instances of this an average computer can have running before it starts to lag.


agreed - and this system is harder to use then any JASS system around - even for GUIers - not to mention less efficient, less robust, etc.
 

RMX

New Member
Reaction score
8
Well i have seen this system before it's really i mean reallllllllly close to the system in Hiveworkshop.com created by Paladon and it's MUI....

Maybe u have changed it a little so no body can notice ...

If it is urs well i will give it 5/5 like i gave Paladon .

This system is bulletproof and does not lag at all coz it uses alot of variabel wich make
the Trigers more efficient ;)
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
In the "Knockback Execute" trigger, you can set "(Integer A)" to a variable to save quite a lot of function calls.

I might as well approve it for the sake of GUI users, but I agree with the rest:

JASS systems are actually easier to use, not to mention the gain in efficiency.
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
Andrewgosu, thanks

>In the "Knockback Execute" trigger, you can set "(Integer A)" to a variable to save quite a lot of function calls.

done, updated :D
 

Cookiemaster

New Member
Reaction score
36
Hey! This system is limited on only 8192 units! >:O

Also, this system seems somewhat abusable for players. You can use it as a rigged stun by knockbacking someone against a wall. (Or sometimes shooting people through it if the speed is too great!) And you can stop someone by standing in the way. (Blocking it with a tiny group of units.)

It would be a nice possibility to see in a knockback system the possibility of passing knockback onto units the knockback unit collides into while flying over the place. (Even though this would cause quite lagg when a lot of units are standing together.)
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
>Hey! This system is limited on only 8192 units!

I doubt that you would use this system for about 100 units :rolleyes:

>It would be a nice possibility to see in a knockback system the possibility of passing knockback onto units the knockback unit collides into while flying over the place. (Even though this would cause quite lagg when a lot of units are standing together.)

that system sounds like a ultimate spell for me :eek:
---
mine is just a simple GUI Knockback system, so anything beyond that should be expected in JASS :)
 

Cookiemaster

New Member
Reaction score
36
>Hey! This system is limited on only 8192 units!

I doubt that you would use this system for about 100 units :rolleyes:

>It would be a nice possibility to see in a knockback system the possibility of passing knockback onto units the knockback unit collides into while flying over the place. (Even though this would cause quite lagg when a lot of units are standing together.)

that system sounds like a ultimate spell for me :eek:
---
mine is just a simple GUI Knockback system, so anything beyond that should be expected in JASS :)

It's not so hard to make, apply some physics, do a pick every unit group in the unit integer loop, pass around some knockbacks, and done.
 

Squishinator

New Member
Reaction score
3
Would it be easy to alter this so if a unit runs into it it will be moved back too? Yours isnt doing that (at least not for me). My spell i am trying to do is like thunderclap but lasts for like 7 seconds, and creeps keep running in and attacking my casting unit. >.<
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
Used it on my map, extremely useful and easy to customize, thanks for posting this.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top