Go Back   BWHacks > StarCraft > Starcraft Hacking Related > Challenges

Challenges Weekly competition topics and submissions

Reply
 
LinkBack Thread Tools

Old 12-07-2006, 05:00 AM   #1 (permalink)
TheTempest
Arbiter
Senior Member
Retired Staff Member

Blessed
 
TheTempest's Avatar
 
Join Date: Apr 2004
Posts: 2,092
TheTempest is a glorious beacon of lightTheTempest is a glorious beacon of lightTheTempest is a glorious beacon of light
Default [Hard] [Teams] 12/06/06 - Competition - Set Formation

Howdy,

I saw this in a thread here, but I believe the idea is quite old. Here's my variant.

Hack:
Set Formation

Support 8 types of formations:
1) Line
2) Chevron
3) Inverted Chevron

Here's how this should work. Have a hotkey cycle the various formations. Select a unit, press a hotkey (save this unit in your hack). Next, move your mouse a distance away and then press hotkey again.

Now, "imagine" drawing a line from the unit you saved, to the current X,Y of the mouse (world cords, not screen cords). Find the length of this line and set it as SPACE_AMOUNT. Then move the selected units into that formation using the line as a directional pointer.

That is all that is required.

Ie. if your selected unit is in the middle of the screen, and you click DUE North of him, and say your formation is line. The pattern they should be moved to is:
Code:
                (mouse click here)

                        /\
                        |
                        |
                        |
X   X   X   X   X   X   X   X   X   X   X  X
Time Period:
None.

Good luck.
__________________

My signature is back!! Hell YES!

Click the link, I DEMAND YOU! :-D
http://www.bwhacks.com/forums/showthread.php?t=24873
TheTempest 15 0FF11|\|3   Reply With Quote
Advertisement
 
Advertisement
Advertisement Sponsored links


Old 12-07-2006, 05:11 AM   #2 (permalink)
LCSBSSRHXXX
The Sexy Penguin
Senior Member
Retired Staff Member

Prophet
 
LCSBSSRHXXX's Avatar
 
Join Date: Feb 2005
Location: MOTHA ****IN BOULDER COLORADO
Posts: 7,195
LCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond repute
Send a message via AIM to LCSBSSRHXXX
Default

Chevron:
Code:
      X
    X  X
  X      X
X          X
Code:
X          X
  X      X
    X  X
      X
Code:
X
  X
    X
      X
    X 
  X
X
Code:
      X
    X
  X
X
  X 
    X
      X
__________________
Quote:
Originally Posted by 707 View Post
Gotta throw the magnums down on the counter, and be like yeeeeah bitch.
we pop bitchez wit r gatz klub:
LCS, 707, BELPHEGOR

YEEEEEEEH BITCH

Quote:
Gorgy: so whats the new klub
Gorgy: poppin bitchez wit ur gat
707: WE GOT DICKS LIKE JESUS, SO WE GOTTA SPORT THE MAGS, AND BE LIKE YEEEEH BITCH
LCSBSSRHXXX 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 05:57 AM   #3 (permalink)
LCSBSSRHXXX
The Sexy Penguin
Senior Member
Retired Staff Member

Prophet
 
LCSBSSRHXXX's Avatar
 
Join Date: Feb 2005
Location: MOTHA ****IN BOULDER COLORADO
Posts: 7,195
LCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond repute
Send a message via AIM to LCSBSSRHXXX
Default

If anyone is going to make the formations movable I'd approach it like this:
First get the coordinates of the leader unit (the center one / the one at the point of the formation) and get the difference between the unit's XY and the action / movement's XY. Then add the difference in XY to all, this is pretty much an application of some simple math (translations on a graph).

Here is an Example of this where the unit at the center of the formation is located at (0,0) and the action is at (0,3). You'd add 0 to the X value and 3 to the Y value of each point (See the first two images attached).

If the main unit's located a (0,0) and another is at (-1,-1) and you move to (-5,6) the other point would move to (-6,5) because you add -5 to each X value and 6 to each Y value (See the third image).
__________________
Quote:
Originally Posted by 707 View Post
Gotta throw the magnums down on the counter, and be like yeeeeah bitch.
we pop bitchez wit r gatz klub:
LCS, 707, BELPHEGOR

