Lua Camera Manipulation

Questions about the content creation procedure go here, including using Forge, Anvil, or other editors, or operating emulators like Basilisk II.
Post Reply
Kurinn
Mjolnir Mark IV
Posts: 627
Joined: Jan 26th '09, 22:21
Contact:

So, I was looking at the Lua camera functions, and I was wondering how exactly to use them.

Say that I wanted to put in a camera that followed the player from a 3rd person perspective, looking at the player from an angle perpendicular to the player's facing. Would I put a routine in the Triggers.idle function to continuously sync the camera position with the player?

The documentation explains what to write, but not how to use it.
Image
User avatar
treellama
Vidmaster
Posts: 6107
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

Lua cameras are pretty broken.

Basically, idle is called 30 times a second, but cameras are only updated every time a frame is actually rendered.

I can't think of a way to keep them in sync until we fix that.
Last edited by treellama on Nov 11th '09, 00:46, edited 1 time in total.
User avatar
Wrkncacnter
Vidmaster
Posts: 1948
Joined: Jan 29th '06, 03:51
Contact:

What elimination used to do is: every tick it would clear out all points in the path, and then add a point to the path with a length of 30 ticks or something (to work with lag) where you want the camera to be. It seemed to work well enough even though it's really hacky. Good luck trying to have the camera follow behind the player though. Cameras like to crash if you don't get everything just right.
User avatar
envy
Mjolnir Mark IV
Posts: 750
Joined: Aug 4th '09, 02:28
Location: Land of the New Rising Sun
Contact:

If you ever improve on this, could I make a suggestion? Have the crosshairs rest over the shoulder of the player. It is a whole lot more natural, and you can see what you're firing at.
Si tratta di una lacrimosa.
Kurinn
Mjolnir Mark IV
Posts: 627
Joined: Jan 26th '09, 22:21
Contact:

Alright, I guess that idea is on hold.

Thanks for the explanation, though.
Image
User avatar
envy
Mjolnir Mark IV
Posts: 750
Joined: Aug 4th '09, 02:28
Location: Land of the New Rising Sun
Contact:

Could the same principal apply to guns? So, say the secondary trigger on my fancy sniper rifle throws an invisible camera 20wu in front of me, I could shoot stuff better.
Si tratta di una lacrimosa.
User avatar
Dugit
Vidmaster
Posts: 1803
Joined: Mar 22nd '09, 16:33
Location: Hampshire, UK
Contact:

First, we'll need a weapon that is actually accurate enough to merit either a sniper site or an enhanced vision. Anything like this before that has some kind of sight or just centrally-transparent accessory, has been far to inaccurate to actually make use of the enhancement. The culprits include the SMG (I know, but it isn't really accurate), and the HP Rifle with sight off RtM. Have I missed any?

Vale,
Dugit
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar
tehWastedJamacan
Vidmaster
Posts: 1347
Joined: May 17th '09, 16:24
Location: SuFu, SD
Contact:

Dugit wrote:First, we'll need a weapon that is actually accurate enough to merit either a sniper sight or an enhanced vision. Anything like this before that has some kind of sight or just centrally-transparent accessory, has been far to inaccurate to actually make use of the enhancement. The culprits include the SMG (I know, but it isn't really accurate), and the HP Rifle with sight off RtM. Have I missed any?

Vale,
Dugit
spellign error
D?rovací tvá?í.
Fobo: I find it hard to keep a sentence down under two paragraphs.
acks45
Mjolnir Mark IV
Posts: 584
Joined: Apr 30th '08, 04:41
Location: 20 Minowere Dr. Fromidlov, Canada.
Contact:

I think its hilarius that your all getting giddy about an idea they said doesnt work.
User avatar
Dugit
Vidmaster
Posts: 1803
Joined: Mar 22nd '09, 16:33
Location: Hampshire, UK
Contact:

I tend to do that.
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
Post Reply