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.
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: eksxo