YEEEEEEEH BITCH

Quote:
Gorgy: so whats the new klub
Gorgy: poppin bitchez wit ur gat
707: WE GOT DICKS LIKE JESUS, SO WE GOTTA SPORT THE MAGS, AND BE LIKE YEEEEH BITCH

Last edited by LCSBSSRHXXX : 01-30-2007 at 12:54 AM.
LCSBSSRHXXX 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:10 AM   #4 (permalink)
LCSBSSRHXXX
The Sexy Penguin
Senior Member
Retired Staff Member

Prophet
 
LCSBSSRHXXX's Avatar
 
Join Date: Feb 2005
Location: MOTHA ****IN BOULDER COLORADO
Posts: 7,195
LCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond repute
Send a message via AIM to LCSBSSRHXXX
Default

Now to rotate the formation of units you need to get the new points using the equation to rotate get the new set of points (X',Y').
Code:
X'=(cos(θ)*X) - (sin(θ)*Y)
Y'=(sin(θ)*X) + (cos(θ)*Y)
θ=theta (the angle that you want to rotate it).
I'll draw out some examples in a minute, gotta love trigonometry.

Edit: Drawings are done, I only did an example with 3 points because it's less math but it will still give you a good idea of how to approach it.

Basically you click at (4,4) and it gets the angle by doing the inverse cosine of the adjacent side over the hypotenuse, which gives you theta, once you have the angle you just use the rotation equation posted above.
__________________
Quote:
Originally Posted by 707 View Post
Gotta throw the magnums down on the counter, and be like yeeeeah bitch.
we pop bitchez wit r gatz klub:
LCS, 707, BELPHEGOR

YEEEEEEEH BITCH

Quote:
Gorgy: so whats the new klub
Gorgy: poppin bitchez wit ur gat
707: WE GOT DICKS LIKE JESUS, SO WE GOTTA SPORT THE MAGS, AND BE LIKE YEEEEH BITCH

Last edited by LCSBSSRHXXX : 01-30-2007 at 12:54 AM.
LCSBSSRHXXX 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:23 AM   #5 (permalink)
YonderKnight
Senior Member
Gold Member

Evangelist
 
YonderKnight's Avatar
 
Join Date: Sep 2004
Location: USA, California
Posts: 1,392
YonderKnight is a name known to allYonderKnight is a name known to allYonderKnight is a name known to allYonderKnight is a name known to all
Send a message via AIM to YonderKnight
Default

I think it should be up to the contestants to figure all the math out =p.
YonderKnight 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:25 AM   #6 (permalink)
TheTempest
Arbiter
Senior Member
Retired Staff Member

Blessed
 
TheTempest's Avatar
 
Join Date: Apr 2004
Posts: 2,092
TheTempest is a glorious beacon of lightTheTempest is a glorious beacon of lightTheTempest is a glorious beacon of light
Default

Nah, i think that's ok.
__________________

My signature is back!! Hell YES!

Click the link, I DEMAND YOU! :-D
http://www.bwhacks.com/forums/showthread.php?t=24873
TheTempest 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:26 AM   #7 (permalink)
gamepin126
Senior Member
Retired Staff Member

Celestial Entity
 
gamepin126's Avatar
 
Join Date: Oct 2004
Posts: 19,437
gamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond reputegamepin126 has a reputation beyond repute
Default

I'm sure his help is welcomed, if they're like me I never got past alg2 so yea...rock on!
__________________

Set a trashcan on fire and keep a bum warm for a night. Set the bum on fire, and keep him warm for the rest of his life.
gamepin126 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:32 AM   #8 (permalink)
TheTempest
Arbiter
Senior Member
Retired Staff Member

Blessed
 
TheTempest's Avatar
 
Join Date: Apr 2004
Posts: 2,092
TheTempest is a glorious beacon of lightTheTempest is a glorious beacon of lightTheTempest is a glorious beacon of light
Default

Too everyone: Please post if you plan on entering.
__________________

My signature is back!! Hell YES!

