Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Focus Distance Debug Variable?
BonesTheRabbit Offline
Member

Posts: 68
Threads: 20
Joined: Feb 2012
Reputation: 2
#5
RE: Focus Distance Debug Variable?

(12-20-2014, 09:34 PM)Mudbill Wrote: Remember, there's more than just the GetPlayerPos functions. How about using the StartPlayerLookAt and the look callback? That will be called whenever the player looks at a certain object. How about using that along with GetEntityPos of this object, then doing a calculation of the relation of distance between the player and it?

I have a rough idea of how it can work, although actually putting it down to script and making it work will require testing and lots of calculations and a clear mind. Good luck.

Well, to give you a better idea of the functional application, I'm trying to mimic a sort of vertigo effect. The idea is that when the player enters an area, a boolean variable returns true, and starts a function that will adjust the intensity of certain camera effects the more that the player looks down from where he is.

The problem is I'm trying to get a nice fluid transition. Basically, if the player's focus isn't far below the horizon, the effect is almost non-existent, but looking straight down makes things go pretty crazy, with a variable intensity between the two extremes. The only way I can think of doing this well is by having areas that move with the player, and which trigger a function callback whenever the player looks at one of them.

I figured there might be a way to reference the debug variable, because there's no function that allows me to return the pitch or yaw of the player camera, and player position doesn't really care where the player is actually looking. It would be a pretty simple matter of using a trig function to remove the player's positional distance from the value and solely calculate the relative focus of the player for use in the function.

I was just hoping to avoid making the area entities constantly move with the player, especially since it would result in a less smooth effect, as I can't adjust the intensity with a fluid variable such as that generated by the debug value. There's other ways I can think of to brute force it, but they become progressively less elegant.
(This post was last modified: 12-20-2014, 09:46 PM by BonesTheRabbit.)
12-20-2014, 09:44 PM
Find


Messages In This Thread
RE: Focus Distance Debug Variable? - by Daemian - 12-20-2014, 03:40 PM
RE: Focus Distance Debug Variable? - by Mudbill - 12-20-2014, 09:34 PM
RE: Focus Distance Debug Variable? - by BonesTheRabbit - 12-20-2014, 09:44 PM
RE: Focus Distance Debug Variable? - by Mudbill - 12-20-2014, 10:09 PM
RE: Focus Distance Debug Variable? - by Daemian - 12-27-2014, 04:22 PM
RE: Focus Distance Debug Variable? - by Daemian - 12-29-2014, 11:12 PM



Users browsing this thread: 1 Guest(s)