need x,y,z coords for location of camera

gl2gz1

Banned
hi. this is something that would make such a difference for me & so i stopped twiddling my thumbs & wondering about it & decided to just ask for help.

im looking for something similar to the keystoke in sandbox + which identifies the character's current location, but just for the camera...

here's the (possibly tricky) part : i'd like to also be able to see these coords in gibbed's clip editor.... that thing has given me so many new ideas for adventures i woulda never had in steelport only cuz i thought about taking a vid of something & then i get hooked on just whatever the idea was to get a vid of.... lol. but besides, that, it would be incredibly helpful for a little dumb project im working on, & hoped u guys could tell me what to do to find out the current xyz coord of the camera.

if not working in clip editor, i understand maybe thats a totally different thing to tackle, i'm not sure, but just in regular play, how can i find the coords of the camera? like instead of "get player position" maybe there's something somewhere that says "get camera position?" i dunno. thx guys, i'll check back in a few hrs, hopefully this is something ridiculously easy!! Thx again!
 
ok, im only gonna bump once, but i've been up all nite trying to figure this out, & looking up lua in general & trying to learn but the technical side of stuff is over my head, i'm good with the logic & problem solving, but i see many references for other games & examples & all sorts of things that seemingly can report back the camera position, & im looking at cutscene tables that have them listed, & one website refers the the 6 values that i would expect to get just doing some "query for local camera position," i just dont know what to do....

i truly dont know anything about programming, thats why my def dist was sloppy, i didn't even know it was, i was just copying & pasting in notepad til it worked right.... but if lua is a language & it has language based functions, shouldnt something like these work (that i just copied from a site on my desperate googling of lua & this would be for getting camera location, & angles..... they compare it to C++ :




Code:
if you know c/c++ most functions,syntax is very similar.. and or can easily be converted to lua syntax.. the 3d functions used within luaplayer already resemble that of c/c++..opengl etc..
 
example C++ .. ((parameters used .. (camera) .. position x,y,z ..view x,y,z..up-vector..x,y,z..))
 
gluLookAt(Camera.x, Camera.y, Camera.z, View.x, View.y, View.z,0.0f,1.0f,0.0f);
 
 
 
...converted to lua syntax..
 
Gum.lookAt(camera.x, camera.y, camera.z, camera.view_x, camera.view_y, camera.view_z,0.0,1.0,0.0 )
 
 
 
or C++...
 
Camera.x += ((View.x + Heading.x * - 6) - Camera.x) / 3;
 
Camera.y += ((View.y + Heading.y * - 6 + 2) - Camera.y) / 3;
 
Camera.z += ((View.z + Heading.z * - 6) - Camera.z) / 3;
 
 
 
...converted to lua syntax..
 
camera.x = camera.x + ((camera.view_x + camera.heading_x * - 6) - camera.x) / 3
 
camera.y = camera.y + ((camera.view_y + camera.heading_y * - 6 + 2) - camera.y) / 3
 
camera.z = camera.z + ((camera.view_z + camera.heading_z * - 6) - camera.z) / 3


----

i also found the following in the srtt gamelibs thing, it sounds like a way to direct the camera to a very specific coordiante, which is exactly what i need. .... see below :

Code:
-- Moves the camera from its current position and orientation to the specified navpoint's position and orientation.
 
--
 
-- navpoint_name: (string) navpoint to look through
 
-- duration: (float, optional) duration of movement, in seconds; if set to 0, camera will instantly jump to the end position and orientation (defaults to 0)
 
-- yield: (boolean, optional) set to true to block until the camera movement is complete (defaults to false)
 
-- hide_hud: (boolean, option) set to false to not disable the hud when using this camera (defaults to true)
 
--
 
-- NB: the camera will not return to its default behavior unless a camera_end_script() action is issued. If the camera script finishes execution before the
 
-- camera_end_script() action is issued, the camera will hold the last position of the camera script.
 
--
 
-- Example:
 
--
 
-- camera_look_through("$npc000", 5.0, true)
 
-- camera_end_script()
 
--
 
-- Move the camera over a period of five seconds so that it is looking through navpoint "$npc000".
 
--
 
function camera_look_through(navp, duration, yield, hide_hud)
 
camera_look_through_do(navp, duration, hide_hud)
 
if (yield) then
 
while (not(camera_script_is_finished())) do
 
thread_yield()
 
end
 
end
 
end


im sorry if this is a bother, i dont know if its cuz its such a niche question or if its really undoable, that no one seems to know, but just some direction would be helpful, if u know what i need to look at, or something.... i know u guys have big priorities, but this one i have to believe ACTUALLY HAS to be simple.... also, idol, really digging the fire & elec grenade effects, I didnt get to play with those til today, they give a nice little, not quite the raiden thing, but hey, it actually looks like my MC is just barely outrunning explosions & i was getting a kick out of electrecuting everyone i ran by.... sort of a "homebrewed saints flow cocktail....," good stuff. i like.


