Using CEffectApplyForce as knockback?

Cookiemaster

New Member
Reaction score
36
I've just been playing around with the CEffectApplyForce effect, it might be possible to use it for knockback-purpose.

Amount seems to control how strong the push is, but value's higher than 1 don't seem to make the push actually higher.

The actual distance the unit is pushed seems to be dependant from multiple things, I have noticed that units with faster movement speed (helions) are pushed further/faster than units with lower movement speed (marines, marauders).

It seems that air units are also more affected by these push effects.

Does anyone think it might be possible to tweak this into a knockback effect?
 

Cookiemaster

New Member
Reaction score
36
I've found out what makes the air units actually react to "amount", unlike ground!

It is the field "Stats - Collide", and if non-ground collisions are used only, "amount" affects the unit. (otherwise it really doesn't matter how much, the only difference is positive/negative.)

So there you have it, unless you make units "air", you can't use CEffectApplyForce to knockback.


Though, note that settings Stats - Collide to flying still makes the units "somehow" work with the pathing map. Units will path normally towards the targetted destination as if they were ground, but by spamming orders to a nearby-unwalkable point, you can force the unit into the unwalkable area. (every right click makes the unit do a tiny step or so before it stops moving due to unwalkability.)

This could be resolved by a simple trigger, but the problem here is that CEffectApplyForce can still push units into unwalkable area's.
 

Cookiemaster

New Member
Reaction score
36
I believe the distance the actual unit is pushed is determined by the unit's mass field.

Not entirely.

CEffectApplyUnit:
(None) - Amount
(None) - Mass Fraction

Unit:
Movement - Speed
Stats - Collide (If this is not flying, then the knockback seems to be only 0.5 or so far.)
Stats - Mass

These value's affect the unit knockback.

Mass fraction does in some way cap things, but I do not know how this works as of now.

Some tests about mass fraction:
0.9 mass and 1.0 mass fraction lowers the knockback, and 1.1 mass and 1.0 mass fraction makes no knockback happen at all.
Setting mass fraction to 1.2 then made both 0.9 and 1.1 mass not work at all.
 

tain

New Member
Reaction score
0
i am just getting ugly knockbacks with apply force.

i get better results if i use "Move Unit (To unit with polar offset) (Blend True)".
 

Cookiemaster

New Member
Reaction score
36
i am just getting ugly knockbacks with apply force.

i get better results if i use "Move Unit (To unit with polar offset) (Blend True)".

uhhh actually, when I compare the two, it seems to look the exact same way...


EDIT: However, the order of the moved unit doesn't seem to get reset with Move Unit!
Delicious. :>
 

overload119

New Member
Reaction score
5
ApplyForce gives you a very static looking knockback. I'm not sure if this can be changed, but I haven't been able to do it.

Using triggers you can create the smooth, nicer-looking knockbacks that we are use to.
 
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