I'm not really sure how to go about this. What I'd like to do is make non-pathable terrain based on how steep the terrain is, like many games with similar terrain.
Additionally, I'm not exactly sure how to make that point non-pathable. Ordering the unit to stop would give a split second of movement time, so spam clicking would let you go anywhere, or maybe get the unit stuck.
I've done something like this to detect cliffs with triggers, what I did was isolate which square I want to determine the slope and direction of, use four local point variables, put each of those at each of the four corners and then compare the terrain height differences at their locations to figure out if its a cliff and which corner(s) are lower then the others to figure out which way its facing. Works great since you can actually determine all 8 axis. Ie if 3 points are higher then the fourth you know that its a diagonal sloping down towards the fourth, if two are higher then you know its a cardinal etc.
...now how to use that info to paint pathing in real time? No clue, but at least that's a method to figure out cliffs with triggers.
Ooh, I just solved this myself a few days ago - at least the way I needed it to work (only for a single unit that you control).
Basicly what I did was make a trigger compare the height between two points on opposite sides of a unit at 16 points (8 directions) around my unit every 0.01 seconds, and check if the height difference were within a specific bounds I had set.
If the height went outside those bounds the trigger made a similar check, this time determining which one was smaller, and then forced the unit to move in that direction and stripped you of the ability to give that unit further orders until it found ground that rested within those values.
What it basicly does is force your unit to walk down steep hills if you step over the edge, and takes away any possibility of you walking up that cliff, since your unit just returns to where it were if you try to walk up the hill.
Anyway, I've tested it alot and I can't cheat it in any way, or at least I haven't been able to yet ^^
I'm not really sure how to go about this. What I'd like to do is make non-pathable terrain based on how steep the terrain is, like many games with similar terrain.
Additionally, I'm not exactly sure how to make that point non-pathable. Ordering the unit to stop would give a split second of movement time, so spam clicking would let you go anywhere, or maybe get the unit stuck.
Anybody have ideas?
Paint the pathing yourself.
I've done something like this to detect cliffs with triggers, what I did was isolate which square I want to determine the slope and direction of, use four local point variables, put each of those at each of the four corners and then compare the terrain height differences at their locations to figure out if its a cliff and which corner(s) are lower then the others to figure out which way its facing. Works great since you can actually determine all 8 axis. Ie if 3 points are higher then the fourth you know that its a diagonal sloping down towards the fourth, if two are higher then you know its a cardinal etc.
...now how to use that info to paint pathing in real time? No clue, but at least that's a method to figure out cliffs with triggers.
Ooh, I just solved this myself a few days ago - at least the way I needed it to work (only for a single unit that you control).
Basicly what I did was make a trigger compare the height between two points on opposite sides of a unit at 16 points (8 directions) around my unit every 0.01 seconds, and check if the height difference were within a specific bounds I had set.
If the height went outside those bounds the trigger made a similar check, this time determining which one was smaller, and then forced the unit to move in that direction and stripped you of the ability to give that unit further orders until it found ground that rested within those values. What it basicly does is force your unit to walk down steep hills if you step over the edge, and takes away any possibility of you walking up that cliff, since your unit just returns to where it were if you try to walk up the hill.
Anyway, I've tested it alot and I can't cheat it in any way, or at least I haven't been able to yet ^^