Maybe I'm going nuts
by Phillip O'Shea · in Torque Game Builder · 09/29/2007 (12:22 am) · 3 replies
So, firstly, who knew you could do this?
Oh, and, to the best of my knowledge, this works *properly* now:
Before if you multiplied %x by anything it would nut out.
Edit: Yes, yes, I am nuts, I figured out my bug, arrrrgh, loooooong night *sigh*
%position = %this.getPosition(); echo (%position.x); echo (%this.getPositionX()); //Same as above!
Oh, and, to the best of my knowledge, this works *properly* now:
%x = (%y > 0) ? 1 : 0;
Before if you multiplied %x by anything it would nut out.
Edit: Yes, yes, I am nuts, I figured out my bug, arrrrgh, loooooong night *sigh*
About the author
Head of Violent Tulip, a small independent software development company working in Wollongong, Australia. Go to http://www.violent-tulip.com/ to see our latest offerings.
Torque Owner Adam Larson
Really it's just a different way of doing the same thing as 'getWord.' It's not specific to vectors. So, getWord(%var, 0) would return the same thing as %var.x regardless of the contents of %var. %var.y and %var.z work for words 1 and 2 also. I think you can even do crazy things like "10 20".x to return 10, although I don't know why that would ever be useful.
It's supposed to work with operators also, so you can do %var.x += 10 to add 10 to the x component or even something more complex like %var.y = %var.x + 7. Again, I'm not sure if this always works.