I have thought of making a new way knock back
Apart from the traditional knockback in jass using co-ordinates then tan etc.
I have thought of a new knock back system..
In it a a dummy unit is created at the position of the unit which is to be knockbacked. That dummy unit may be ground or flying as per requirements.
The dummy unit has a movement speed.
The dummy unit is made to move in the direction the push back was done.
Every 0.05 second the unit is made to move in the position of the dummy unit which was moving.
This way, we don't need to do work in checking if the knocked is made to move out of the terrain if we make the dummy a ground unit.
Incase we want knocking out of terrain we can use a flying unit.
We can terminate the loop in two ways.
1. after x seconds... because distance = speed * time
here speed is the movement speed of the dummy unit.
2. Incase of an up-pathable terrain we can test if the dummy moves in a straight line using (y=mx) function
we can either order the dummy to stop and wait for the knockback timer to get over or cancel the movement as a whole
As a whole this look a lot easier to me effective or not i cannot say.
Thoughts?
Apart from the traditional knockback in jass using co-ordinates then tan etc.
I have thought of a new knock back system..
In it a a dummy unit is created at the position of the unit which is to be knockbacked. That dummy unit may be ground or flying as per requirements.
The dummy unit has a movement speed.
The dummy unit is made to move in the direction the push back was done.
Every 0.05 second the unit is made to move in the position of the dummy unit which was moving.
This way, we don't need to do work in checking if the knocked is made to move out of the terrain if we make the dummy a ground unit.
Incase we want knocking out of terrain we can use a flying unit.
We can terminate the loop in two ways.
1. after x seconds... because distance = speed * time
here speed is the movement speed of the dummy unit.
2. Incase of an up-pathable terrain we can test if the dummy moves in a straight line using (y=mx) function
we can either order the dummy to stop and wait for the knockback timer to get over or cancel the movement as a whole
As a whole this look a lot easier to me effective or not i cannot say.
Thoughts?