I am going to attach a picture. The picture (picture 1) demonstrates a search effect for an attack; ideally, if Version C can be accomplished, than Version A and Version B can also be accomplished.
Now, the goal is create an axis for our cone. In Version A, the axis the facing of the unit. In version B the axis is perpendicular to the 2D plane. In version C, the axis is any 3D vector starting from the position of the unit; however, the following problems seem to arise.
1) Using angular search, we don't get a 3D cone, we get "phantom" triangular prism (picture 2), whose base triangle is an isosceles, the angle is equal to the weapon "arc" in data editor; and whose axis length depends on weapon "range" in data editor.
2) Using distance search, we get a circle, that determines the nearest unit, although it's actually a "phantom" cylinder (picture 2).
3) How does one combine distance and angular search? For instance, if we determine there are multiple valid targets within the cone, then we want to use distance to select our target from the list of valid ones.
So, is it possible for a unit's weapon to use an acquisition search that's a cone?
*The word phantom is used because these 3D shapes, the prism and the cylinder, ignore the third dimension. For instance, in picture 2, you can see that although Object A, has a larger angle from the axis on the 2D plane than Object B, it has a small angle from the axis on the Y-Z plane, placing it inside the desired 3D-cone; however, Object B has a small angle on the X-Y plane, but a huge angle on the Y-Z plane, placing it outside the cone, but Object B is picked instead because SC2 interprets the search function as an infinitely tall triangular prism instead of a cone. In short, the heights of all units are ignored, their (X,Y) coordinates are all that matters.
Now using a trigger to determine these things is simple enough, but a default weapon search int he Data editor, well, NO CLUE! HELP!
I doubt, it is possible in data. Hardly any data features besides movement of units and physics use 3 dimensions, and you cannot use any dynamic calculation to even realize the cone in facing direction (you would probably use validators to limit the height, but you cannot use a dynamic height based on the distance to the source and good luck realizing this with fixed height validators :) )
So I suggest, you go for triggers. To keep it "as data as possible" you can make a trigger reacting to your weapon effect, which does only the search and then executes the next effects in your effect chain and you continue in data again.
(EDIT) Edward: I just read the end of your post where you say you know how to do this with triggers, so I guess my reply is redundant. Let me know if you find a better way though.
I second this. I think you will need to use triggers. Here's one idea:
1) First do a preliminary search on the 2d plane surrounding the unit using the cone ability. Probably just use a 2d circle which includes all the x and y points contained in the cone.
2) Collect all the units that are found in that preliminary search in to a list. Then for each of them, get their x, y, and z position values and plug those in to a function to validate if the unit is within the cone area (you might have a different function to validate each cone type, or just have some extra parameters for that).
3) Apply whatever effect you wish to all the units that were in the cone.
I am going to attach a picture. The picture (picture 1) demonstrates a search effect for an attack; ideally, if Version C can be accomplished, than Version A and Version B can also be accomplished.
Now, the goal is create an axis for our cone. In Version A, the axis the facing of the unit. In version B the axis is perpendicular to the 2D plane. In version C, the axis is any 3D vector starting from the position of the unit; however, the following problems seem to arise.
1) Using angular search, we don't get a 3D cone, we get "phantom" triangular prism (picture 2), whose base triangle is an isosceles, the angle is equal to the weapon "arc" in data editor; and whose axis length depends on weapon "range" in data editor.
2) Using distance search, we get a circle, that determines the nearest unit, although it's actually a "phantom" cylinder (picture 2).
3) How does one combine distance and angular search? For instance, if we determine there are multiple valid targets within the cone, then we want to use distance to select our target from the list of valid ones.
So, is it possible for a unit's weapon to use an acquisition search that's a cone?
*The word phantom is used because these 3D shapes, the prism and the cylinder, ignore the third dimension. For instance, in picture 2, you can see that although Object A, has a larger angle from the axis on the 2D plane than Object B, it has a small angle from the axis on the Y-Z plane, placing it inside the desired 3D-cone; however, Object B has a small angle on the X-Y plane, but a huge angle on the Y-Z plane, placing it outside the cone, but Object B is picked instead because SC2 interprets the search function as an infinitely tall triangular prism instead of a cone. In short, the heights of all units are ignored, their (X,Y) coordinates are all that matters.
Now using a trigger to determine these things is simple enough, but a default weapon search int he Data editor, well, NO CLUE! HELP!
@EdwardSolomon: Go
I guess I asked something even more difficult than I thought!
@EdwardSolomon: Go
Someone help me!
I doubt, it is possible in data. Hardly any data features besides movement of units and physics use 3 dimensions, and you cannot use any dynamic calculation to even realize the cone in facing direction (you would probably use validators to limit the height, but you cannot use a dynamic height based on the distance to the source and good luck realizing this with fixed height validators :) )
So I suggest, you go for triggers. To keep it "as data as possible" you can make a trigger reacting to your weapon effect, which does only the search and then executes the next effects in your effect chain and you continue in data again.
(EDIT) Edward: I just read the end of your post where you say you know how to do this with triggers, so I guess my reply is redundant. Let me know if you find a better way though.
@Kueken531: Go
I second this. I think you will need to use triggers. Here's one idea:
1) First do a preliminary search on the 2d plane surrounding the unit using the cone ability. Probably just use a 2d circle which includes all the x and y points contained in the cone.
2) Collect all the units that are found in that preliminary search in to a list. Then for each of them, get their x, y, and z position values and plug those in to a function to validate if the unit is within the cone area (you might have a different function to validate each cone type, or just have some extra parameters for that).
3) Apply whatever effect you wish to all the units that were in the cone.