Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → absolute values
absolute values
2001-03-06, 6:40 AM #1
how can i get he absolute value of an int?

like say my int is "fade"

fade = ((VectorX(playerlook)+VectorY(playerlook))/2);

assuming that playerlook is the direction that a player is looking, wouldnt the fade value be a negative some times? like -90 or somthing?

or are ints always positive?
I'm just an old man with a skooma problem.
2001-03-06, 8:04 AM #2
Do standard math commands work with vectors? I thought you had to use stuff like VectorAdd, VectorSub, Etc.

Also, I'm pretty sure integers are allways positive, but I could be wrong.

------------------
Black. His gloves of finest wool.
Black. His codpiece made of metal.
His horse is blacker than a hole.
His pot is blacker than his kettle.

Visit Virus Productions!
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2001-03-06, 8:20 AM #3
well i tried it, apparantly they can be negative.

and since fade is an int i dont have to use vector add stuff, im just getting valuse from a vector, thats why they are negative sometimes...unless there is a way to make all the values in the vector positive, what about vectorNorm()? what does that do?
I'm just an old man with a skooma problem.
2001-03-06, 8:47 AM #4
Ints can be positive or negative, as the JK specs read.

------------------
Together we stand.
Divided we fall.
2001-03-07, 8:47 AM #5
You might be thinking of flex's Aglar, but JK's ints aren't like RL math ints, which are ALWAYS positive, otherwise it's not an int [http://forums.massassi.net/html/wink.gif]
Tripping over land mines at the ArmyTC and getting lanced by the knights of the RoXTC
2001-03-07, 8:50 AM #6
Quote:
<font face="Verdana, Arial" size="2">Int

The symbol value will be of type signed Integer number. The range is -2,147,483,648 to +2,147,483,648 signed 32 bit whole number.

A typical assignment would be int closed=1 or int closed=-1. Assigns the value " 1" or "-1" to the symbol "closed".As with other symbols they will be used in the code section.</font>


------------------
Together we stand.
Divided we fall.
2001-03-07, 9:21 AM #7
does that return anything? it looks like it should. i will probanly sound stupid but y divide it by 2?
roses are red, violets are blue, I am schizophrenic, and I am too!

↑ Up to the top!