Find Me On Discord (Brood War UMS Community & Staredit Network)
Could someone please explain to me or point me to resources that explain this.
It works off detecting movement of the hero unit and you can get the spell to fire in that direction. That way the player has some control over the direction of the spell.
Thanks in advance,
Oh_Man.
While I do recall an inverted location of appropriate size can be used to detect when a unit moves a single pixel, I don't recall a way to get the unit's direction.
One thing you can try is a mobile grid that places an array of locations around your unit, where the top, left, bottom and right locations of the 3x3 mobile grid are sized such that their borders lay just tangent to the hero unit's boundaries. I realize this can be difficult to do since some units AABBs are offset slightly from their center position, and are not all square.
None.
An artist's depiction of an Extended Unit Death
http://www.staredit.net/topic/8993/As stated in the topic linked to in Kenoli's post, locations do not center exactly on a unit since the smallest unit is 1 pixel. I used 4 inverted locations. 1 that was the width of the unit, 1 that was the height of the unit, 1 that was the unit's width minus 1 pixel, and the last was the height of the unit minus 1 pixel.
All 4 locations are centered on it, but the two that are 1 pixel smaller are centered at the top and left of the unit, with 1 side not touching the unit edge.
So, if the unit leaves both width locations, it has moved right. If it has left the larger location but is still in the smaller one, it has moved left. It is the same with the height locations except for down and up, respectively.
Hope that was understandable.
Find Me On Discord (Brood War UMS Community & Staredit Network)
So I'm guessing with this method you can only do cardinal directions and not diagonal?
Just detect the combos: up&left, up&right, down&left, down&right
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
Any examples of maps that use this function?
I made the following maps; Hyperion 2, The Undead, The Undead Coop, Realm Rpg beta, and Overlords.
An artist's depiction of an Extended Unit Death
So I'm guessing with this method you can only do cardinal directions and not diagonal?
You measure the Y-Axis and X-Axis separately with that system, so the solution for deriving diagonals is as simple as jjf says.
Any examples of maps that use this function?
This one:
http://www.staredit.net/topic/9155/There are also a bunch of example maps in the topic I linked above.
Find Me On Discord (Brood War UMS Community & Staredit Network)
Okay thanks guys I'll get to work on this and report back.
Math + Physics + StarCraft = Zoan
I came up with a pretty simple way using mobile grids. The downside is that if the unit walks directly along the x or y axis of the map they slow down a ton.
What's happening is the DT is constantly surrounded by 4 locations, and when he moves into one it then detects him being in one of those locations and then repositions the locations around him again, using a 6x6 mobile grid. The mobile grid however doesn't appear over the DT itself (as that would slow him down), but rather in the center of the map. I'm pretty bad at explaining this in words, so I just attached the example map below.
Attachments: