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.
[06:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[05:41 am]
Ultraviolet -- 🤔 so inf is in you?
[04:57 am]
O)FaRTy1billion[MM] -- my name is mud
[04:35 am]
Ultraviolet -- mud, meet my friend, the stick
[10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
[2024-5-16. : 5:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
[2024-5-16. : 3:36 pm]
NudeRaider -- :lol:
Please log in to shout.


Members Online: 4emmae2385rL0, 9giannae862eL9, 5claudiac4122gM5