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,306
  • [System] Knocback.w3x
    49.6 KB · Views: 1,095

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
963
> 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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top