MrGriggs
|
|
Posted on: January 18, 2011, 10:10:34 am |
|
|
Joined: Dec 2010
Posts: 128
|
Not sure if this will work, as I wrote it in notepad and can't test currently, but I've come up with the idea of doing something such as
assign is the variable which determines what number unit is the current one of the list that's selected
if main.selected-1>1{ for(i=0;i<assign;i+=1) { if direction-main.initialdirection <100{ targt_x=mouse_x+lengthdir_x(((i-(main.selected-1-i)) mod 5)* 64,main.initialdirection+90) targt_y=mouse_y+lengthdir_y(((i-(main.selected-1-i)) mod 5)* 64,main.initialdirection+90)} else{ targt_x=mouse_x+lengthdir_x(((i-(main.selected-1-i)) mod 5)* 64,main.initialdirection-90) targt_y=mouse_y+lengthdir_y(((i-(main.selected-1-i)) mod 5)* 64,main.initialdirection-90)}
} }
|
|
« Last Edit: January 21, 2011, 11:38:04 am by MrGriggs »
|
Logged
|
|
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #4 Posted on: January 18, 2011, 01:10:40 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
You mean, like an object index? Anyway, the assign is where you'd want to use a switch(), not a for(). And yes, I'm getting to it.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
MrGriggs
|
|
Reply #6 Posted on: January 21, 2011, 06:28:39 am |
|
|
Joined: Dec 2010
Posts: 128
|
I got the code to function as intended, I will post it up later on today so people can use it if they so desire, if I have time I'll properly comment all variable factors as well.
Why would I use a switch, that would only allow me to have a limited number of pre-defined units :S. With a for loop I can loop until the max selected through all the selected and apply the neccessary value.
|
|
|
Logged
|
|
|
|
|
Post made January 21, 2011, 10:42:48 am was deleted at the author's request.
|
|
|