Guest Posted September 13, 2008 Share Posted September 13, 2008 Hi. I gotta a problem, when trying to set up a CDM map. When the CDM map loads, there is spawn screen, with camera looking at the spawn base. I have made my own spawns, but i have no idea, how to got the coordinates for camera view. Here is camera code what i need to fill with my position: <camera lookX="coordinates what i need goes here" lookY="coordinates what i need goes here" lookZ="coordinates what i need goes here" So how do i get these coordinates? Link to comment
Mr.Hankey Posted September 13, 2008 Share Posted September 13, 2008 when the map is loaded this should do the trick: function getPos () cams = getElementsByType ("camera") for k, v in ipairs (cams) do outputChatBox ("X: "..getElementData(v, "posX").." Y: "..getElementData (v, "posY").." Z: "..getElementData (v, "posZ")) end end addCommandHandler ("getCamPos", getPos()) Please note that this is untested so there might be typos in it Link to comment
Guest Posted September 14, 2008 Share Posted September 14, 2008 hmm, it outputs for me: X: 1817.2817382813 Y: -1888.9372558594 Z: 23.448707580566 X: 397.38107299805 Y: -1520.8565673828 Z: 53.859817504883 X: 2173.7333984375 Y: -1015.2341308594 Z: 73.123916625977 X: 634.07379150391 Y: -1889.27734375 Z: 1889.27734375 And if i change my camera look position, the numbers still are the same... Link to comment
Mr.Hankey Posted September 14, 2008 Share Posted September 14, 2008 i thought you just want to get the camera positions specified in the cmd_ls map file... that's what the code i posted is doing Link to comment
Guest Posted September 14, 2008 Share Posted September 14, 2008 Ahh, I want to create my own spawn positions, so i need set up camera for them, but i have no idea how to get camera cordinates. I need something like this http://mtabeta.com/index.html?p=resourc ... ils&id=124 but for camera not player positions Link to comment
Cizzo Posted October 26, 2009 Share Posted October 26, 2009 So i have same problem anyone have ideas? Link to comment
Dark Dragon Posted October 26, 2009 Share Posted October 26, 2009 a bit hacky but works add stealth's definitions in the editor, move the camera in the editor like you want it to be in th end, open the map settings -> gamemode settings -> stealth -> camera -> get current -> ok, then save as, choose name and find the new maps meta.xml, the camera position + look at will be in the settings Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now