+/-
by rennie moffat · in Torque Game Builder · 04/17/2010 (5:24 am) · 25 replies
is there a way to give a variable, say a position, a plus minus grace. as in if position is X +- 3 units, ok?
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
I have seen it before, googling now.
and thank you.
04/17/2010 (3:47 pm)
yes, so, mAbs is like what? I have seen it before, googling now.
and thank you.
#3
04/17/2010 (7:57 pm)
mAbs is absolute value, although I would bet google has told you that by now. The difference between x and the target could be positive or negative. So you take the absolute value so you only have to compare it against positive 3.
#4
Amazing.
Thanks!
04/17/2010 (8:19 pm)
great! so mAbs, is in essence just like t2dVetorCompare or something (tho I am sure some one will bust me on that). it simply is a "method" which calls %value and accounts for +- a set amount.Amazing.
Thanks!
#5
Just like Darius Ouderkirk said, mAbs is absolute value. You know... that function that turns a negative number into the same positive number and leaves positive numbers alone.
t2dVectorCompare compares two vectors or points to see if they are identical. It has a parameter which handles the plus-or-minus that you are looking for.
04/18/2010 (1:05 pm)
Yep, you were right. I *am* going to bust you on that.Just like Darius Ouderkirk said, mAbs is absolute value. You know... that function that turns a negative number into the same positive number and leaves positive numbers alone.
t2dVectorCompare compares two vectors or points to see if they are identical. It has a parameter which handles the plus-or-minus that you are looking for.
#6
:)))!
04/18/2010 (2:06 pm)
Yes I was actually thinking of you when I wrote that, I simply mean in pattern. So mAbs() similar to t2dVectorCpmpare(). Just a visual thing not a programming.:)))!
#7
mAbs takes a single number and returns a single number.
t2dVectorCompare takes two vectors and an optional epsilon and returns a boolean.
mAbs( -1.5 ) returns 1.5
t2dVectorCompare( "1.3 2.7", "1.2 2.8", 0.5 ) returns true.
Sorry, but there's nothing remotely similar between the two, visually or otherwise. If you are trying to say that they both use letters and parenthesis, then you might be right, but that wouldn't be programming.
04/18/2010 (4:44 pm)
Even as a pattern, they don't match.mAbs takes a single number and returns a single number.
t2dVectorCompare takes two vectors and an optional epsilon and returns a boolean.
mAbs( -1.5 ) returns 1.5
t2dVectorCompare( "1.3 2.7", "1.2 2.8", 0.5 ) returns true.
Sorry, but there's nothing remotely similar between the two, visually or otherwise. If you are trying to say that they both use letters and parenthesis, then you might be right, but that wouldn't be programming.
#8
04/18/2010 (4:47 pm)
Exactly as I said visually not programming wise. Anyhow, no worries.
#9
You also said, and I quote, "[mAbs] simply is a 'method' which calls %value and accounts for +- a set amount". Not one word in that sentence is true. That's why I was trying to clear it up for you.
But no worries... if you don't want to learn, I'm fine with that.
04/18/2010 (6:07 pm)
You're missing the point. I said that they *aren't* the same visually.You also said, and I quote, "[mAbs] simply is a 'method' which calls %value and accounts for +- a set amount". Not one word in that sentence is true. That's why I was trying to clear it up for you.
But no worries... if you don't want to learn, I'm fine with that.
#11
You seem to reinforce that sentiment with the phrase "to each his own", a phrase that typically means that each person's preference is valid.
Code has hard, well-defined meanings and isn't free to fit to your whims for the day. By treating it as a fluid subject you hurt yourself, and approach my profession with little respect.
You wouldn't say that your heart is the same as your forearm, would you? You wouldn't say an engine is the same as the tire. A doctor or engineer would immediately try to persuade you otherwise.
As you approach your 1 year anniversary with the engine, maybe you should re-evaluate your determination to learn. Search a little longer before writing a post. Spend 16 hours trying to solve a problem before posting. Re-read answers you are given and don't skim read. Enroll into an introductory programming class!
It honestly breaks my heart to know that all of this advice will be dismissed. But what can I do? Should I just ignore your posts? Or should I try to make you a better coder, even in the face of "whatever william"s thrown at me?
04/18/2010 (8:04 pm)
I guess the phrase "whatever william" doesn't make sense to me. I infer that you completely disagree with everything I'm saying and that instead of trying to figure out the differences, you would rather dismiss it all.You seem to reinforce that sentiment with the phrase "to each his own", a phrase that typically means that each person's preference is valid.
Code has hard, well-defined meanings and isn't free to fit to your whims for the day. By treating it as a fluid subject you hurt yourself, and approach my profession with little respect.
You wouldn't say that your heart is the same as your forearm, would you? You wouldn't say an engine is the same as the tire. A doctor or engineer would immediately try to persuade you otherwise.
As you approach your 1 year anniversary with the engine, maybe you should re-evaluate your determination to learn. Search a little longer before writing a post. Spend 16 hours trying to solve a problem before posting. Re-read answers you are given and don't skim read. Enroll into an introductory programming class!
It honestly breaks my heart to know that all of this advice will be dismissed. But what can I do? Should I just ignore your posts? Or should I try to make you a better coder, even in the face of "whatever william"s thrown at me?
#12
Coding can be hard but it's made harder if you don't try to understand the basics of programming but instead attack a specific language and attack specific functions and skim the underlying details. Add to this inventing your own terminology which makes communication very hard and then finally making the same mistakes (and post about them) again and again. Lots of your posts seem more like programming blogs than anything else.
This isn't a "Rennie Bashing" though, hopefully you'll see it as community members trying to be patient and trying to send you in a direction where you can help yourself more fully without having to ask basic questions over and over again.
The danger you're in now is that by dismissing so quickly one of your most valuable resources (William) you've got one less informed person to help you no matter how many "smileys" you put in your posts.
04/19/2010 (1:03 am)
I have to agree. The reason I do reply to your posts Rennie is that I have something inside of me that likes to see people suddenly understand something significant and then take the next step up. We all started by knowing very little!Coding can be hard but it's made harder if you don't try to understand the basics of programming but instead attack a specific language and attack specific functions and skim the underlying details. Add to this inventing your own terminology which makes communication very hard and then finally making the same mistakes (and post about them) again and again. Lots of your posts seem more like programming blogs than anything else.
This isn't a "Rennie Bashing" though, hopefully you'll see it as community members trying to be patient and trying to send you in a direction where you can help yourself more fully without having to ask basic questions over and over again.
The danger you're in now is that by dismissing so quickly one of your most valuable resources (William) you've got one less informed person to help you no matter how many "smileys" you put in your posts.
#13
Example -5 becomes 5, 6 becomes 6, -3 becomes 3 etc...
:)
04/19/2010 (4:10 am)
To explain mAbs in layman terms: mAbs removes the sign of a number.Example -5 becomes 5, 6 becomes 6, -3 becomes 3 etc...
:)
#14
04/19/2010 (6:04 am)
Guys holy jeez, just rake it easy alright I understand the difference alright I get it!!!! Case closed. Let's be big boys and move on. Belive I understand the difference and yes in terms of programming you are completely right, they are not similar at all.
#15
I'm outta' here.
04/19/2010 (6:34 am)
I am taking it easy, no anger in my post at all. As usual you skimmed the post, learned zero. Neither of us were talking about the "mAbs" and you didn't respond to what we posted.I'm outta' here.
#16
04/19/2010 (6:53 am)
In no way am I dismissing him. and I just truly do not understand the dramatics. Yes William is a valuable source but in no way am I intently trying to disrespect him or slander his name. I simply stated, I had learned something new, and it was time to move on. I made a playful suggestion of relating the visuals of the mAbs() and t2dVetcorCompare() as both were foreign to me at some point, no longer, they both make sense. Can we please move on? I am a paying customer and I think a good member of this community I do not need a lecture or advice, simply we put, we have different senses of humor on this topic.
#17
04/19/2010 (6:56 am)
@William. I am telling you, from my heart. I did say "whatever William" because that is what I would tell a brother, friend if they did not "get me". It was not to make you look bad and me cool, it was just a "whatever" So to all.... please, lets just call this a brick and carry on.
#18
Glad you came out and said it. No worry then, you'll get neither from me from now on.
04/19/2010 (7:02 am)
Quote:I do not need a lecture or advice
Glad you came out and said it. No worry then, you'll get neither from me from now on.
#19
What the hell. if it is like this..... please, you read wayyyy too much into this.
take it easy Melv.
seriously.
04/19/2010 (7:21 am)
ooooh god.What the hell. if it is like this..... please, you read wayyyy too much into this.
take it easy Melv.
seriously.
#20
I'm offering you advice to help you but you don't read them and more importantly don't acknowledge or respond to them so like I said above and like you requested; you don't need lectures or advice so I won't give you them from now on.
There's no problem here.
04/19/2010 (7:36 am)
I am taking it easy, don't interpret my text as angry. Quite the contrary, I'm an easy-going person who very rarely gets annoyed at folks. My posts are "spoken" in that manner and I do take it easy.I'm offering you advice to help you but you don't read them and more importantly don't acknowledge or respond to them so like I said above and like you requested; you don't need lectures or advice so I won't give you them from now on.
There's no problem here.
Torque 3D Owner Darius
if(mAbs(x-targetNumber) <= 3) { //x is within 3 units of targetNumber }Is that what you were wondering?