• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Pushing

Status
Not open for further replies.
Level 18
Joined
Aug 13, 2007
Messages
1,584
that would be helpful but i dont know jass :/

You don't need to.

Just make a trigger and go to Edit > Convert to custom text. Then copy&paste the code there and replace the values as follows:

* unit u = the unit being knockbacked
* real d = the distance the unit is knockbacked to
* real a = the angle (direction of the knockback) in RADIANS
* real w = the duration of the knockback
* real r = the radius of tree destroying, but there's a new trick: if you put a negative number as the radius, the unit will stop knockbacking when it gets in that range of a tree and if you put a positive value, the unit will destroy trees when it gets in that range of a tree (if you don't want any of those, just put 0)
* integer t = type 0 means no effect (both s and p should be ""), type 1 means periodic effect (meaning you should put "" as the attachment point, parameter p), type 2 means a special effect attached on the unit and destroyed when the knockback is finished (this is where you use parameter p)
* string s = the path to the special effect you want to use (periodic), that effect will be destroyed immediatelly (you can put "" if you don't want a special effect)
* string p = used for type 2, it's the attachment point of the effect, "chest" is default (so if you put "", it will be "chest")

And give credit to Silvenon.
 
Level 14
Joined
Jan 15, 2007
Messages
349
Well you can also make that with gui MUI. But to make it in JASS would be really bet but whatever. I made a gui code here you got:

  • SlideStart
    • Events
      • Unit - A unit started the effect of a ability
    • Conditions
      • (Ability being cast) Equal To <Your ability>
    • Actions
      • Set Example_Size = (Example_Size + 1)
      • Set Example_Speed[Example_Size] = 15.00
      • Set Example_TempDistance[Example_Size] = 0.00
      • Set Example_Unit[Example_Size] = (Target unit of ability being cast)
      • Set Example_Angle[Example_Size] = (Facing of Example_Unit[Example_Size])
      • Set Example_Distance[Example_Size] = -500.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (SlideMotion <gen> is on) Equal To False
        • 'THEN'-Actions
          • Trigger - Turn on SlideMotion <gen>
        • 'ELSE'-Actions
SlideMotion should at the start of the map disabled.
  • SlideMotion
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Example_Size, do (Actions)
        • Loops - Actions
          • Set Example_TempDistance[(Integer A)] = (Example_TempDistance[(Integer A)] - Example_Speed[(Integer A)])
          • Set Example_Loc = (Position of Example_Unit[(Integer A)])
          • Set Example_Loc2 = (Example_Loc offset by Example_Speed[(Integer A)] towards (Example_Angle[(Integer A)] - 180.00) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Terrain pathing at Example_Loc2 of type Walkable is off) Equal To False
            • 'THEN'-Actions
              • Unit - Move Example_Unit[(Integer A)] instantly to Example_Loc2, facing Example_Angle[(Integer A)] degrees
            • 'ELSE'-Actions
          • Custom script: call RemoveLocation(udg_Example_Loc)
          • Custom script: call RemoveLocation(udg_Example_Loc2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • Example_TempDistance[(Integer A)] Smaller Then Example_Distance[(Integer A)]
            • 'THEN'-Actions
              • Custom script: set udg_Example_Unit[bj_forLoopAIndex]=null
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • (Integer A) Unequal To Example_Size
                • 'THEN'-Actions
                  • Set Example_Angle[(Integer A)] = Example_Angle[Example_Size]
                  • Set Example_Distance[(Integer A)] = Example_Distance[Example_Size]
                  • Set Example_Speed[(Integer A)] = Example_Speed[Example_Size]
                  • Set Example_TempDistance[(Integer A)] = Example_TempDistance[Example_Size]
                  • Set Example_Unit[(Integer A)] = Example_Unit[Example_Size]
                • 'ELSE'-Actions
              • Set Example_Size = (Example_Size - 1)
            • 'ELSE'-Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • Example_Size Equal To 0
        • 'THEN'-Actions
          • Trigger - Turn off (This trigger)
        • 'ELSE'-Actions
Well if you want you can also nullify the locations its your choice I was to lazy. In this example the targeted unit will be sliding a distance of 500 backward. You need following variables:
- Angle,Speed,TempDistance,Distance all arrays of type real
- Loc,Loc2 of type location
- Size of type integer
- Unit array of type unit

Maybe this will help you.

Edit: Of course the backward distance 500 is not constant you can change it everytime. Just change the values.
 
Last edited:
Status
Not open for further replies.
Top