Knockbacking Spell

Igor_Z

You can change this now in User CP.
Reaction score
61
Knockbacking spell problem

Hello, I have just made a knockback spell similar to the ones from wc3... Since I don't have wc3 installed I can't do exactly the same so from what can I remember(Because I coded long time ago) it is something like those triggers below. So basicly I'm trying to make something from wc3 in starcraft II. So here are the triggers:

Trigger:
  • Knockback(Passive)
    • Events
      • Unit - Any Unit takes Fatal or Non-Fatal Any damage (from Any effects)
    • Local Variables
    • Conditions
      • (Unit type of (Damaging unit)) == Zeratul
    • Actions
      • Variable - Set Zeratul = (Damaging unit)
      • Variable - Set Target = (Triggering unit)
      • Variable - Set Zeratul_Pos = (Position of Zeratul)


Trigger:
  • Knockbackback timer
    • Events
      • Timer - Every 0.04 seconds of Real Time
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set Target_Pos = (Position of Target)
      • Variable - Set Offset = ((Distance between Zeratul_Pos and Target_Pos) + 2.0)
      • Variable - Set Angle = (Angle from Zeratul_Pos to Target_Pos)
      • Variable - Set Integer = (Integer + 2)
      • Unit - Move Target instantly to (Zeratul_Pos offset by Offset towards Angle degrees) (No Blend)
      • Variable - Set Target_Pos = No Point
      • General - If (Conditions) then do multiple (Actions)
        • If Then Else
          • General - Else if (Conditions) then do (Actions)
            • Else If
              • Integer >= 50
            • Then
              • Variable - Set Offset = 0.0
              • Variable - Set Angle = 0.0
              • Variable - Set Zeratul = No Unit
              • Variable - Set Target = No Unit
              • Variable - Set Zeratul_Pos = No Point
              • Variable - Set Target_Pos = No Point
              • Variable - Set Integer = 0

This Galaxy editor is ruining something. I'm 50% sure that the problem is not in the triggers...
P.S: Correct them if I have mistakes.
Basicly I am testing out the editor so I don't have any abilities on my unit. I want a normal attack of the unit to knockback the target. What went wrong?
Take a look @ the pictures below, I showed the variable creation and the in-game malfunction text. Help me please
 

Attachments

  • Image.JPG
    Image.JPG
    45.9 KB · Views: 291
  • Error.JPG
    Error.JPG
    11.2 KB · Views: 254

Sevion

The DIY Ninja
Reaction score
413
First off this isn't mui. Second this trigger can be done much more efficiently. I can write a trigger for you when I get home but chances are someone else will first.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
First off this isn't mui
Don't need MUI, I will use 1 spell per unit... Anyways it's just a beta, im just trying out some stuff because they said that this editor is more powerful than wc3 world editor...
Second this trigger can be done much more efficiently. I can write a trigger for you when I get home but chances are someone else will first.
Ok, make it and show it to me. Btw I need it in GUI not in some programming language...
 
Reaction score
54
Also, if we are looking into efficiency, you can do this with the data editor.

Create an "Apply Force" effect, name it Push Back (Force).
Create an "Create Persistent" effect, name it Push Back (Initial).
Change the periodic count of Push Back (Initial) to like, 50. The periodic duration to 0.01. The periodic effect to Push Back (Force).

Go to Zeratul's weapon tab, and change the effect to Push Back (Initial).


There is your powerful editor. :)
 
Reaction score
54
This can't be done... Can't see my effect in there

Make sure your effect does not 'Define Default Values'. (Right click, modify)

You probably duplicated the original effect to create these ones. The standard way to create new effects is to go to Data -> New Object in the top menu.
 

Sevion

The DIY Ninja
Reaction score
413
I don't think you understand... At the moment, this entire trigger would fail if 2 units cast it at the same time or if a second unit casts it before the first spell finishes. And "I will use 1 spell per unit..." doesn't exactly make any sense...

And apparently, nearly anything can be done in the Data Editor. So... don't knock it off before you try it. Explore it. I'm willing to bet this can be done easily with the Data Editor.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Mind making it for me? I still can't make the knockback a little smoother... You know, like it was in wc3. If someone can, please make it
 

Sevion

The DIY Ninja
Reaction score
413
Trigger:
  • Slide
    • Events
      • Unit - Any Unit takes Fatal or Non-Fatal Any damage (from Any effects)
    • Local Variables
      • offset = 2.0 <Real>
      • angle = 0.0 <Real>
    • Conditions
      • (Unit type of (Triggering unit)) == User
    • Actions
      • General - Custom Script: lv_angle = AngleBetweenPoints(UnitGetPosition...


JASS:
lv_angle = AngleBetweenPoints(UnitGetPosition(EventUnit()), UnitGetPosition(EventUnitDamageSourceUnit()));

while (lv_offset < 50 )
{
    UnitSetPosition(EventUnitDamageSourceUnit(), PointWithOffsetPolar(UnitGetPosition(EventUnit()), lv_offset, lv_angle), false);
    lv_offset += 2;
    Wait(0.00, c_timeGame);
}


You could change the wait duration as needed.
 

kel

New Member
Reaction score
1
I would just like to add that going with the data editor is indeed a failsafe (and somewhat more efficient method) of implementing a standard knockback effect. I have had great success in creating one which seems robust enough for regular online play.

The data editor is indeed very powerful, perhaps enough to pretty much be able to do whatever we would usually do with triggers in WC3. After all, it has an entire scripting system built into it with the "Events+" fields in most data editor objects.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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