What do all of the functions do?
Hello everyone,
I have figured out what some of the functions do through watching tutorial videos, but I have only figured out like three...
I have the random, precision, and vectortoangle functions down, and that is it.
Any help with any of the others would be greatly appreciated!
Jack McGraw
I have figured out what some of the functions do through watching tutorial videos, but I have only figured out like three...
I have the random, precision, and vectortoangle functions down, and that is it.
Any help with any of the others would be greatly appreciated!
Jack McGraw
Comments
max(x,y) picks the larger one.
abs(x) absolute value
acos(x) is (I'm pretty sure) arcos(x), so the angle whose cos is X, if that makes any sense. atan() and asin() are the same, but for tan and sin.
Ceil(x) rounds up to the nearest integer
floor(x) rounds down
I'm not sure on exp(x), but I think it's e^x.
ln(x) natural log of x, so log base "e"
log10(x) is a normal log, with base 10.
Magnitude is involved with distance. It's done like this distance between points (x,y) and (w,z) is magnitude(x-w,y-z)
PadInt and PadReal are involved with displaying numbers. I haven't used them, but it's something like Padint(x,y) is x with however many zeros before it to make y digits, PadReal(x,y,z) is something about x as the number with y digits, I think, and z determines x's placement (10s, 1s, 1000ths, etc) in the number.
pow(x,y) is x to the power of y.
sqrt(x) is the square root.
And you know vector to angle, but it works in the same format as magnitude, but is used to find the angle between two points.
Hope that helps, and if I'm wrong on one, someone please correct me.
Asymptoteell
There really needs to be a good an in-depth explanation of these functions for us non-mathematicians, GS is aimed at non-programmers, which is great if you are an artist, designer or games enthusiast rather than a coder, but it seems odd to leave all these things undocumented (in relation to their use in Gamesalad) especially considering GS's intended audience.
I would pay good money for a book that explains what these functions are and how to use them, the same goes for a lot of GS functionality, I know there is the cook book and the unofficial guide, but neither are exhaustive, the cook book doesn't even mention a lot of the functinloty in GS.
. . . . (cont)
Q: The 'min (x,y)' function, how would you use this and what would you use it for ?
Q: The 'vectortoangle' function looks useful, I see it a lot in templates and examples, if only I knew what it did (lol), like many of the clever tricks this seems off limits to most users without a guide, again the same question: how would you use it and what would you use it for . . . . . ?
Any input greatly appreciated !
(Ty) x (na) = (n)
@Asymptoteell that is the best set of definitions, to date!
@Tynan got vector to angle … can use … darned if I could explain it adequately!
MH
"got vector to angle … can use … darned if I could explain it adequately!"
You maths elites, keeping all the good stuff for yourselves while we, the masses, fight amongst ourselves over a 'constrain to X' behaviour and 'change image size'.
We will rise up one day.
[goes back to working on his epic 'Pong™' game].
Now for the min and max, you could put those 2 together in a constrain expression and give it the minimum position and the maximum position it can be in, and the actor will not go pass those set boundaries.
Heres an example (credit goes to tsb, he has this demo and expression on gshelper.com);
When touch is pressed, constrain self position x to: max((0+( self.Size.Width /2)),min((320-( self.Size.Width /2)), game.Mouse.Position.X ))
What that will do is when you touch the actor you can drag it around on the x axis, but it will not leave the screen (for portrait) because the begining of the scene is 0, and the end of the screen is 320. If you swapped out the 320 for 480, it will keep it inside the screen limits of a landscape screen, because the end of the landscape screen is 480.
You can also use min and max in a constrain for say a volume slider, where you would want to slide it around to set the volume, but not be able to drag it past the limits of the slider.
Hope that wasnt confused and helped explain a little bit, im half asleep but just wanted to try and help before i went off to bed.
cheers
@tynan I wouldn't consider myself part of "the masses". It's just that I haven't learned any of this stuff yet (I'm in 8th grade geomotry right now). I would agree that GS needs more tutorials on it though.
"I wouldn't consider myself part of "the masses"
My comment was a joke.
"I would agree that GS needs more tutorials on it though."
Yes, definitely, a tutorial on each function would be ideal, with illustrations too (and maybe a song?).
: )
Thanks for the explanation, I will take another read tonight and then play around with those two functions to see if I can get my head around them.
Much appreciated !
Hush, little one... Don't make a sound.
Ceil(x) rounds up... Floor(x) rounds down.
Hush, little one... Don't say a word.
cosines sines and tangents are a bit absurd...
Sleep, Little one... Close your sleepy eyes.
Min and max can give actors constraints. What a surprise!
Rest, Little one... Lay down your sleepy head.
Magnitude's for distance. Pop POP! Magnitude said.
Good night, Little one... This song is almost done.
Vector to angle tells the angle between; oh what fun!
Lullabies are the only way.
Asymptoteell
: )
Ha!
"cosines sines and tangents are a bit absurd..."
Funnily enough cosines and sines are the only ones I do understand and know how to use !