Author Topic: Get Camera Position  (Read 551 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Get Camera Position
« on: June 10, 2011, 05:37:41 pm »


               Is there a hidden include or a vault script that enables you to get the camera's position? I'm having a hard time figuring out how to get any information on the camera's vector.

I've been using Gestalt's cutscene include, but none of those functions enables you to access camera data either.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Get Camera Position
« Reply #1 on: June 10, 2011, 07:36:37 pm »


               Ok here is my guess as to why there are no such functions.
 The camera is handled by the clients not the server.  There are functions in place for the server to send information to the client to change the camera facing.   But there are no functions in the clients for it to report the camera facings back to the server.    

So my guess is that a client hack would be needed to achieve such a function.  

As stated this is a guess only.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Get Camera Position
« Reply #2 on: June 10, 2011, 08:18:48 pm »


               My guess is that if you are unaware of any get data functions for the camera, there probably aren't any. Thanks for the reply. I'll figure out another way for a smooth transition into a cutscene - rather than the abrupt camera angle change.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Get Camera Position
« Reply #3 on: June 10, 2011, 10:23:08 pm »


               I still have never used any cutscene functions(other than effects). Perhaps you could set the position via variables on some object just before each movement? Just a thought.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Get Camera Position
« Reply #4 on: June 10, 2011, 10:52:30 pm »


               Setting the position is no problem. Gestalt has a great set of functions for this available on the vault for camera movements and cutscene commands to actors etc.

I wanted a way to capture the starting position of the camera and then use that data to help define the first camera movement. I'll have to experiment with camera movements and see how they work when I don't know the starting point. Perhaps the simplest way to do it would be a fade out then fade in to a default position then pan and scan from there.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Get Camera Position
« Reply #5 on: June 11, 2011, 04:09:40 pm »


               I believe I am starting to understand why the functionality for tracking a camera's position was not implemented.

I've gone down a wild and wooly road: beginning a cutscene in a location determined by the PC rather than a predetermined location. This is very difficult to pull off, especially in a complicated tileset with a ceiling. So I doubt the engine was ever intended to handle this situation. If I knew the camera's starting position, I could possibly pull this off, but it would take sophisticated code, lots of 3D math, and ray casting.

Anyway... its clear to me given NWN's limitations, and that it is geared towards hobbyists, cutscenes are supposed to be predetermined events, in predetermined locations with predetermined movements. You aren't supposed to write a cutscene that could happen in a variety of locations.

Has anyone else pulled this off? In essence I'm trying to write stage directions that can handle any situation.
               
               

               


                     Modifié par henesua, 11 juin 2011 - 03:13 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Get Camera Position
« Reply #6 on: June 11, 2011, 05:02:33 pm »


               

henesua wrote...

I'll figure out another way for a smooth transition into a cutscene - rather than the abrupt camera angle change.


Pretty sure most people just use the "FadeToBlack" function to make it seem smoother.  Then "FadeFromBlack" once you got a camera angle set up. But like you were saying, most cutscenes are made for a specific reason in a predetermined place so setting up how you want the camera would be easier.  Maybe there is sort of a "sweet spot" if you will, that would work no matter the players current position/area? Perhaps you could set up generic cutscenes based on whether or not the player is under ground, above ground, inside, etc?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Get Camera Position
« Reply #7 on: June 11, 2011, 05:36:44 pm »


               I've decided to approach the scene differently. I tried and tried to find the sweet spot for the camera, but the tileset I am using, Diademus' spider caves, has a complicated wok mesh and a tight ceiling. It was creating problems for the camera angles and the character movements.

To avoid showing a single take where the NPC and PC approach one another and act out the scene, I'll look into highlighting dramatic moments but allow play to unfold. Then I can provide the appropriate follow up scene depending upon outcome. That will be tricky and a lot of work, but maybe it will look better.

Then again perhaps I am taking this too seriously.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Get Camera Position
« Reply #8 on: June 11, 2011, 06:04:07 pm »


               Henesua, just to echo something GhostOfGod said: If you look for a "sweet spot" which is constrained by the most constraining situation you're likely to encounter and then create dynamic cutscenes based on that information, you can probably pull off what you want. 

Whether you're artistically pleased with the result, however, is another matter.

I'm going to be up front and admit that I haven't played with camera stuff for about a year and a half, maybe two.  But glancing over this thread, I wonder if you've tried playing around with StoreCameraFacing to get the data you want?  I really don't know but I wanted to mention it as an option.

I've just used the camera to make NWN a side-scroller and do King's Quest-style "security camera" views so unfortunately I don't recall having much experience with that specific function.
               
               

               


                     Modifié par OldTimeRadio, 11 juin 2011 - 05:05 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Get Camera Position
« Reply #9 on: June 11, 2011, 06:08:17 pm »


               

Then again perhaps I am taking this too seriously.

I think it's typical to get sucked into details when it comes to cameras and cutscenes.  When you become the director, it's easy to start getting picky with exactly how you want something to be shown to the player.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Get Camera Position
« Reply #10 on: June 11, 2011, 06:17:57 pm »


               Yeah the issue is that I am not pleased with the results, and yes I am getting sucked into these details. This is also my first cut scene so I'm just learning how all the functions work.

the issue with StoreCameraFacing is that you can't get data out. You store the data somewhere, but can't make use of it.

BY THE WAY... setting the camera to make a side scrolling game out of NWN is awesome. Very cool idea.
               
               

               


                     Modifié par henesua, 11 juin 2011 - 05:19 .