CLEO Help This Unsyc vehicle spawner points to the north?

CLEO related
Status
Not open for further replies.

Fred_Doe

Active member
Joined
Jul 21, 2016
Messages
159
Reaction score
1
Code:
:NONAME_26
0001: wait 0 
0248:   has_model_loaded 468 
004D: goto_if_false @NONAME_26 
04C4: get_offset_from_char_in_world_coords $PLAYER_ACTOR offset 0.0 0.0 -1.0 store_to 0@ 1@ 2@ 
00A5: create_car 468 at 0@ 1@ 2@ store_to 4@ 
036A: warp_char_into_car $PLAYER_ACTOR car 4@ 
0249: mark_model_as_no_longer_needed 468 
0002: goto @NONAME_2

How do i get it to spawn the vehicle the way camera is faced?
Instead of spawning it to the north
 

Fred_Doe

Active member
Joined
Jul 21, 2016
Messages
159
Reaction score
1
Yea i dont want it to point east or west either xD
I want it to spawn the way the camera is facing.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
http://ugbase.eu/Thread-SNIPPET-Get-Set-Camera-Rotation
or alternatively do something like: 0604: get_Z_angle_for_point (CamPosX - CharPosX) (CamPosY - CharPos Y) store_to CameraRotation


http://ugbase.eu/Thread-SNIPPET-get3DXYZInFrontOf
i'm not sure but there might be an opcode (from sampfuncs?) which gets the 3d position in front of something so you could use it instead
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
knowing camera angle you could reveal the coordinates in front of the camera,
the first snippet I posted allows you to get this angle,
the second snippet allows you to use this angle and camera position to check what position is in front of it at given distance


btw this could also be useful if modified (it would create coords in looking direction without explicitly incorporating vertical angle) http://ugbase.eu/Thread-SNIPPET-Get-aiming-positionaim
 

Fred_Doe

Active member
Joined
Jul 21, 2016
Messages
159
Reaction score
1
monday said:
knowing camera angle you could reveal the coordinates in front of the camera,
the first snippet I posted allows you to get this angle,
the second snippet allows you to use this angle and camera position to check what position is in front of it at given distance


btw this could also be useful if modified (it would create coords in looking direction without explicitly incorporating vertical angle) http://ugbase.eu/Thread-SNIPPET-Get-aiming-positionaim

Thanks! The last link you posted was exactly what i needed

Thread can be closed :)
 
Status
Not open for further replies.
Top