Each corner has two spawns, each center spawn only has one but units teleport across the map to the opposite spawn. I need a anti-block system for this map and I have a huge feeling that anything I end up using will be complicated. Can anyone think of a system? I know that it has to allow units to have a straightforward path to their destination at all times, so we cant have units walking around the other side of the map. They have to stay in their lane.
Do you mean, anti-block as in blocking with buildings? If so, have you considered making the road have [No Building] pathing.
If I did that it would mean that you would have to build your maze into that... Kinda restricts your options as you can't have anything that spans the length of your square. Also not entirely sure it would work anyhow as I have a stacking system in place that requires the buildings to have no 'collide' flags.
Now that's a hard one, I'll have to think about it for a bit.
Update: So far, I have it so it anti-blocks in one direction, but I still cant figure out how to prevent units from going the long way around. Normal methods are currently not working, time to try some hacky ideas.
Mwahahaha, got it (its kind of a pain in the butt). Uploading the map in an hour of so (I need to make it more understandable).
edit* NVM - It seems to only work with one lane (and not always). It may take a bit longer than I thought.
Well, it's still not that reliable... but it kind of works. The main problem is disabling the pathing of each alternate route before checking for blocks. To do this, the map spawns blocking apples (I made them apples so you can see them). The problem is, if there is a unit where a blocking apple needs to be, the path blocking will fail. I think this kind of system can be used with success... if the blocker positions are strategically placed. If blizzard decides to actually implement the scripting path manipulators (which currently exist in custom script form but do nothing), it would make everything super simple.
Well, it's still not that reliable... but it kind of works. The main problem is disabling the pathing of each alternate route before checking for blocks. To do this, the map spawns blocking apples (I made them apples so you can see them). The problem is, if there is a unit where a blocking apple needs to be, the path blocking will fail. I think this kind of system can be used with success... if the blocker positions are strategically placed. If blizzard decides to actually implement the scripting path manipulators (which currently exist in custom script form but do nothing), it would make everything super simple.
Well now I feel like an idiot. I just figured out that by putting the ignore placement option on the create unit script it ignores units and stuff. Well, now it should be 100% reliable.
Well now I feel like an idiot. I just figured out that by putting the ignore placement option on the create unit script it ignores units and stuff. Well, now it should be 100% reliable.
Very nice. Looks to work perfect. I'll be sure to give you credits for the anti-blocking system. :D
But could you elaborate on how it works a bit more? It seems a little confusing just looking at the triggers right now. Otherwise cheers!
Basically, whenever you place a building it checks to see if a path from one point to another is possible depending on the region where you placed the building. If there is no possible path, it removes the newly created building (in production code, you might want to display a message and refund costs also). To make sure that the long way around is not checked for pathing, it is blocked using "invisible" blocker units temporarily. The downside to the system is that you have to set up a TON of variables for temporary blocking units in order to get the blocked off paths working correctly. The positions of these temporary blockers are stored in a multi-dimensional array which is used as a lookup to create each region specific temporary blocker. Oh, and pathing is checked using an unclickable unselectable unit at each spawn point. Make sure you look at each of the custom units in the data editor, because some of their properties are important.
Basically, whenever you place a building it checks to see if a path from one point to another is possible depending on the region where you placed the building. If there is no possible path, it removes the newly created building (in production code, you might want to display a message and refund costs also). To make sure that the long way around is not checked for pathing, it is blocked using "invisible" blocker units temporarily. The downside to the system is that you have to set up a TON of variables for temporary blocking units in order to get the blocked off paths working correctly. The positions of these temporary blockers are stored in a multi-dimensional array which is used as a lookup to create each region specific temporary blocker. Oh, and pathing is checked using an unclickable unselectable unit at each spawn point. Make sure you look at each of the custom units in the data editor, because some of their properties are important.
Maybe I just need to get some sleep or something(it's 6 am here) but it feels like my head if going to burst. I'll try fiddling with it a bit later.
Yeah, it is kind of hard to follow, if you have any specific questions regarding the map feel free to ask them. And remember, nothing is impossible with the galaxy editor as long as you can come up with horribly convoluted solutions to seemingly easy problems.
While that code will work for most general purpose uses, it has some idiosyncrasies that could pose as problems when you are purposefully blocking off areas of the map for a split-second. Also, there's a built-in AI function that can calculate how long a particular unit will take to travel a path (and can detect blocked paths).
Yeah, it is kind of hard to follow, if you have any specific questions regarding the map feel free to ask them. And remember, nothing is impossible with the galaxy editor as long as you can come up with horribly convoluted solutions to seemingly easy problems.
Aight I added the data and triggers and set them to what they should be (afaik) but it does not always work. Maybe I should show you the map, actually, instead of just a screenshot. I'll pm a link to you, just because I don't want people to see it here and try stealing it. brb
Lol this may be a stupid suggestion but a trigger could be like this:
Any unit uses ability (building ability) at Complete
Variable(Local) set to last created unit
If
Triggering unit is player (#)
Then
Spawn path checker(unit the only collides with your building and the land and has a speed of 1000)
Wait 1 game seconds
If
Number of spawn path checker in end regoin is = 0
Then
Kill Variable unit KillSpawn checker
Else
Kill Spawn Checker
Edit: Realy easy way that works 85% of the time for me
This would work great for linear paths, but because my map has a whole bunch of different paths it's going to have to be a little more complicated then that. But good idea, that other guys system was wayyy too confusing to understand, and it also didn't take into account the central areas. He only made a square.
I'll try yours and hope I can tune it to work 100% of the time. If I get it to work 100% of the time I'll post the trigger up for everyone to use, seeing as how non-linear antiblock triggers are such a pain to make.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Here is a screenshot of what my map currently looks like:
http://i861.photobucket.com/albums/ab180/l3lackjax/Terrain002.jpg
Each corner has two spawns, each center spawn only has one but units teleport across the map to the opposite spawn. I need a anti-block system for this map and I have a huge feeling that anything I end up using will be complicated. Can anyone think of a system? I know that it has to allow units to have a straightforward path to their destination at all times, so we cant have units walking around the other side of the map. They have to stay in their lane.
Help?
@ST4RKiLL3R: Go
Do you mean, anti-block as in blocking with buildings? If so, have you considered making the road have [No Building] pathing.
If I did that it would mean that you would have to build your maze into that... Kinda restricts your options as you can't have anything that spans the length of your square. Also not entirely sure it would work anyhow as I have a stacking system in place that requires the buildings to have no 'collide' flags.
@ST4RKiLL3R: Go
Now that's a hard one, I'll have to think about it for a bit.
Update: So far, I have it so it anti-blocks in one direction, but I still cant figure out how to prevent units from going the long way around. Normal methods are currently not working, time to try some hacky ideas.
Let me know if you come up with something. If worst comes to worse I could just let them auto-attack freely... but that's if worst comes to worst...
@ST4RKiLL3R: Go
Mwahahaha, got it (its kind of a pain in the butt). Uploading the map in an hour of so (I need to make it more understandable).
All I can do is frown at your edit. :(
@ST4RKiLL3R: Go
Well, it's still not that reliable... but it kind of works. The main problem is disabling the pathing of each alternate route before checking for blocks. To do this, the map spawns blocking apples (I made them apples so you can see them). The problem is, if there is a unit where a blocking apple needs to be, the path blocking will fail. I think this kind of system can be used with success... if the blocker positions are strategically placed. If blizzard decides to actually implement the scripting path manipulators (which currently exist in custom script form but do nothing), it would make everything super simple.
I'll check it out. :D
If you think of a better way etc plz tell me x.x
@ST4RKiLL3R: Go
Well now I feel like an idiot. I just figured out that by putting the ignore placement option on the create unit script it ignores units and stuff. Well, now it should be 100% reliable.
Very nice. Looks to work perfect. I'll be sure to give you credits for the anti-blocking system. :D
But could you elaborate on how it works a bit more? It seems a little confusing just looking at the triggers right now. Otherwise cheers!
@ST4RKiLL3R: Go
Basically, whenever you place a building it checks to see if a path from one point to another is possible depending on the region where you placed the building. If there is no possible path, it removes the newly created building (in production code, you might want to display a message and refund costs also). To make sure that the long way around is not checked for pathing, it is blocked using "invisible" blocker units temporarily. The downside to the system is that you have to set up a TON of variables for temporary blocking units in order to get the blocked off paths working correctly. The positions of these temporary blockers are stored in a multi-dimensional array which is used as a lookup to create each region specific temporary blocker. Oh, and pathing is checked using an unclickable unselectable unit at each spawn point. Make sure you look at each of the custom units in the data editor, because some of their properties are important.
Maybe I just need to get some sleep or something(it's 6 am here) but it feels like my head if going to burst. I'll try fiddling with it a bit later.
Lol this may be a stupid suggestion but a trigger could be like this:
Any unit uses ability (building ability) at Complete
Variable(Local) set to last created unit
If
Triggering unit is player (#)
Then
Spawn path checker(unit the only collides with your building and the land and has a speed of 1000)
Wait 1 game seconds
If
Number of spawn path checker in end regoin is = 0
Then
Kill Variable unit KillSpawn checker
Else
Kill Spawn Checker
Edit: Realy easy way that works 85% of the time for me
@ST4RKiLL3R: Go
Yeah, it is kind of hard to follow, if you have any specific questions regarding the map feel free to ask them. And remember, nothing is impossible with the galaxy editor as long as you can come up with horribly convoluted solutions to seemingly easy problems.
@DarkFireDragoon: Go
While that code will work for most general purpose uses, it has some idiosyncrasies that could pose as problems when you are purposefully blocking off areas of the map for a split-second. Also, there's a built-in AI function that can calculate how long a particular unit will take to travel a path (and can detect blocked paths).
Aight I added the data and triggers and set them to what they should be (afaik) but it does not always work. Maybe I should show you the map, actually, instead of just a screenshot. I'll pm a link to you, just because I don't want people to see it here and try stealing it. brb
This would work great for linear paths, but because my map has a whole bunch of different paths it's going to have to be a little more complicated then that. But good idea, that other guys system was wayyy too confusing to understand, and it also didn't take into account the central areas. He only made a square.
I'll try yours and hope I can tune it to work 100% of the time. If I get it to work 100% of the time I'll post the trigger up for everyone to use, seeing as how non-linear antiblock triggers are such a pain to make.