Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 76 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD Mapping
CoD mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Determining player's sight angles
macklebee
General Member
Since: Dec 6, 2006
Posts: 104
Last: Aug 24, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Saturday, Aug. 11, 2007 09:45 pm
I remember seeing a post awhile back between Grassy and another member working code that determined the angles that a player was looking. Unfortunately (or fortunately, [biggrin]) Grassy posts so much that I cannot find the post by viewing his posts. Also cannot find it through the search.

Essentailly what I am looking for is how to determine at what angle a player is looking. For Example: If the player is looking up, what angle is he looking up?

They had determined how to do it from what I gathered in the conversation, but like a big dummy I didn't copy the post down because I believed that I could find it later.

I have already asked Grassy, but its been so long ago that he doesn't remember details. And I don't remember the other member...

So anyone out there know the answer?
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 06:22 am
Have you tried looking more specific (like Search for this word(s): angles...For only this username: WHC_Grassy)?
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 10:23 am
Ullo?? I heard my name

Post too much do I ? :) [casanova]
Well that may be true, my Missus would agree with that as well.. LOL

Ok found some stuff relevant to your question.

http://www.modsonline.com/Forums-top-63610.html

We need more info on what your trying to do, maybe even see what you have got so far in your script etc etc...

Grassy
Share |
macklebee
General Member
Since: Dec 6, 2006
Posts: 104
Last: Aug 24, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 03:00 pm
well, I have tried the anglestoforward function but it still doesn't give the up & down angles of the player's aim. It appears that it just gives the x & y axis angle on a scale of -1 to 1; where -1 is equal to -90 degrees etc... the z-value is always zero no matter what direction I look up or down...

seems strange that there's no apparent function for this?

yeah, like I said I have searched this entire site looking for any reference that would giv the player's aim angle, player's view angle, player's direction of sight, etc... Only found similar questions with no answers...





edited on Aug. 12, 2007 11:04 am by macklebee
Share |
macklebee
General Member
Since: Dec 6, 2006
Posts: 104
Last: Aug 24, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 03:56 pm
it must be possible because when you are on a mounted MG42 the gun follows the player's view; left, right, and up and down...
Share |
Dibbes65
General Member
Since: Oct 3, 2005
Posts: 89
Last: May 25, 2008
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 06:11 pm
Both lookup and lookdown angles are 85 degrees. I discovered this a while ago by playing with the console in CoD2.
Share |
macklebee
General Member
Since: Dec 6, 2006
Posts: 104
Last: Aug 24, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 09:44 pm
[confused]

sorry, I don't follow you. I think we are talking two different things here. What I am asking is how to determine what angle a player is aiming? If you just grab the player angles it never gives info on the up/down coordinates. Which in retrospect makes sense, since the player is not moving up and down just his field of vision is...

but something is moving up and down on the player when he is aiming up or down... if it wasn't then it would look weird any time a player shot someone at a height different than theirs... just need to figure out what on the player is moving with the player's field of vision... and determine how to grab that information and use it...
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 10:19 pm
i would post more but i dont hav time, from wat i know about view angles an stuff is in prone ur view hight from ground is 11 units, crouch is 40 and stand is 60
to get somthin to spawn in front of u (from awe)

origin = self.origin + maps\mp\_utility::vectorScale(anglestoforward(self.angles),100) + (0,0,40);

object = spawn("script_model",origin);
object setModel("xmodel/blah");
object.angles = vectortoangles( (0,0,-1) ) + (90,0,0);
object show();
wait 30;
object delete();

to get the players angles i think its myangles = self.angles;
were only the side to side one changes

and finaly, i dont think ya get get the up/down angles of were the player is facing *crys* [sad]
Share |
macklebee
General Member
Since: Dec 6, 2006
Posts: 104
Last: Aug 24, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Sunday, Aug. 12, 2007 11:40 pm
thanks anyways Killer... but I already have the player's angles... but for what I am working on I need the angles that the player is aiming at... and I have already tried the CoD2 function 'getplayerangles' which looks exactly like what I am looking for... alas, its an unknown function for CoD1...
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Monday, Aug. 13, 2007 08:27 am
try this, i dunno how to do vector stuff so its just the basic part

Code:

playeranglestoplayers()
{
	while(1)
	{
		players = getentarray("player", "classname");
		for(i = 0; i < players.size; i++)
		{
			if(players[i] != self) // think thats how u get rid of ur self wen gettin all other players
			{

// some stuff here about anglesToForward(angle);
// vectorangles or somthin from ur self.origin to the players[i].origin
// and a if(angles <= -20 && angles >= 20) or somthin like that
// look in awe scripts for angle vector stuff

			}
		}
		wait 0.1;
	}
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoD Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»