Click the link, I DEMAND YOU! :-D
http://www.bwhacks.com/forums/showthread.php?t=24873
TheTempest 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:45 AM   #9 (permalink)
LCSBSSRHXXX
The Sexy Penguin
Senior Member
Retired Staff Member

Prophet
 
LCSBSSRHXXX's Avatar
 
Join Date: Feb 2005
Location: MOTHA ****IN BOULDER COLORADO
Posts: 7,195
LCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond reputeLCSBSSRHXXX has a reputation beyond repute
Send a message via AIM to LCSBSSRHXXX
Default

Quote:
Originally Posted by YonderKnight View Post
I think it should be up to the contestants to figure all the math out =p.
I'm just helping out a little!
__________________
Quote:
Originally Posted by 707 View Post
Gotta throw the magnums down on the counter, and be like yeeeeah bitch.
we pop bitchez wit r gatz klub:
LCS, 707, BELPHEGOR

YEEEEEEEH BITCH

Quote:
Gorgy: so whats the new klub
Gorgy: poppin bitchez wit ur gat
707: WE GOT DICKS LIKE JESUS, SO WE GOTTA SPORT THE MAGS, AND BE LIKE YEEEEH BITCH
LCSBSSRHXXX 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:49 AM   #10 (permalink)
K? Pŕo?ćtiόnŹ
=)
Senior Member
Mod preview

Messiah
 
K? Pŕo?ćtiόnŹ's Avatar
 
Join Date: Oct 2004
Location: Okinawa
Posts: 9,305
K? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond repute
Send a message via AIM to K? Pŕo?ćtiόnŹ
Default

I would, but doing advanced maths and **** in ASM is a pain imo. Well more advanced then + - / *
K? Pŕo?ćtiόnŹ 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 06:53 AM   #11 (permalink)
YonderKnight
Senior Member
Gold Member

Evangelist
 
YonderKnight's Avatar
 
Join Date: Sep 2004
Location: USA, California
Posts: 1,392
YonderKnight is a name known to allYonderKnight is a name known to allYonderKnight is a name known to allYonderKnight is a name known to all
Send a message via AIM to YonderKnight
Default

Taylor series, FTW!

Not sure if I would like to enter yet though.
YonderKnight 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 09:51 PM   #12 (permalink)
TheTempest
Arbiter
Senior Member
Retired Staff Member

Blessed
 
TheTempest's Avatar
 
Join Date: Apr 2004
Posts: 2,092
TheTempest is a glorious beacon of lightTheTempest is a glorious beacon of lightTheTempest is a glorious beacon of light
Default

By the way, rotation is not required, that is merly extra credit.
__________________

My signature is back!! Hell YES!

Click the link, I DEMAND YOU! :-D
http://www.bwhacks.com/forums/showthread.php?t=24873
TheTempest 15 0FF11|\|3   Reply With Quote

Old 12-07-2006, 10:58 PM   #13 (permalink)
DrinkBleach

Advocate
 
DrinkBleach's Avatar
 
Join Date: Dec 2005
Posts: 162
DrinkBleach is a jewel in the rough
Default

Quote:
Originally Posted by TheTempest View Post
By the way, rotation is not required, that is merly extra credit.
Ah good, that part was scaring me off, I'm not sure if I'm going to join or not though, I'll see how much time I have next week.
__________________

I'm my biggest fan.
DrinkBleach 15 0FF11|\|3   Reply With Quote

Old 12-08-2006, 02:33 AM   #14 (permalink)
K? Pŕo?ćtiόnŹ
=)
Senior Member
Mod preview

Messiah
 
K? Pŕo?ćtiόnŹ's Avatar
 
Join Date: Oct 2004
Location: Okinawa
Posts: 9,305
K? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond reputeK? Pŕo?ćtiόnŹ has a reputation beyond repute
Send a message via AIM to K? Pŕo?ćtiόnŹ
Default

Making units make a formation with a hotkey is pretty easy, like just telling them to move to a location relative to the first unit, but making them constantly keep that formation would be a bitch.
K? Pŕo?ćtiόnŹ 15 0FF11|\|3   Reply With Quote