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.
[05:47 pm]
Ultraviolet -- zsnakezz
zsnakezz shouted: ultra you have any thought or notes on undead invasion?
I still haven't gotten a chance to play it yet unfortunately. I just downloaded, but today I'm working on a project with a deadline so won't be able to play it today
[04:59 am]
zsnakezz -- >:)
[04:59 am]
zsnakezz -- :)
[04:58 am]
zsnakezz -- somebody gets it
[04:58 am]
zsnakezz -- and its not all just numbers in my file screen
[04:57 am]
zsnakezz -- thank you for your comment though, good to know some people out there tried my map out
[04:57 am]
zsnakezz -- just kidding
[04:57 am]
zsnakezz -- ultra you have any thought or notes on undead invasion?
[2024-5-31. : 2:36 pm]
Wing Zero -- Bop em
[2024-5-31. : 2:36 pm]
Wing Zero -- Mods
Please log in to shout.


Members Online: Roy