I've done some playing around and so far the only way I could really do this would be to set some ground units that move at the base height of the water, and have ground pathing blockers on the sides of all the land on the map. This is a pita mind you and also makes Transport Ships and Amphibious Vessels a bigger pita.
Is there a way using Movers or something to make a unit amphibious or naval?
-Note-
Went back and made ground units that have a base height of my water, put pathing blockers on shores, made unload/load have a 3-4 range so that way you could transport units properly. Going to have to modify the unload property to check for the height of the unload location to see if you can unload there or not, its a pitiful workaround (thanks Blizz, you should've guessed somebody wanted Naval units.. sheesh)
Make a unit group and add all of your naval units to it. Create a trigger that goes off whenever a naval unit moves. In that trigger, check the World Height (the height of the actual walkable terrain) against the height of the water. If the terrain at the place they're trying to move is higher than the water, don't let them move there.
You could create a trigger that looks for any units casting the unload ability at stage Generic2 - Queue. Then compare the worldheight at the location they've selected with the height of the water and cancel the unload order (and possibly throw a custom error message) if the target location is under water.
You could create a trigger that looks for any units casting the unload ability at stage Generic2 - Queue. Then compare the worldheight at the location they've selected with the height of the water and cancel the unload order (and possibly throw a custom error message) if the target location is under water.
Did I ever tell you I love you? After seeing Reaper Madness I watched you play a lot of SC2 on your livestream, and now that you've posted here, you're my hero ;D
Make a unit group and add all of your naval units to it. Create a trigger that goes off whenever a naval unit moves. In that trigger, check the World Height (the height of the actual walkable terrain) against the height of the water. If the terrain at the place they're trying to move is higher than the water, don't let them move there.
could anybody please spell this out more, or show an image?
Everywhere where you have water on the map, put a region down. You may need to put multiple regions on top of each other, especially if your water is not a perfect circle or square. Then combine those regions.
Then, after you have all of your water set to ONE region, there are a couple of steps you are going to need to follow.
For one, you are going to need a variety of triggers. The first trigger will check to make sure that the unit can move to the target point. Immediately it will check and make sure if the clicked point is below the max height the unit can sail at, and whether or not that point is in your water region. If it is, it will return true and run the next trigger. If not, it will return false and display an error message.
The next trigger is a little bit more complex. You are going to need to draw a 2D line between the ship and the click point. You do this by picking each point in between the ship and the click point. Then you need to draw a 3D line. This part is actually pretty easy, because the height stays the same for each point. With each 2D point that is found with the 2D line draw, create a 3D point with the (x,y) points being the same as the 2D point, but the z point being the max height for the ship that you want to move. Then, if the point is the right height, make sure that it is in the water region you made earlier. This way the ship will not sail through a ravine or something.
This works great, except for one problem. If you click somewhere that is accessible, but not by a straight line, the trigger will return that the boat cannot reach the target point. So what you are going to need to do is, if a point returns negative, try and find an alternate route. So when a point returns negative, check and see if the point to the right or left is an acceptable point. Then store the 2D value into a variable, and then order the boat to move there. Then start the first trigger over again, where it will then treat the new point as the location for the ship to be. Make sure that the trigger does not run again until the boat is idle at that point. This will eventually, if possible, find a route to target location. If the trigger that looks for alternate routes cannot find an adjacent acceptable point, it will return negative and then display an error message saying that the target point is inaccessible.
This system, although it seems like it would create a large amount of lag, actually isn't too bad. Just make sure that if a unit is given another order before it can reach it's destination, that the trigger that was controlling it is destroyed. Otherwise there could be some issues.
For the unload/load feature, you are going to want to be able to unload units in shallow water for a good effect. Also, you are going to want to have different types of boats with different base heights. (open water, shallow, etc). This system can make sure that shallow boats like row-boats can go into the water, but will not go on land, and will not go too deep. If you want an unload feature, have a dummy ability. When the user uses this ability, have a trigger run. This trigger will make sure that the water/land is at an appropriate height to unload. Then have the trigger order each unit to be unloaded separately, checking the height each time. That way, a colossus can be unloaded in deeper water than a marine can. This would also allow for large sea vessels to unload smaller boats, such as row boats. In turn, you can have a cool system where you load some marines into a rowboat, and then you must load the rowboat with the marines into a larger boat before they can be transfered over deeper water.
If you have any questions, just ask.
EDIT: It is possible to do this method without using regions, and instead checking the height of the terrain against the height of the water and subtracting the difference, but that can become a bit complex. The region method is how I did it, and it worked well. However, using height comparisons would probably be easier and more efficient, so if you want to look into that, you probably should.
Make a unit group and add all of your naval units to it. Create a trigger that goes off whenever a naval unit moves. In that trigger, check the World Height (the height of the actual walkable terrain) against the height of the water. If the terrain at the place they're trying to move is higher than the water, don't let them move there.>>
Make a region that encompasses the coastline. Now make so when the amphibious unit enters that area, make a trigger that switches the owner of the unit to a neutral player with the same team color, commands it to stop, command it to go back out to sea, then switch the team player back.
I've done some playing around and so far the only way I could really do this would be to set some ground units that move at the base height of the water, and have ground pathing blockers on the sides of all the land on the map. This is a pita mind you and also makes Transport Ships and Amphibious Vessels a bigger pita.
Is there a way using Movers or something to make a unit amphibious or naval?
-Note-
Went back and made ground units that have a base height of my water, put pathing blockers on shores, made unload/load have a 3-4 range so that way you could transport units properly. Going to have to modify the unload property to check for the height of the unload location to see if you can unload there or not, its a pitiful workaround (thanks Blizz, you should've guessed somebody wanted Naval units.. sheesh)
Make a unit group and add all of your naval units to it. Create a trigger that goes off whenever a naval unit moves. In that trigger, check the World Height (the height of the actual walkable terrain) against the height of the water. If the terrain at the place they're trying to move is higher than the water, don't let them move there.
@rrowland: Go
The current system I'm using works, but I like yours a lot.
Currently hitting a problem with keeping units from unloading their transported units in water..
You could create a trigger that looks for any units casting the unload ability at stage Generic2 - Queue. Then compare the worldheight at the location they've selected with the height of the water and cancel the unload order (and possibly throw a custom error message) if the target location is under water.
Did I ever tell you I love you? After seeing Reaper Madness I watched you play a lot of SC2 on your livestream, and now that you've posted here, you're my hero ;D
You've effectively solved my primary problems.
could anybody please spell this out more, or show an image?
Now this is a real necro.
Here is what I did.
Everywhere where you have water on the map, put a region down. You may need to put multiple regions on top of each other, especially if your water is not a perfect circle or square. Then combine those regions.
Then, after you have all of your water set to ONE region, there are a couple of steps you are going to need to follow.
For one, you are going to need a variety of triggers. The first trigger will check to make sure that the unit can move to the target point. Immediately it will check and make sure if the clicked point is below the max height the unit can sail at, and whether or not that point is in your water region. If it is, it will return true and run the next trigger. If not, it will return false and display an error message.
The next trigger is a little bit more complex. You are going to need to draw a 2D line between the ship and the click point. You do this by picking each point in between the ship and the click point. Then you need to draw a 3D line. This part is actually pretty easy, because the height stays the same for each point. With each 2D point that is found with the 2D line draw, create a 3D point with the (x,y) points being the same as the 2D point, but the z point being the max height for the ship that you want to move. Then, if the point is the right height, make sure that it is in the water region you made earlier. This way the ship will not sail through a ravine or something.
This works great, except for one problem. If you click somewhere that is accessible, but not by a straight line, the trigger will return that the boat cannot reach the target point. So what you are going to need to do is, if a point returns negative, try and find an alternate route. So when a point returns negative, check and see if the point to the right or left is an acceptable point. Then store the 2D value into a variable, and then order the boat to move there. Then start the first trigger over again, where it will then treat the new point as the location for the ship to be. Make sure that the trigger does not run again until the boat is idle at that point. This will eventually, if possible, find a route to target location. If the trigger that looks for alternate routes cannot find an adjacent acceptable point, it will return negative and then display an error message saying that the target point is inaccessible.
This system, although it seems like it would create a large amount of lag, actually isn't too bad. Just make sure that if a unit is given another order before it can reach it's destination, that the trigger that was controlling it is destroyed. Otherwise there could be some issues.
For the unload/load feature, you are going to want to be able to unload units in shallow water for a good effect. Also, you are going to want to have different types of boats with different base heights. (open water, shallow, etc). This system can make sure that shallow boats like row-boats can go into the water, but will not go on land, and will not go too deep. If you want an unload feature, have a dummy ability. When the user uses this ability, have a trigger run. This trigger will make sure that the water/land is at an appropriate height to unload. Then have the trigger order each unit to be unloaded separately, checking the height each time. That way, a colossus can be unloaded in deeper water than a marine can. This would also allow for large sea vessels to unload smaller boats, such as row boats. In turn, you can have a cool system where you load some marines into a rowboat, and then you must load the rowboat with the marines into a larger boat before they can be transfered over deeper water.
If you have any questions, just ask.
EDIT: It is possible to do this method without using regions, and instead checking the height of the terrain against the height of the water and subtracting the difference, but that can become a bit complex. The region method is how I did it, and it worked well. However, using height comparisons would probably be easier and more efficient, so if you want to look into that, you probably should.
Great to be back and part of the community again!
Make a unit group and add all of your naval units to it. Create a trigger that goes off whenever a naval unit moves. In that trigger, check the World Height (the height of the actual walkable terrain) against the height of the water. If the terrain at the place they're trying to move is higher than the water, don't let them move there.>>
what is the trigger event? what is the action?
i can't find a "unit - is moving" type event
@Shadowclaimer: Go
Here's a super easy way.
Make a region that encompasses the coastline. Now make so when the amphibious unit enters that area, make a trigger that switches the owner of the unit to a neutral player with the same team color, commands it to stop, command it to go back out to sea, then switch the team player back.
Done!
<Click Here> To See My Epic Single Player Campaign (LifeForceCampaign.com)
Not to put a damper on this necro buuuuuut...
You are all wrong...
@FockeWulf: Go
If you have to necro give solutions not condescension.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg