Staredit Network > Forums > SC2 Assistance > Topic: Simple Subtraction
Simple Subtraction
Apr 25 2010, 10:25 pm
By: Morphling  

Apr 25 2010, 10:25 pm Morphling Post #1



I'm trying to subtract the mouse position with the heroes position, but I cannot figure out how.
I created two variables that stores the Mouse X and Mouse Y position and another that stores the point for the position of unit, but I cannot subtract an integer from a point so how can I do it?



None.

Apr 25 2010, 10:37 pm Centreri Post #2

Relatively ancient and inactive

Try finding an arithmetic function. The editor isn't loading for me right now, but that's what it was in WCIII.



None.

Apr 25 2010, 10:54 pm Morphling Post #3



You cannot do any arithmetic with points. Is there any way to seperate values of a point into two seperate variable integers?



None.

Apr 25 2010, 11:09 pm Centreri Post #4

Relatively ancient and inactive

You can do arithmetic between the x and y values of points. Create four local variables: x and y of both points, basically. Then subtract them and make a point out of that. I don't want to go all through it, but I've seen the functions that work with x and y.



None.

Apr 25 2010, 11:38 pm DavidJCobb Post #5



Quote from Morphling
You cannot do any arithmetic with points. Is there any way to seperate values of a point into two seperate variable integers?
He doesn't know how to get the x and y coordinates into their own variables, Cent.



None.

Apr 25 2010, 11:39 pm Morphling Post #6



I cannot find out how to put the x and y of unit position into integers. The option to find the position is only available when the variable is a point and I cannot figure out how to subract a two integers(mousex and mousey) from one point(unitx and unity).



None.

Apr 26 2010, 12:07 am Morphling Post #7



Nevermind I figured it out.



None.

Apr 26 2010, 1:31 am Centreri Post #8

Relatively ancient and inactive

Yeah, all it takes is using the search function. <_<



None.

Apr 26 2010, 1:38 am Morphling Post #9



The problem was that I was using an integer when I should have been using real.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:28 am]
Ultraviolet -- sounds like Bound & Defend
[07:43 pm]
Symmetry -- If you take the reins you damn well be ready to ride
[02:46 pm]
NudeRaider -- you wish
[2026-5-23. : 12:43 am]
IskatuMesk -- Ah, so Reindeer Breeding 3: BDSM edition.
[2026-5-22. : 12:45 am]
Moose -- tbh
[2026-5-20. : 8:27 pm]
Symmetry -- It's a bound map where you cross obstacles to earn units to defend your base
[2026-5-20. : 8:16 pm]
Symmetry -- No, the world isn't ready for that
[2026-5-20. : 5:11 pm]
Zoan -- Reindeer Breeding 3?
[2026-5-19. : 7:20 pm]
Symmetry -- I've started *another* map too. Feeling nostalgic.
[2026-5-19. : 7:17 pm]
Symmetry -- But people need constant access to my creations!
Please log in to shout.


Members Online: DarkenedFantasies, O)FaRTy1billion[MM]