Combine a rectangle region and a diamond region, then set one of them to negative. Be aware, though, that compound regions can be somewhat sketchy for triggers. I've found that combining more than two of them causes issues.
Yeah interesting, but you can only make rectangle triangles. I would like to have more effecient, custom triangles. Is it possible to modify natives script now, like events?
Determining point-in-polygon is a commonly required programming task. It is typically done by conceptually drawing a straight line (ray) from the position in question in ANY direction and counting the number of times that line crosses the polygon's boundary. If the ray crosses the polygon boundary an odd number of times, then the point is inside the polygon. If it crosses an even number of times (0 is an even number too), the point is outside the polygon.
To do this programmatically, you need to define the vertices of the polygon and then test the resulting line segments one-by-one. It's actually simpler than it sounds. I uploaded some Lua code that does it. See the attachment.
You can create this logic in the trigger editor, and use it to test point-in-polygon for ANY polygon shape. I'd use the center points of circular zones to define the vertices of your triangle, quadrilateral, pentagon, whatever. However, the expression editor appears to be either bugged or programmed by Neanderthals: see my help topic about the expression editor, hopefully I get some assistance soon!!!!
Oh yea, here's a Wikipedia entry on point-in-polygon:
Is is possible to upload a map on the forum? I don't know if it is possible...
Thanks in advance!
Only way I could think of is by generating one through triggers with a bunch of thin rectangles (kinda like Riemann sums) or circles.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
Regions lack a triangle primitive shape.
Depending on the intended purpose you might be able to get away with a circle region and then filtering results to be within a triangle.
Combine a rectangle region and a diamond region, then set one of them to negative. Be aware, though, that compound regions can be somewhat sketchy for triggers. I've found that combining more than two of them causes issues.
Ah, and for equilateral triangles you can use polar offsets to make negative rotated rectangles. Nice.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
Yeah interesting, but you can only make rectangle triangles. I would like to have more effecient, custom triangles. Is it possible to modify natives script now, like events?
As far as I am aware it is not possible to modify natives like it is not possible to modify events as they are hard coded into the SC2 game engine.
I think you can also use arcs for regions so having three arcs face each other could also work.
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
Determining point-in-polygon is a commonly required programming task. It is typically done by conceptually drawing a straight line (ray) from the position in question in ANY direction and counting the number of times that line crosses the polygon's boundary. If the ray crosses the polygon boundary an odd number of times, then the point is inside the polygon. If it crosses an even number of times (0 is an even number too), the point is outside the polygon.
To do this programmatically, you need to define the vertices of the polygon and then test the resulting line segments one-by-one. It's actually simpler than it sounds. I uploaded some Lua code that does it. See the attachment.
You can create this logic in the trigger editor, and use it to test point-in-polygon for ANY polygon shape. I'd use the center points of circular zones to define the vertices of your triangle, quadrilateral, pentagon, whatever. However, the expression editor appears to be either bugged or programmed by Neanderthals: see my help topic about the expression editor, hopefully I get some assistance soon!!!!
Oh yea, here's a Wikipedia entry on point-in-polygon:
https://en.wikipedia.org/wiki/Point_in_polygon