EvilRaptor Posted January 23, 2010 Share Posted January 23, 2010 (edited) Is there any way for me to get a camera to move around, whilst locking on to a certain object, e.g. a vehicle/actor? As far as I can tell, the only opcode I might be able to use would be 0679: put_camera_on_car [email protected] with_offset 0.0 -2.0 $Z_CAMERA rotation 0.0 0.0 [email protected] 0.0 2 but I'm under the assumption that rotation would be the camera angle, i.e. where it's pointing. Edit: excuse the handles, I got the line from the opcodes search in Sanny lol Edited January 23, 2010 by EvilRaptor Link to comment Share on other sites More sharing options...
Michael_J_Scofield Posted January 24, 2010 Share Posted January 24, 2010 Is there any way for me to get a camera to move around, whilst locking on to a certain object, e.g. a vehicle/actor? As far as I can tell, the only opcode I might be able to use would be 0679: put_camera_on_car [email protected] with_offset 0.0 -2.0 $Z_CAMERA rotation 0.0 0.0 [email protected] 0.0 2 but I'm under the assumption that rotation would be the camera angle, i.e. where it's pointing. Edit: excuse the handles, I got the line from the opcodes search in Sanny lol I think you can use Camhack for it, or San An Studios, i would prefer Camhack Link to comment Share on other sites More sharing options...
EvilRaptor Posted January 24, 2010 Author Share Posted January 24, 2010 Nyuh, it's not like, for a "hmm, I'm gonna have a look around" moment, alas, if only it were that easy... It's for a script, like, I want the camera to lock onto a car that spawns, and rotate around the car, sorta like, if you move the mouse around while in a car... 'cept the camera's locked onto a different car... the player's on foot, and the script spawns the car infront of the player, and I want the camera to circle the car... Link to comment Share on other sites More sharing options...
ZAZ Posted January 24, 2010 Share Posted January 24, 2010 Nyuh, it's not like, for a "hmm, I'm gonna have a look around" moment, alas, if only it were that easy...It's for a script, like, I want the camera to lock onto a car that spawns, and rotate around the car, sorta like, if you move the mouse around while in a car... 'cept the camera's locked onto a different car... the player's on foot, and the script spawns the car infront of the player, and I want the camera to circle the car... There exist several opcodes for camera settings. Every kind makes impossible to move the cam with mouse like with default camera behavior but you can use mouse input opcode to calculate camera settings put the camera on vehicle 00A5: [email protected] = create_car #INFERNUS at 2487.5 -1660.5 13.350679: put_camera_on_car [email protected] with_offset 0.0 -5.0 1.5 rotation 0.0 0.0 0.0 0.0 2//view trunk0679: put_camera_on_car [email protected] with_offset 0.0 -5.0 1.5 <--xyz position relativ to carxyz point to view relativ to car-->> 0.0 0.0 0.0 rotation -->> 0.0 2 <--mode the equivalent for the actor is opcode 067C: 067C: $PLAYER_ACTOR 0.0 3.0 0.7 0.0 0.5 0.5 0.0 2 If you put the cam to player the player-walk-movement will be buggy In connection with opcode 015F: you can set the camera view to follow an actor automaticly 015F: set_camera_position -2248.2187 -79.441 37.7686 rotation 0.0 0.0 0.00159: camera_on_ped [email protected] 15 2 very useful: put camera with_offset on vehicle and cam follows autom. an actor 067B: put_camera_on_car [email protected] with_offset -7.5 15.5 7.5 point_to_actor [email protected] tilt 6.0 2 the standart camera opcodes can also be used to do a lot of things 015F: set_camera_position -2257.533 -56.77364 54.17 rotation 0.0 0.0 0.0 0160: set_camera_point_at -2250.72 -77.55 35.1 mode 2 depending to your scripting skills to do cuning calculations for variable camera parameter 0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 0.0 1.5015F: set_camera_position [email protected] [email protected] [email protected] rotation 0.0 0.0 0.0 Exemple: The script below let the camera turn around the player and move up-down in a sine curve {$CLEO .cs}:KurveCam_B_103A4: name_thread 'FCAM':KurveCam_B_20001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @KurveCam_B_200D6: if 00AB0: key_pressed 8//////////<<<<<<-------------Backspace004D: jump_if_false @KurveCam_B_20007: [email protected] = 0.0 // floating-point values 0007: [email protected] = 0.5 // floating-point values 0002: jump @KurveCam_B_11:KurveCam_B_30001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @KurveCam_B_3 00D6: if 080E1: NOT key_pressed 0 15//////<<<<<<-----------Enter/Exit-Taste--to cancel cam drive004D: jump_if_false @KurveCam_B_25000B: [email protected] += 2.5 // floating-point values:KurveCam_B_110007: [email protected] = 9.0 // floating-point values//<<<<<<-----input for radius of camera drive/set_camera_position 02F6: [email protected] = cosine [email protected] // sinus swapped with cosine02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 006B: [email protected] *= [email protected] // floating-point values006B: [email protected] *= [email protected] // floating-point values0007: [email protected] = 3.5 // floating-point values//<<<<<<-----input for radius of up-down-curve/set_camera_position 02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 006B: [email protected] *= [email protected] // floating-point values000B: [email protected] += 2.5 // floating-point values0007: [email protected] = 1.5 // floating-point values//<<<<<<-----input for radius of camera target/point_camera 02F6: [email protected] = cosine [email protected] // sinus swapped with cosine02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 006B: [email protected] *= [email protected] // floating-point values006B: [email protected] *= [email protected] // floating-point values:KurveCam_B_1304C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset [email protected] [email protected] [email protected] 04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset [email protected] [email protected] [email protected]: set_camera_position [email protected] [email protected] [email protected] 0.0 0.0 0.00160: point_camera [email protected] [email protected] [email protected] 20002: jump @KurveCam_B_3:KurveCam_B_250001: wait 250 ms0373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut0002: jump @KurveCam_B_2 Carrec paths for driving vehicles are useful to make ingame vids what is carrec path? read here how to set camera to vehicle which drive on carrec path? read here CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
2pacproducer2 Posted January 25, 2010 Share Posted January 25, 2010 Much information, good as always, ZAZ Link to comment Share on other sites More sharing options...
Deji Posted January 25, 2010 Share Posted January 25, 2010 Mmm... I believe he wants the camera to circle automatically? 0007: [email protected] = 0.0 // Starting rotation.:LOOPwait 0if 0449: actor $PLAYER_ACTOR in_a_carelse_jump @LOOP01B4: set_player $PLAYER_CHAR can_move 003C0: [email protected] = actor $PLAYER_ACTOR car000B: [email protected] += 3.0 // Movement multiplier. Increase for more camera speed. Decrease for less speed.02F7: [email protected] = sine [email protected]: [email protected] = cosine [email protected]: [email protected] *= 10.0 // Increase to make the X Pos of the camera further away from the car.0013: [email protected] *= 10.0 // Increase to make the Y Pos of the camera further away from the car.0679: put_camera_on_car [email protected] with_offset [email protected] [email protected] 2.0 rotation 0.0 0.0 0.0 0.0 2jump @LOOP Convenient time to ask this question as I was just working on a sine/cosine tutorial for something like this but didn't really know a simple way to demonstrate it. Link to comment Share on other sites More sharing options...
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