Staredit Network > Forums > SC2 Custom Maps > Topic: Unit to Mouse Explosion
Unit to Mouse Explosion
May 14 2010, 11:30 pm
By: Morphling  

May 14 2010, 11:30 pm Morphling Post #1



It was relativly easy, but I have yet to see someone make it.
Code
Unit To Mouse
   Events
       UI - Player Any Player clicks Left mouse button Down.
   Local Variables
       Start = (Position of Marine [129.69, 133.54]) <Point> // The unit chosen should be your hero
       Current Position = No Point <Point>
       Distance = 0.5 <Real>
   Conditions
   Actions
       General - While (Conditions) are true, do (Actions)
           Conditions
               Distance < (Abs((Distance between (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))) and Start)))
           Actions
               General - Wait 0.05 Game Time seconds // This is optional as it controls how long to wait before creating each explosion
               Variable - Set Current Position = (Start offset by Distance towards (Angle from Start to (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) degrees)
               Environment - Create a Large Terran explosion at Current Position
               Variable - Modify Distance: + 0.5
       General - If (Conditions) then do (Actions) else do (Actions)
           If
               Distance >= (Abs((Distance between (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))) and Start)))
           Then
               Variable - Set Current Position = (Point(0.0, 0.0))
               Variable - Set Distance = 0.5
           Else

If you need anything clearified please ask.

Attachments:
Unit to Mouse Explosion.SC2Map
Hits: 7 Size: 170.34kb

Post has been edited 1 time(s), last time on May 14 2010, 11:55 pm by Morphling.



None.

May 16 2010, 1:20 am UnholyUrine Post #2



What and where do "point" and "distance" specify?

Other than that... nice.



None.

May 16 2010, 2:24 am Morphling Post #3



Which point are you talking about? The distance variable tells us how far to move the explosion after each loop. In my example I used .5. This means the explosions would occur every one half tile.

Edit: I'll just explain the whole thing.

Variables:
Start - Start coordinate of the explosion
Current Position - Th current coordinate of the explosion
Distance - Specifies how far apart the explosions are

Actions:
As long as variable Distance is less than the absolut value of the mouse coordinates minus the variable Start then the actions will run
Wait slows the explosions so it's not instant
Change variable Current Position to variable Start plus Distance towards the point of the mouse
Create an explosion
Add .5 to variable Distance so when the actions run again the new value of variable Current Position will be one half tile close to the mouse position
If variable Distance is greater than or equal to the absolut value of the mouse coordinates minus the variable Start then the variable Start and variable Distance resets.

Post has been edited 1 time(s), last time on May 16 2010, 2:39 am by Morphling.



None.

May 16 2010, 2:34 am UnholyUrine Post #4



Like the phrase:

Quote
(Angle from Start to (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) degrees)




None.

May 16 2010, 2:38 am Jack Post #5

>be faceless void >mfw I have no face

That's the mouse x y location.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

May 16 2010, 2:42 am Morphling Post #6



Quote from UnholyUrine
Like the phrase:

Quote
(Angle from Start to (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) degrees)
That is not a variable. It is GE showing that the following text is a point. That point is is the mouse position.
Edit: If you look at my map you can see that I used point with polar offset.

Post has been edited 1 time(s), last time on May 16 2010, 2:51 am by Morphling.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-9-25. : 2:22 pm]
Oh_Man -- https://youtu.be/Lfo4C0xzU04
[2026-9-25. : 12:00 am]
Oh_Man -- he hasnt won a single game so far this is hilarious
[2026-9-24. : 11:41 pm]
Oh_Man -- new arty username Rage Against The Machine
[2026-9-24. : 10:14 pm]
Oh_Man -- https://m.youtube.com/watch?v=KPXri8q9ZBs artys vsing the bot now
[2026-9-24. : 8:12 pm]
Ultraviolet -- do you even lift bro?
[2026-9-23. : 5:21 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider yeh thts straight up cheating
the mutas yes, the wraiths probably not. Have you even watched the video? ;)
[2026-9-23. : 12:56 pm]
Oh_Man -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
yeh thts straight up cheating
[2026-9-23. : 12:24 pm]
Oh_Man -- arty's done another vid. he's also announced he's going to organise showmatches with pro, with NO maphacks, so we can see its actual capabilities
[2026-9-23. : 10:09 am]
NimoStar -- It can by playing the same map thousands of times. It is similar to AI speedrunning games
Please log in to shout.


Members Online: RIVE