CLEO SNIPPET Screen Camera Look at Position(Multi-Purpose)

ajom

Well-Known Member
Joined
Apr 14, 2020
Messages
158
Likes
75
Points
28
Location
Pluto
#1
This Snippet will instantly make your Camera Look on a specific 3D location. This Snippet actually has many uses like:
  • Make our Camera Follow/Lock-on a certain Actor by feeding this snippet with its Position.
  • Can be Used as an Aimbot, just feed this with a specified Camera XZ-Offsets for the Crosshair positions.
  • Can be used for Debugging purposes like "Offset Visualizer" Tool?

Code:
// 0AB1: @camatpos 5 _XYZ [email protected] [email protected] [email protected] _withCamOffsetAngleX [email protected] _andCamOffsetAngleZ [email protected]
:camatpos
    // ~~~~~~~~~~anti auto-vehicle cam movement
if and
    TIMERA>=400
    Actor.Driving($PLAYER_ACTOR)
then
    0A8C: write_memory 0xB70118 size 4 value 50.0 virtual_protect 0 // reset camera stabalizer timer, credit to Parazitas
    TIMERA = 0
end
    // ~~~~~~~~~~

068D: get_camera_position_to [email protected] [email protected] [email protected]

    // ~~~~~~~~~~Camera Z-Angle from our camera towards the target
0087: [email protected] = [email protected]  // y2
0063: [email protected] -= [email protected]  // y1
0087: [email protected] = [email protected]  // x2
0063: [email protected] -= [email protected]  // x1
0AA5: atan2 | 0x4207C0 2 2 | _X [email protected] _Y [email protected]
0AE9: pop_float [email protected] // store result from above operation
[email protected] += 3.1415926535897981710616733832795 // Camera Angle Leads 180 degrees respect to Z world coordinats
005B: [email protected] += [email protected]  // use the defined camz offset to move the camera leftwards or rightwards
    // ~~~~~~~~~~

    // ~~~~~~~~~~Camera X-Angle from our camera towards the target
0087: [email protected] = [email protected] // z2
0063: [email protected] -= [email protected]  // z1
0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] // adjacent side
0AA5: atan2 | 0x4207C0 2 2 | _X [email protected] _Y [email protected]
0AE9: pop_float [email protected] // store result from above operation
005B: [email protected] += [email protected]  // use the defined camx offset to move the camera downwards or upwards
    // ~~~~~~~~~~

0A25: set_camera_on_players_X_angle [email protected] Z_angle [email protected]
ret 0
Snippet Application Examples:

>>CamLock<<
Code:
00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]
0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 1000.0 find_next 1 pass_deads 1
00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
0AB1: @camatpos 5 _XYZ [email protected] [email protected] [email protected] _withCamOffsetAngleX 0.0 _andCamOffsetAngleZ 0.0

Code:
00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]
0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 1000.0 find_next 1 pass_deads 1
0889: store_actor [email protected] center_of_body_position_to [email protected] [email protected] [email protected]
   // configuration
[email protected] = 0.3
[email protected] = 0.3
   //
0AB1: @camatpos 5 _XYZ [email protected] [email protected] [email protected] _withCamOffsetAngleX [email protected] _andCamOffsetAngleZ [email protected]

Code:
00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]
0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 1000.0 find_next 1 pass_deads 1
0889: store_actor [email protected] center_of_body_position_to [email protected] [email protected] [email protected]

   // configuration
0470: [email protected] = actor $PLAYER_ACTOR current_weapon
if and
         [email protected] >= 22
         [email protected] <= 38
         [email protected] <> 34 // not sniper
         [email protected] <> 35 // not RPG
         [email protected] <> 36 // not Heatseeker
then // for weapons with crosshair offset angles like handguns,shotguns,sub-machinceguns,machineguns,cowboy rifle
          [email protected] = -4.5 // X-Angle offset of Non-Sniper Crosshair degrees
          [email protected] /= 57.295779817106167876798171061675 // to radians
     
          [email protected] = 2.5 // Z-Angle offset of Non-Sniper Crosshair degrees
          [email protected] /= 57.295779817106167876798171061675 // to radians
else // for no  offset weapons like grenade ,fist , sniper, RPG, Heatseeker, etc... weapons
          [email protected] = 0.0
          [email protected] = 0.0
end
   //

0AB1: @camatpos 5 _XYZ [email protected] [email protected] [email protected] _withCamOffsetAngleX [email protected] _andCamOffsetAngleZ [email protected]
 
Last edited:
Top