I have been thinking of ways to fix path blocking for basically the entirety of making my Tower wars map. I havn't really been able to come up with some way that will remember summoned units progress.
I have an idea but not sure if it will work entirely. Basically I have 6 points that summoned units move to before reaching the end, would adding an updated buff each time it progressed through the points and having triggers that read the buff if the unit becomes idle get it to attack a building and then read the buff and resend the order accordingly work?
Having an invisible anti cheat works.... kind of but my invisible unit keeps stopping for reasons I am not sure why, so this method doesn't seem very polished.
Will my method work the way I want it to, or is there anything I might need to change to make it work more effectivly
summon 1 is spawned and is ordered to move to region one, when it gets to region 1 apply buff region 1 and order to move to region 2, when summon reaches region 2 remove region 1 buff and add region buff 2. and so on.
if a unit becomes idle because it can't reach its destination it will attack then use a trigger to pick up that it attacked and is there a way to check if unit has a buff and then run a order action depending on what buff it has?
you can use built-in pathing cost of units to figure out if the unit is blocked or not. If the pathing cost of a unit returns -1 then this means there is no path to where the unit wants to go hence it's blocked. There are a couple of built in comparisons functions in the editor, cost between 2 points, or cost between a unit and a point, something like that, i used it for my TD map.
Also, there are validators that check if a unit is moving and at what speed. Tie them to a behavior of a sort, make it so when the unit is not moving the behavior becomes active and does its job. For example in my TD there's a behavior on all spawned units that's activated/deactivated by a validator (unit speed, or unit movement speed... something like that) and basically what this behavior does is simply turn collision off for the unit.
wth is wrong with the edit function of the forums? every time i press update nothng happens, then i press cancel and i see my updated post... I'm using chrome, is this a known issue?
I don't really follow how that will work, what happens if a unit gets blocked, how do I tell what its last order was, because there will be mazing the unit could be near point 1 but ordered to go to point 6.
Turning the collision off, so your units would just walk straight through buildings?
that is unrealistic, as this isn't a wave based tower defense map... its summon based... so there could be 100 units being tracked at a time, and it would be a mess to try and clean up the array
Quite true, it would be unwieldy. Though I just realised that there no need to actually clear the array, just set Unit_id back to 0, and it'll just override the old values without reading them ;)
I am unsure if this is what your asking but I had a similar issue. Units would reach a region which would cammand them to the next region and they would get stuck on the very edge of the region(would only happen on corners for me). I made the below trigger and put a region over the area that the unit(s) where stopping at or becoming idle at.
<> - UnitBecomesIdle
Events
Unit - (Agent of player XX for (Triggering unit)) Becomes idle
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If ((Triggering unit) is in Region XX) == ((Triggering unit) is alive)
Then Unit - Move (Triggering unit) instantly to (Center of Region XX) (No Blend)
you can use built-in pathing cost of units to figure out if the unit is blocked or not. If the pathing cost of a unit returns -1 then this means there is no path to where the unit wants to go hence it's blocked. There are a couple of built in comparisons functions in the editor, cost between 2 points, or cost between a unit and a point, something like that, i used it for my TD map.
I once tried to do this by using "pathing exists between pointA and poinB" or "pathing cost between points", but these doesn't seem to work in that case.
I just found a way make it work with cost between 2 points.
(Pathing cost between (Center of PLAYER01SPAWN) and (Center of PLAYER00END)) == 65536
Does the trick and its working quite well.
I found 65536 by displaying the pathing cost when blocking the path and it always return 65536 when there is no path.
I just found a way make it work with cost between 2 points.
(Pathing cost between (Center of PLAYER01SPAWN) and (Center of PLAYER00END)) == 65536
Does the trick and its working quite well. I found 65536 by displaying the pathing cost when blocking the path and it always return 65536 when there is no path.
Yeah, but it doesn't always work. I can give you an example where the path is blocked, an the pathing cost is around 240 (mostly when builing diagonally). It seems to be a bug in the path finding engine itself.
To be honest I'm very new to the editor but it seems to calculate the shortest path between two points, and when there is no path, it returns the maximum value which is 65536.
For my anti-blocking, I've set up a trigger with the event :
Unit - Any Unit construction progress is Started
In the Actions I have a If Then Else :
If (Pathing cost between (point x) and (point y)) == 65536
Then Unit - Remove (Triggering progress unit) from the game
Else <nothing>
Maybe adding a refund for the building would be great but it's not done yet.
Mmm... that may be possible. But I am working on a TD where my terrain is exclusively square shaped, so it works well for me. Don't know how to make it work for diagonal buildings
I found a workaround to the pathing cost technic not working. By putting some pathing restriction at the right place, it's possible to fix it. While I agree it may be unpractical to do this everywhere, it work!
Gotta make sure it looks exactly the same as in the picture.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have been thinking of ways to fix path blocking for basically the entirety of making my Tower wars map. I havn't really been able to come up with some way that will remember summoned units progress.
I have an idea but not sure if it will work entirely. Basically I have 6 points that summoned units move to before reaching the end, would adding an updated buff each time it progressed through the points and having triggers that read the buff if the unit becomes idle get it to attack a building and then read the buff and resend the order accordingly work?
Having an invisible anti cheat works.... kind of but my invisible unit keeps stopping for reasons I am not sure why, so this method doesn't seem very polished.
Will my method work the way I want it to, or is there anything I might need to change to make it work more effectivly
Feedback would be appreciated!
I dunno if I explained that properly :/
summon 1 is spawned and is ordered to move to region one, when it gets to region 1 apply buff region 1 and order to move to region 2, when summon reaches region 2 remove region 1 buff and add region buff 2. and so on.
if a unit becomes idle because it can't reach its destination it will attack then use a trigger to pick up that it attacked and is there a way to check if unit has a buff and then run a order action depending on what buff it has?
nobody has any idea if this will work?
@nevjmac: Go
you can use built-in pathing cost of units to figure out if the unit is blocked or not. If the pathing cost of a unit returns -1 then this means there is no path to where the unit wants to go hence it's blocked. There are a couple of built in comparisons functions in the editor, cost between 2 points, or cost between a unit and a point, something like that, i used it for my TD map.
Also, there are validators that check if a unit is moving and at what speed. Tie them to a behavior of a sort, make it so when the unit is not moving the behavior becomes active and does its job. For example in my TD there's a behavior on all spawned units that's activated/deactivated by a validator (unit speed, or unit movement speed... something like that) and basically what this behavior does is simply turn collision off for the unit.
wth is wrong with the edit function of the forums? every time i press update nothng happens, then i press cancel and i see my updated post... I'm using chrome, is this a known issue?
@zakariahliklikleh: Go
I don't really follow how that will work, what happens if a unit gets blocked, how do I tell what its last order was, because there will be mazing the unit could be near point 1 but ordered to go to point 6.
Turning the collision off, so your units would just walk straight through buildings?
If you want to get the position of the unit and have it automatically update its position every few seconds, try this:
Trigger 1:
Trigger 2:
Then have a third trigger clean out the arrays in between waves.
@ChromiumBoy: Go
that is unrealistic, as this isn't a wave based tower defense map... its summon based... so there could be 100 units being tracked at a time, and it would be a mess to try and clean up the array
@nevjmac:
Quite true, it would be unwieldy. Though I just realised that there no need to actually clear the array, just set Unit_id back to 0, and it'll just override the old values without reading them ;)
I am unsure if this is what your asking but I had a similar issue. Units would reach a region which would cammand them to the next region and they would get stuck on the very edge of the region(would only happen on corners for me). I made the below trigger and put a region over the area that the unit(s) where stopping at or becoming idle at.
<> - UnitBecomesIdle
Events
Unit - (Agent of player XX for (Triggering unit)) Becomes idle
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If ((Triggering unit) is in Region XX) == ((Triggering unit) is alive)
Then Unit - Move (Triggering unit) instantly to (Center of Region XX) (No Blend)
Else
Hope this is of help...
I once tried to do this by using "pathing exists between pointA and poinB" or "pathing cost between points", but these doesn't seem to work in that case.
@Pfaeff: Go
I just found a way make it work with cost between 2 points.
(Pathing cost between (Center of PLAYER01SPAWN) and (Center of PLAYER00END)) == 65536
Does the trick and its working quite well. I found 65536 by displaying the pathing cost when blocking the path and it always return 65536 when there is no path.
@scorix1: Go
If you don't mind me asking a question what do you mean Pathing Cost, what excatly is it of you don't mind explaining.
Yeah, but it doesn't always work. I can give you an example where the path is blocked, an the pathing cost is around 240 (mostly when builing diagonally). It seems to be a bug in the path finding engine itself.
The interesting thing is, that
is true in both cases.
@Pharotek: Go
To be honest I'm very new to the editor but it seems to calculate the shortest path between two points, and when there is no path, it returns the maximum value which is 65536.
For my anti-blocking, I've set up a trigger with the event : Unit - Any Unit construction progress is Started
In the Actions I have a If Then Else :
If (Pathing cost between (point x) and (point y)) == 65536 Then Unit - Remove (Triggering progress unit) from the game Else <nothing>
Maybe adding a refund for the building would be great but it's not done yet.
@Pfaeff: Go
Mmm... that may be possible. But I am working on a TD where my terrain is exclusively square shaped, so it works well for me. Don't know how to make it work for diagonal buildings
@scorix1: Go
I found a workaround to the pathing cost technic not working. By putting some pathing restriction at the right place, it's possible to fix it. While I agree it may be unpractical to do this everywhere, it work! Gotta make sure it looks exactly the same as in the picture.