AddCameraShot() Research

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

AddCameraShot() Research

Post by Marth8880 »

Hey guys. I was playing around with the AddCameraShot values earlier today and I found out some things that I thought would be convenient to post.

_____________________________________________

Function layout:

AddCameraShot(rotate_y, rotate_z, UNKNOWN, rotate_x, position_x, position_y, position_z)

The rotate values are most likely in radians (instead of degrees - i.e., the value can range from -1.0 to 1.0) and the position values are most likely individual grid units (or possibly quarters of them) in Zero Editor with the center - 0,0,0 - being the very center of the grid.


Example code with comments:

Code: Select all

	-- Information: rot_y     rot_z      unknown   rot_x       pos_x     pos_y       pos_z
	AddCameraShot(0.327342, 0.011198, -0.944287, 0.032303, -74.878967, 5.497213, -69.507790);		-- tram station
Notes regarding 'UNKNOWN':

The unknown value is...weird. Here's a snippet of a conversation regarding it (in italics) between me and AQT:
Hidden/Spoiler:
[quote]4:36 PM - [GT] Bran: What the...
4:36 PM - [GT] Bran: So it like...
4:37 PM - AQT: :o
4:37 PM - [GT] Bran: I seem to have most of the values down...
4:37 PM - [GT] Bran: But the one weird one.
4:37 PM - [GT] Bran: So far, it seems to like...
4:37 PM - [GT] Bran: Rotate diagonally sort of I guess?
4:37 PM - AQT: Ah...
4:37 PM - [GT] Bran: Via XY.
4:38 PM - [GT] Bran: Also lol
4:38 PM - [GT] Bran: The ordering of the rotation values is so freaking weird.
4:38 PM - [GT] Bran: It goes YZ unknown X.
4:38 PM - [GT] Bran: Instead of XYZ unknown or whatever.
4:39 PM - AQT: Odd.
4:39 PM - [GT] Bran: I guess it probably makes sense though.
4:39 PM - [GT] Bran: Actually yeah, it sort of does from a certain point of view.
4:39 PM - [GT] Bran: Because it's rotating the camera around said axis.
4:40 PM - [GT] Bran: So with YZX, it follows the XYZ formation in a way.
4:40 PM - [GT] Bran: Because Y rotates the camera left and right.
4:41 PM - [GT] Bran: Z rotates around the center.
4:41 PM - [GT] Bran: And then X rotates it up and down.
4:41 PM - [GT] Bran: So it only...kinda fits...ish...
4:41 PM - [GT] Bran: It's still weird though.
4:42 PM - [GT] Bran: Because when XYZ are all 0, the unknown value doesn't seem to affect anything. :0
4:42 PM - AQT: Alright.
4:42 PM - AQT: :o
4:42 PM - AQT: Creepy...
4:42 PM - [GT] Bran: Yeahzo...
4:42 PM - AQT: Maybe it makes a scary little kid pop up in your room and mess things up?
4:42 PM - [GT] Bran: HAHA
4:43 PM - [GT] Bran: Sick...
4:44 PM - AQT: Heho...
4:46 PM - [GT] Bran: So when all of the rotation values are 0 and the unknown value is 0, the camera is completely black.
4:46 PM - [GT] Bran: Even when you spawn.
4:46 PM - AQT: Spawn into darkness?
4:46 PM - [GT] Bran: Heho...
4:47 PM - [GT] Bran: I guess so...
4:47 PM - [GT] Bran: Hmm.
4:47 PM - [GT] Bran: But if you respawn, no more darkness...
4:48 PM - [GT] Bran: Probably because the camera moves to where you died.
4:48 PM - [GT] Bran: And sort of resets itself probably. :0

[/quote]
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Re: AddCameraShot() Research

Post by GAB »

Maybe the UNKNOWN value is a zoom of some sort.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: AddCameraShot() Research

Post by Marth8880 »

That's what AQT and I originally thought, but it seems to rotate the camera diagonally in a weird way without any sort of zoom. :?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: AddCameraShot() Research

Post by Teancum »

GAB wrote:Maybe the UNKNOWN value is a zoom of some sort.
Or an FOV change?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: AddCameraShot() Research

Post by Marth8880 »

Teancum wrote:
GAB wrote:Maybe the UNKNOWN value is a zoom of some sort.
Or an FOV change?
Possibly, but not likely, considering the value's range seems to be -1.0 to 1.0 like with the rotation values, though one could somewhat argue that the maximum (1.0) and minimum (-1.0) field of view "final" values are hardcoded. It would be a weird thing to hardcode, though. Also, judging from my tests, the camera's actual field of view never appeared to change, but rather the rotation of the camera did instead. :?
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: AddCameraShot() Research

Post by AnthonyBF2 »

you can use the debug executable and use free cam, use the command thing and type "dumpcamera" to print coordinates. they are saved in a text file in the gamedata folder.

hope this helps (sounds like you were editing the numbers manually in map script)
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: AddCameraShot() Research

Post by AQT »

anthonybf2 wrote:sounds like you were editing the numbers manually in map script
...to find out what each value does.
LRKfm946
Master Sergeant
Master Sergeant
Posts: 163
Joined: Sun Feb 02, 2014 6:13 pm
Projects :: Battlefront II Hunger Games
Games I'm Playing :: SWBF2 BF3
Contact:

Re: AddCameraShot() Research

Post by LRKfm946 »

You could also try changing the camera shot in real time via LUA in the debug console (SetCameraPosition, etc.). I'm not sure if any of those functions will have all the parameters you want though.
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3285
Joined: Mon Aug 21, 2006 6:23 am
Contact:

Re: AddCameraShot() Research

Post by AceMastermind »

The rotation values being displayed are likely quaternions.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: AddCameraShot() Research

Post by Maveritchell »

I can't find my notes on this (I used to have some of this commented on in a test script; I'll update this if I can dig it up), but an easier way to test this is going to be with CreateMatrix(), which uses the same inputs. You'll be able to examine position and rotation much easier (and externally) that way.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: AddCameraShot() Research

Post by Marth8880 »

AceMastermind wrote:The rotation values being displayed are likely quaternions.
That would make a lot more sense, especially considering quaternions consist of four values/dimensions (or something like that).
Maveritchell wrote:I can't find my notes on this (I used to have some of this commented on in a test script; I'll update this if I can dig it up), but an easier way to test this is going to be with CreateMatrix(), which uses the same inputs. You'll be able to examine position and rotation much easier (and externally) that way.
Notes would be great. :) I'll also try to mess around with CreateMatrix().
Post Reply