So i'm working on a map and trying to implement Knockback in some spells, and for a long time I thought that I was doing something wrong. Beating my head against the script editor until I figured it out, simplifying as much as possible. I was also noticing glitches with the sample script that is provided with the map, trying to understand why it was doing this.
After a while I noticed that the spell worked perfectly. Okay, I fixed it? What did I do?
The answer was -- nothing. So when trying to understand I noticed that there are certain parts of the map that seem to have massive collision areas. Within these areas, the knockback will not work as intended. Outside of them, it's fine. Units will bounce off of these regions as it seems, making me think they are marked in some sense as unpathable or something like that.
I found this thread with the same issue: [Trigger] - Strange 2.5D Knockback System Issue
It looked solved so I was hoping for a fix, but they recommend changing "Robust Pathing" from 2 to 0, which I tried and nothing changed. :/
There was also something about being able to drop items in that spot, so I tried that and can both drop them and place in-editor in this place.
Thread was closed so I thought to make my own, hoping for a solution.
I took some images to try to display better what I am talking about:
So as you can see, I thought it had something to do with specific units but that is not the case, because the knockback works perfectly to the unit when it is not in these parts of the map.
However, this unit will bounce off of something that is not there, and for clarification in the map there is nothing it can bounce off of here. No pathing blockers or anything like that. Anything on the right side of that white dotted line will not be knocked back, and it's a very large area (See image below)
I've tried in other parts of the map, and certain places have this issue and others do not. I've found other borders as well, where they will bounce off of, and then once you pass that threshold the knockback reverts to making the unit shake in place. Step back again, and it works. So it is entirely based off of particular areas of the map that don't seem to be marked by anything that I can find or have manually placed. For instance, the image below, the forest area, is completely empty in the editor
My best guess is that it would have something to do with this? As it's the only thing that I can find having any relation to the map in segments, however I've tried disabling these specific lines and nothing changed...
Anyways, I'm at a loss and cannot find any trace as to how to fix this or even what is going wrong.
I'll attach the map file that I'm working on. The unit that has the knockback spell is the Captain/Knight guy.
For clarification, all this also works the same if you enable knockback on auto attacking, which is in the map but disabled. It's the demo script from the Knockback Map file.
After a while I noticed that the spell worked perfectly. Okay, I fixed it? What did I do?
The answer was -- nothing. So when trying to understand I noticed that there are certain parts of the map that seem to have massive collision areas. Within these areas, the knockback will not work as intended. Outside of them, it's fine. Units will bounce off of these regions as it seems, making me think they are marked in some sense as unpathable or something like that.
I found this thread with the same issue: [Trigger] - Strange 2.5D Knockback System Issue
It looked solved so I was hoping for a fix, but they recommend changing "Robust Pathing" from 2 to 0, which I tried and nothing changed. :/
There was also something about being able to drop items in that spot, so I tried that and can both drop them and place in-editor in this place.
Thread was closed so I thought to make my own, hoping for a solution.
I took some images to try to display better what I am talking about:
So as you can see, I thought it had something to do with specific units but that is not the case, because the knockback works perfectly to the unit when it is not in these parts of the map.
However, this unit will bounce off of something that is not there, and for clarification in the map there is nothing it can bounce off of here. No pathing blockers or anything like that. Anything on the right side of that white dotted line will not be knocked back, and it's a very large area (See image below)
I've tried in other parts of the map, and certain places have this issue and others do not. I've found other borders as well, where they will bounce off of, and then once you pass that threshold the knockback reverts to making the unit shake in place. Step back again, and it works. So it is entirely based off of particular areas of the map that don't seem to be marked by anything that I can find or have manually placed. For instance, the image below, the forest area, is completely empty in the editor
My best guess is that it would have something to do with this? As it's the only thing that I can find having any relation to the map in segments, however I've tried disabling these specific lines and nothing changed...
-
Knockback 2D Config
-
Events
-
Game - UnitIndexEvent becomes Equal to 3.00
-
-
Conditions
-
Actions
-
-------- --------
-
-------- Configure things below --------
-
-------- --------
-
Set VariableSet K2DRegion = (Playable map area)
-
Set VariableSet K2DMaxX = (Max X of K2DRegion)
-
Set VariableSet K2DMaxY = (Max Y of K2DRegion)
-
Set VariableSet K2DMinX = (Min X of K2DRegion)
-
Set VariableSet K2DMinY = (Min Y of K2DRegion)
-
Set VariableSet K2DMaxDestRadius = (Knockback2DDefaultDestRadius x 2.00)
-
Custom script: call SetRect(udg_K2DRegion, 0.00, 0.00, udg_K2DMaxDestRadius, udg_K2DMaxDestRadius)
-
-
Anyways, I'm at a loss and cannot find any trace as to how to fix this or even what is going wrong.
I'll attach the map file that I'm working on. The unit that has the knockback spell is the Captain/Knight guy.
For clarification, all this also works the same if you enable knockback on auto attacking, which is in the map but disabled. It's the demo script from the Knockback Map file.
Last edited: