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

Knockup system GUI

hello, I noticed there is no knockback system which basicly is a nicer version of a stun so I decided to create one if, you most likely know this if you play leauge of legends (LoL). It is GUI and easy to use.

19p8wk.png



  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set KUS_hash = (Last created hashtable)
  • prepare
    • Events
    • Conditions
    • Actions
      • Custom script: local integer h = GetHandleId(udg_KUS_target)
      • Set KUS_knockup = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (KUS_group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on event <gen>
        • Else - Actions
      • Custom script: call SaveBoolean(udg_KUS_hash, h, 0, udg_KUS_knockup)
      • Custom script: call SaveReal(udg_KUS_hash, h, 1, udg_KUS_height)
      • Custom script: call SaveReal(udg_KUS_hash, h, 2, udg_KUS_speed)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Crow Form for KUS_target) Equal to 0
        • Then - Actions
          • Unit - Add Crow Form to KUS_target
          • Unit - Remove Crow Form from KUS_target
        • Else - Actions
      • Unit Group - Add KUS_target to KUS_group
      • Custom script: call SetUnitPropWindow(udg_KUS_target, 0)
      • Set KUS_temp_loc = (Position of KUS_target)
      • Special Effect - Create a special effect at KUS_temp_loc using KUS_effect
      • Special Effect - Destroy (Last created special effect)
      • Animation - Change KUS_target turn speed to 0.00
      • Animation - Play KUS_target's KUS_animation animation
      • Custom script: call RemoveLocation(udg_KUS_temp_loc)
  • event
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KUS_group and do (Actions)
        • Loop - Actions
          • Custom script: local integer h
          • Set KUS_target = (Picked unit)
          • Custom script: set h = GetHandleId(udg_KUS_target)
          • Custom script: set udg_KUS_knockup = LoadBoolean(udg_KUS_hash, h, 0)
          • Custom script: set udg_KUS_height = LoadReal(udg_KUS_hash, h, 1)
          • Custom script: set udg_KUS_speed = LoadReal(udg_KUS_hash, h, 2)
          • Set KUS_temp_speed = (KUS_speed + (0.10 x (KUS_height - (Current flying height of KUS_target))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KUS_knockup Equal to True
            • Then - Actions
              • Animation - Change KUS_target flying height to ((Current flying height of KUS_target) + KUS_temp_speed) at 0.00
            • Else - Actions
              • Animation - Change KUS_target flying height to ((Current flying height of KUS_target) - KUS_temp_speed) at 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current flying height of KUS_target) Less than or equal to KUS_temp_speed
                • Then - Actions
                  • Animation - Change KUS_target flying height to (Default flying height of KUS_target) at 0.00
                  • Animation - Reset KUS_target's animation
                  • Animation - Change KUS_target turn speed to (Default turn speed of KUS_target)
                  • Custom script: call SetUnitPropWindow(udg_KUS_target, GetUnitDefaultPropWindow(udg_KUS_target))
                  • Custom script: call FlushChildHashtable(udg_KUS_hash, h)
                  • Unit Group - Remove KUS_target from KUS_group
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (KUS_group is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current flying height of KUS_target) Greater than or equal to KUS_height
            • Then - Actions
              • Set KUS_knockup = False
              • Custom script: call SaveBoolean(udg_KUS_hash, h, 0, udg_KUS_knockup)
            • Else - Actions
  • Demo
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set KUS_target = Paladin 0000 <gen>
      • Set KUS_effect = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Set KUS_height = 300.00
      • Set KUS_speed = 5.00
      • Set KUS_animation = Attack
      • Custom script: call PrepareKnockUp()
      • Set KUS_effect = Abilities\Spells\Items\AIim\AIimTarget.mdl
      • Set KUS_target = Mountain King 0003 <gen>
      • Custom script: call PrepareKnockUp()
      • Set KUS_effect = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Set KUS_target = Archmage 0002 <gen>
      • Custom script: call PrepareKnockUp()


Keywords:
knockback, stun, GUI, Chaosy, system
Contents

Just another Warcraft III map (Map)

Reviews
Knockup system GUI | Reviewed by Maker | 17th Feb 2013 APPROVED Simple to use and useful. Suggested changes Do this only if KUS_knockup is true, it can cause leaks otherwiseIf (All Conditions are True) then do (Then Actions) else do (Else...

Moderator

M

Moderator


Knockup system GUI | Reviewed by Maker | 17th Feb 2013
APPROVED

Simple to use and useful.

Suggested changes
  • Do this only if KUS_knockup is true, it can cause leaks otherwise
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Current flying height of KUS_target) Greater than or equal to KUS_height
      • Then - Actions
        • Set KUS_knockup = False
        • Custom script: call SaveBoolean(udg_KUS_hash, h, 0, udg_KUS_knockup)
      • Else - Actions
  • The flying height equation could be more realistic,
    the change in direction is a bit abrupt
  • The system could be more configurable
[td]
[/td]



Knockup system - Reviewed by Maker - 15th Feb 2013
Needs Fix

Required changes
Suggested changes
  • The flying height could use better method, some equation
    It could look better
  • You could set turn speed to 0 while being knocked up
[td]
[/td]
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
changed stuff
-bug fixed
-variable names changed
-added more variables
-added config
-effect, animation, speed and heigh is now set in the demo trigger insted of the init trigger
-flying units height is now reseted properly
-loop now turns of when group is empty
-changed the function name to "PrepareKnockUp"
-crow form wont be removed for units that allready got the ability
-uses unitpropwindow insted of pause unit
-added a local integer for one of the handles
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • prepare is not a proper function name
  • The effect, height and speed should be optional/configurable for each knockup separately
  • Removing Crow Form like that will remove it from units that are supposed to have it
  • Don't use Pause unit, it pauses unit also and if paused units die, it bugs a bit
  • The animation should be configurable/optional
  • The looping trigger should be off when there are no units to loop
  • Flying units will bug with this
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
1. hm ok I will fix that
2. well it could be that but I thought it would be nice with a general height but I guess your right since you might use it to more than one spell in a map
3. did not think of that I will put it in a ITE
4. what do you suggest then? that is a good way to make sure the unit wont move somewhere. should I move it to the original location insted?
5. true, will do
6. hm, if I set the units fly height to default and its a ground unit it will be set to 0 right?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
4. what do you suggest then? that is a good way to make sure the unit wont move somewhere. should I move it to the original location insted?
6. hm, if I set the units fly height to default and its a ground unit it will be set to 0 right?

4. Custom script: call SetUnitPropWindow(unit, 0)
Reset it with SetUnitPropWindow(unit, GetUnitDefaultPropWindow(unit))
6. Yes, it should work like that.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
-effect, animation, speed and heigh is now set in the demo trigger insted of the init trigger
-flying units height is now reseted properly
-loop now turns of when group is empty
-changed the function name to "PrepareKnockUp"
-crow form wont be removed for units that allready got the ability

@maker what do that script do I have never used i before.

to do:
add a local integer for hashtable key
find a better way to stun the unit
 
Level 33
Joined
Apr 24, 2012
Messages
5,113
  • -------- DON*T TOUCH BELLOW --------
  • Custom script: set udg_KUS_hash = InitHashtable()
  • Skip remaining actions
  • Custom script: endfunction
eh?

functions should have prefixes in their names(that's because we dont have privates)

This would be better if this uses Physics so much,just like my old knockback 3D hayss

hmm,because i remember my KB3D,i should start fixing it as well
 
Top