EDIT : put the coded parts of the post in code tags becuz then miraculously people will actually assist me for this apparently mind numbingly difficult quandry ;)

(lol just joking. should have known it was just Those tags i needed to use for that. but still seriously looking for an answer with this.... so i've been going thru so many things i dont understand knowing that im looking right at the answer.... for example, becuz my goal was to use the clip editor here although it would still be an accomplishment without, im looking in cinema_clip_editor.lua, im seeing 'functions' for callbacks to get the info i need, i just dont know how to "GET" that info to display. all i want to do is basically have the same camera zone saved or locked , with numbers, or a file, or whatever, the numbers are perfect, so here's a piece of misc code that may or may not be relevant. im sorry, im getting discouraged here & just want to get back to puttin the alt times in idols SB+, but im stuck on this....

Code:
function cinema_clip_editor_cb_prop_export_lock(click_button, dir)
    local direction = dir or 0
    click_button:toggle_dir(direction)
 
    local zone = cinema_clip_editor_zone_get_current()
    zone.export_lock =  CCE_dialogs[DLG_PROP].buttons[BTN_PROP_EXPORT_LOCK].button:get_option_index() - 1
    vint_dataresponder_post("camera_zone_dr", "set_export_lock", zone.UID, zone.export_lock)
    cinema_clip_editor_zone_update_visuals(zone)
 
    cinema_clip_editor_zone_update_all()


its just the "get current zone" part im interested in, & this probably isnt the best example of that function in the lua but i its the one i was pondering at as i make my way down the page, lol.... its referring to the export lock stuff here, but the thing is getting that info, somewhere, i would think there would just be a "display local position & orientation" type of thing, becuz thats ALL i need. but anyways, now its in code tags, sorry about that, lol.
 
Please please please use code tags, reading that is making my brain hurt :(
 
i actually thought about it as i was typing it that i felt pretty dumb becuz i wanted to & yet little things like that that are im sure so simple, i have no clue how to do. lol. i even felt squeaminsh pasting it cuz i thought about it like "this should be in that little code box, but i dont know how to do it." but its not that i was overlooking that, & i agree, it would make my brain hurt too. im sorry. but if i put it in a code box is it gonna make a difference & make ur head not hurt to where u'll actually HELP me with the problem? lol. (i was excited when i saw there was a reply, lol.)

i cant stress how something so seemingly simple is turning something that surely could be a click of a button into a 3 hour procedure of lining up ONE camera angle somewhere in the world, for only ONE image, of which i need dozens of, and even when trying manually after 3 hours i've never yet lined anything up 1:1. the numbers can give me 1:1.

then i can take my other created character, put him in that same spot, turn "virtual camera on" and do the 20 yr old back to the future part2 effect (4 michael j foxes at the dinner table in 2015) to put them both together on the screen. Thats ALL i want to do. not even a big deal. really i want to be able to know the values of my static shots in gibbed's clip editor. i opened the save files via text editor hoping for something but just got alien hieroglyphics. those numbers are in there, becuz i can load a saved clip to edit, and it puts me at the right angle. now i go take my other hero, take him to the same spot in the world, do a cool pose, or shoot a gangbanger, whatever, and enter the clip editor. i need that angle now. the same one that is LOCKED STORED & LOADABLE in the other clip. i just need to be able to put the camera at the same place. its so simple. its really discouraging me that i can't do this when the values are IN THAT FILE somewhere.

(EDIT) i put above in tags :)
 
why do i see people accomplish what seem to be amazing feats here with this game that have extended its replayability light years longer than volition could ever do, but something that looking at from outside the box (outside of the technical know-how of the experts here on this forum) that appears just logically speaking to be the simplest easiest question that one of the geniuses here could probably find or give the answer to in less time than it would take them to go to the bathroom, i cant humbly ask for those 5 minutes from any of the geniuses here....

if i'm wrong becuz i simply dont understand the difficulty, etc, then thats different, i guess its just becuz no one actually addresses my question even when im on the verge of begging.
if its just not doable & one of the experts here just said that, i guess i'd feel alot better. but with no acknowledgement i just feel stupid of like im asking a question thats too simple to warrant anyone's attention..... i.e. "haha, he doesnt know how to get the camera's position & orientation....lol. what a dumbass...." thats what i feel like, lol.

i dont want to annoy people & if i was wrong in assuming its anything simple then im sorry.
 
You're assuming that people aren't answering because they don't want to. This is a bad way to look at things. People aren't answering because they have no idea how to accomplish what you're asking for.

You need to get a grip and chill out.
 
well thats different then. its probably hard for u guys to understand where i'm coming from. i'm joe every-man, & as far as my perspective goes, i feel like u guys are the jedi council, & im joe, & im going to yoda for answers about something, becuz he's an expert on the force, & surely the jedi who can move things with their mind & are the galaxy's heroes must know how to open my mailbox when its jammed shut. if my perspective is off then that's my fault.

i appreciate that u said that actually, becuz i didnt know that it was something like that. my first thoughts when talking to folks that are admittedly much more knowledgeable than myself in this arena, is like the jedi example i used. the ONLY reason i assumed they would know how to accomplish what im asking for is becuz you guys are the freakin JEDI to me.

im not so insecure to think that if i asked tom every-man & he didnt respond that it must be becuz he doesnt want to . if tom every-man doesnt respond to joe every-man then its probably becuz he has no idea how to accomplish what joe's asking for.

i can now see from ur perspective sure its just that im asking something nobody knows. it crossed my mind once but again i came back to the fact that its nonsense to think u guys can lift an x-wing out of the swamp on dagobah with ur mind, but my mailbox thats jammed shut is a different beast.

lol, that sounded funny to say, i didn't mean that sarcastically if it read that way, im actually just trying to show why my assumptions start from where they did. thats all.
 
maybe as far as my analogy goes, the truth is that what i was asking for is something thats more complex than the mailbox thing. i just meant that was my original way of seeing it becuz i know if it was a jedi's mailbox, they'd have gotten it open. again for all i know maybe im wrong there.... i just keep reading things in files about camera scripts & "camera look through" and functions relating to the camera, but im clueless how to operate 'said' functions. the one thing said i could look thru navpoints as if thats a locked viewpoint, where can i find an example of an actual navpoint? just the name itself? and i look at ur main lua & the function for getting player position & see other functions in other files about "get screen position" or

Code:
screen_pos_x = screen_pos_x - (sin(rotation) * offset_distance)
    screen_pos_y = screen_pos_y + (cos(rotation) * offset_distance)

that, referencing it like its an object that can be queried. but i dont know the part about exactly what to replace "player position" with camera position or screen position but my frustration is that i know its THERE. and who else in the galaxy would i go to for this? im thinking, 'piece of cake, when i get to that part of my project i'll just find out what i need to do from someone on the forum, & then i can go from there.'

i speculate dumb things, like i've been playing computer games since the sierra adventure games like king's quest & space quest & police quest 20 yrs ago, but never bothered thinking about video or pictures. then i find myself working on a little project here, far a bunch of reasons, but not the least of which being my love for this game, & sometimes i see animations that volition did so well & are so cool motion capture & deserve to be appreciated up close & personal rather than ONLY on a ped 50 yards away doing something that could have had far less detail & still gotten its point across.... i wanna make my own cutscenes in the world of saints row, & show this living breathing world they created & enjoy it & be constructive & creative with something i like at the same time. thats what im trying to do. but i speculate dumb things now, as i've never even known other people ever do video from games, i never even heard the term "machinima" before, & im still not quite sure what it means. but i speculate to myself "maybe there's some inner politics about this stuff that i dont know about where its frowned on somehow to try to do cinematic clips of stuff by the mod experts & jedi...." lol. that sounds SO ridiculous as i say it, but i just dont know, lol. (no need to tell me how dumb that sounds.)
besides, i never expected to get an email back from volition one time when i told them how they should have people do their own "steelport stories" and submit them and would be a self promoting tool for their game, & it was just a thing in the suggestions thing, & i even got an email from them thanking me for noticing some of the more obscure stuff & giving me a blessing to create whatever i wanted & then send it to them to give them an idea of what i had in mind.... (i know as a business they were probably interested in the idea of it being a self promoting viral marketing tool, where no matter what, any user created content that became popular is only gonna fuel their sales & promote their product & so it was beneficial to everyone, who doesn't like free marketing?) but my point is that if the devs themselves were all about us creating any user created content that could highlight their game in new & unexpected ways, then i always thought back to that when wondering about if there was some distaste for that stuff by the guru's, cuz if the devs were happy about it themselves (& apparently intended on making a fully functional cinema clip editor) then its more dumb speculation, but my mind goes back to the childlike nonsense of the nintendo fanboys vs the sega fanboys & the sony fans vs. microsoft fans, & didn't know if there was some similar dumb politics at play about that.

wow, i actually feel good getting that off my chest, i think im always iffy about asking questions relating to the clip editor becuz i seem to be the only one here who was interested in it & that is probably what fueled my speculation.

sorry about the long rant post here. i'm a 33 yr-old gamer through & through, so if there really was something like that, then there's misconceptions all around.... but im also ADHD & is why im running at the mouth profusely here, & talk as fast as the shia kid from the transformers movies, so i'll shut up now. lol.
 
Back
Top