Hi guyz, I made a map where there are many gates (opened/closed by triggers). The problem is, when I give an order to an units, for example to move to a point, the unit doesn't know (obviously) where (and what) is the gate. Is there a simple way to fix this or have I to create an algorithm to recognize the shortest way considering the gates? Thankz.
you have to issue them to move to the gates, save the point as custom value on the unit and just issue order again after gate.
That's not so simple.
Problem 1: The gate is walkable after 0.5 seconds, but this problem could be solved freezing the trigger.
Problem 2: There are more than 1 gates and the path is not unique, so if an unit is in a room, a room has more gates. I thought to an algorithm to calculate the right path, but it's pretty complex.
please give a overview of your maze.
an algorithm to solve this would be to have each gate to be a point and you save which point is connected with another point and the distance. so you are able to use http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm to find shortest way.
Ok, so I worked on other parts of the map, but it's time to work on this problem again, but I can't find a solution. I got all the points and the connections, but I have no idea how to implement Dijkstra (or another path finding algorithm) in Stracraft 2 editor. Suggestions please?
So, I made a woking algorithm to find the path that is totally different to Dijkstra, but it is just not usable for human players (the problem is when I issue an order to different selected units in different rooms, or for example if the units can't reach the path for whatever reason). I'll use it for the IA only.
If it's any help, there's a trigger (I think a condition) that returns the cost of a path (presumably in amount of seconds it takes to get to a point).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi guyz, I made a map where there are many gates (opened/closed by triggers). The problem is, when I give an order to an units, for example to move to a point, the unit doesn't know (obviously) where (and what) is the gate. Is there a simple way to fix this or have I to create an algorithm to recognize the shortest way considering the gates? Thankz.
@nostradamus1915: Go
you have to issue them to move to the gates, save the point as custom value on the unit and just issue order again after gate.
That's not so simple. Problem 1: The gate is walkable after 0.5 seconds, but this problem could be solved freezing the trigger. Problem 2: There are more than 1 gates and the path is not unique, so if an unit is in a room, a room has more gates. I thought to an algorithm to calculate the right path, but it's pretty complex.
N0b0dy?
@nostradamus1915: Go
please give a overview of your maze.
an algorithm to solve this would be to have each gate to be a point and you save which point is connected with another point and the distance. so you are able to use http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm to find shortest way.
Ok, so I worked on other parts of the map, but it's time to work on this problem again, but I can't find a solution. I got all the points and the connections, but I have no idea how to implement Dijkstra (or another path finding algorithm) in Stracraft 2 editor. Suggestions please?
So, I made a woking algorithm to find the path that is totally different to Dijkstra, but it is just not usable for human players (the problem is when I issue an order to different selected units in different rooms, or for example if the units can't reach the path for whatever reason). I'll use it for the IA only.
If it's any help, there's a trigger (I think a condition) that returns the cost of a path (presumably in amount of seconds it takes to get to a point).