[WIP] Ortorin's Directional Targeting System

Post » Fri Apr 04, 2014 3:08 am

One thing that the Morrowind Scripting Engine lacks is the ability to determine what NPC is in the player's crosshair at a distance. I have conceptualized two ways of achieving this effect, the only issue I have with implementation is my lack of mathematical and modeling skills. Here are the systems:

#1) "Blind Man with a Cane" Directly in front of the player is an invisible rod a couple hundred feet long that has a collision mesh. Once the player looks at an NPC and the "cane" touches, the script locates all the NPCs in the cell and gets their position. Knowing the position and orientation of the player along with the position of the NPC allows one to use some math to determine if the player is looking at the NPC or not. There are some other smaller details in this system that are there for the sake of optimization of the CPU, but that's the basics.

#2) "Projected Image" One issue with the above system has to do with the size of the NPC. The size can only be expressed as a + or - variation from the coord that the NPC is expressed as. In this system, the script determines which NPCs the player might look at based on orientation and FOV. An invisible box is then selected that best describes the size and shape of that NPC. The box is then "projected" from the position of the NPC to just in front of the player, scaling down so that the box is proportional to the size of the NPC at a distance. It's then rather easy to tell if the player is looking at that box, and therefore, the NPC. http://en.wikipedia.org/wiki/3D_projection#Perspective_projection

If you are good at math or modeling and have a free minute to help, I could really use it. 'Tis the only help I need in this. This will be released as a modding resource.

User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am

Post » Fri Apr 04, 2014 9:14 am

Sounds cool.

I can help with just about any math.

But, will this not work for you?

It's a function from MWSE.

http://mwse.wikispaces.com/xGetPCTarget

Example use: http://www.fliggerty.com/phpBB3/viewtopic.php?t=2158

User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Fri Apr 04, 2014 10:18 am

Those can't be done without MWSE, so you're probably better off using the abovementioned function.

User avatar
evelina c
 
Posts: 3377
Joined: Tue Dec 19, 2006 4:28 pm

Post » Fri Apr 04, 2014 2:25 am

There is only one issue with that guys, the function xGetPcTarget can only reference what is at the player's crosshair if it is within "activation" distance, not at long range. That limitation in the function is the reason I have been trying to get this mod working.

*Edit*

Oh! xGetPcTarget also will not work on a target that is in combat with the player.

User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am


Return to III - Morrowind