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 → Anyway to see if someone is looking at you ?
Anyway to see if someone is looking at you ?
2001-03-02, 9:19 AM #1
Hey , I was wonderin if there is any way that you can program it so if someone is looking right at you it would do something ?
2001-03-02, 11:34 AM #2
if(HasLOS)
{
//turn his face off...etc
}


------------------
http://millennium.massassi.net/ - Millennium
2001-03-02, 8:51 PM #3
Errr kind of but what i'm talking about heki is kind of like

if(getthinglookpos(player, (VectorScale(Vectorx)

type stuff ...
2001-03-02, 8:56 PM #4
So, what do you want to accomplish, and btw the above code isn't right, it should be.

if(HasLOS(player, victim))
{
//do whatever
}


------------------
http://millennium.massassi.net/ - Millennium
2001-03-03, 10:17 AM #5
Well what i really want to acclopish is where the person it looking ... not when the person is looking at someone
2001-03-03, 2:39 PM #6
lookingDir = VectorSub(GetThingPos(victim), GetThingPos(player));

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited March 03, 2001).]
2001-03-03, 4:02 PM #7
Err maybe you don't get the point but it's nothing to do with any victim or something like that

I want it to know when the player looks in a differnt dirrection , and how much by ....
2001-03-03, 5:18 PM #8
You mean just

GetThingLVec(player);

?

------------------
http://millennium.massassi.net/ - Millennium
2001-03-04, 4:01 PM #9
Yes thats a help , I saw that but I thought to my self is it really that easy

anyway , could you tell me how you would put that into a varible

like ...

vector lookvec

lookvec=GetThingLVec(player);

I tryed that but when i did this below to try to make it spit out the numbers , it just came up with -1

jkstringclear();
jkStringConcatInt(lookvec);
jkStringOutput();

Help ?
2001-03-04, 10:11 PM #10
Because it's a vector [http://forums.massassi.net/html/smile.gif]

Instead use

jkStringConcatVector(lookvec);

------------------
http://millennium.massassi.net/ - Millennium
2001-03-05, 5:01 PM #11
lol thanks man

Theres only one more problem , it won't detect when you look up and down

Is there anything to detect this

I tried

upvec=VectorZ(GetThingLVec(player);

But it turned out to be a bad vector.

Help ?
2001-03-05, 6:53 PM #12
You made the "upvec" a flex variable?
And you're missing a ")" in that code.

VectorZ is only a flex.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-06, 4:55 AM #13
GetThingLVec() won't give how a player is looking up and down because only the head looks up and down, not the entire player.

You need to FireProjectile() with an offset instead. Do it the same way I showed you on the RBots forum, but in this case you should use an offset of '0 0.1 0'. Then use VectorSub(GetThingPos(ghost), GetThingPos(player)) to get the vector.
2001-03-06, 1:05 PM #14
Straight from Millennium's Cog Specs [http://forums.massassi.net/html/smile.gif]:

ThingViewDot():

Gets how much a thing is facing to another thing. For example it will return 1, if the thing is directly looking at the other thing. -1 if it's facing 180deg away from the other thing. 0 for looking to both sides from the other thing. And all the other directions are between -1 to 1. Use : ThingViewDot(LookingThing, TargetThing); returns flex.

-Jipe
2001-03-13, 6:01 PM #15
If it's for MotS, here's something that does it.

x = VectorX(GetThingLVec(player));
y = VectorY(GetThingLVec(player));
z = GetThingJointAngle(player, 1) / 40;

SetThingLook(otherThing, VectorSet(x, y, z));

This will get the pitch as well.
No such verb in JK.

------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!