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 Value?
Absolute Value?
2005-08-19, 3:33 PM #1
Is there a quicky easy way to do this in cog? I'm rusty and just touching up an old cog and don't feel like downloading anything to check it out.

facepos = GetThingPos(dummy);
dir = VectorScale(VectorSub(facepos, GetThingPos(victim)), ABS(GetThingMass(victim) - distance));

ACTUALLY SCRATCH THAT
I do want to know the answer to that for future reference, but now I just need an idea on how to make something accellerate faster the closer it gets to it's target. I expect answers when I return (or I'll have to do it myself and that'll take 5 minutes of my precious time)
</sarcasm>
<Anovis> mmmm I wanna lick your wet, Mentis.
__________
2005-08-19, 4:10 PM #2
not very hard really

Code:
THEVALUE = (GetThingMass(victim) - distance);

if(THEVALUE < 0)
{
   ABSVALUE = THEVALUE*(-1);
}


:)
visit my project

"I wonder to myself. Why? Simply why? Why why? Why do I ask why? Why do I need to find out why? Why do I have to ask why as a question? Why is why always used to find out why? Why is the answer to why always why? Why is there no final answer to why? Simply why not? Holy cow, this is pretty deep, meaningful **** I wrote. Glad I wrote it down. Oh man."
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [slog], Echoman
2005-08-19, 4:13 PM #3
I know I was hoping for some magic without an if statement, but thanks :)
That's the code I ended up with.
</sarcasm>
<Anovis> mmmm I wanna lick your wet, Mentis.
__________

↑ Up to the top!