You'll need to be a bit more specific about the problems you're having.
Using Blitz3D's parent-child entity relationships should allow you to set up turrets effectively.
As far as limiting the degree of arc, just check to see if the entity has exceeded the maximum degree of arc and move it back to the maximum rotation allowed. You will possibly need to store the rotation value in variables, which are updated by the amount of rotation added or subtracted, as some of Blitz's functions to return the current rotation return fairly useless values.
Here's some code I use to set up a user entity with a camera parented to it, which is designed to work in a similar fashion to a turret.
This code allows the above entity to 'mouselook', with the pitch rotation of the camera limited to 180 degrees. (Note: Variables that start with 'the_' are locals.)
Using Blitz3D's parent-child entity relationships should allow you to set up turrets effectively.
As far as limiting the degree of arc, just check to see if the entity has exceeded the maximum degree of arc and move it back to the maximum rotation allowed. You will possibly need to store the rotation value in variables, which are updated by the amount of rotation added or subtracted, as some of Blitz's functions to return the current rotation return fairly useless values.
Here's some code I use to set up a user entity with a camera parented to it, which is designed to work in a similar fashion to a turret.
; -- Create user entity and user's camera. Global user = CreatePivot() Global user_camera = CreateCamera( user ) ;^^^^^^
This code allows the above entity to 'mouselook', with the pitch rotation of the camera limited to 180 degrees. (Note: Variables that start with 'the_' are locals.)
Function mouselook() If ( MouseX() > mouse_right_limit ) Or ( MouseX() < mouse_left_limit ) Or ( MouseY() > mouse_bottom_limit ) Or ( MouseY() < mouse_top_limit ) MoveMouse viewport_center_x, viewport_center_y current_mouse_x = viewport_center_x current_mouse_y = viewport_center_y EndIf the_new_mouse_x = MouseX () ;If the_new_mouse_x <> current_mouse_x ;do_update = True the_mouse_x_speed = the_new_mouse_x - current_mouse_x current_mouse_x = the_new_mouse_x ;EndIf the_new_mouse_y = MouseY () ;If the_new_mouse_y <> current_mouse_y ;do_update = True the_mouse_y_speed = the_new_mouse_y - current_mouse_y current_mouse_y = the_new_mouse_y ;EndIf mouse_x_speed_5# = mouse_x_speed_4# mouse_x_speed_4# = mouse_x_speed_3# mouse_x_speed_3# = mouse_x_speed_2# mouse_x_speed_2# = mouse_x_speed_1# mouse_x_speed_1# = the_mouse_x_speed mouse_y_speed_5# = mouse_y_speed_4# mouse_y_speed_4# = mouse_y_speed_3# mouse_y_speed_3# = mouse_y_speed_2# mouse_y_speed_2# = mouse_y_speed_1# mouse_y_speed_1# = the_mouse_y_speed If ( mouse_x_speed_1# > 0.1 ) Or ( mouse_y_speed_1# > 0.1 ) Then do_update = True the_yaw# = ( ( mouse_x_speed_1# + mouse_x_speed_2# + mouse_x_speed_3# + mouse_x_speed_4# + mouse_x_speed_5# ) / 5.0 ) * mouselook_x_inc# the_pitch# = ( ( mouse_y_speed_1# + mouse_y_speed_2# + mouse_y_speed_3# + mouse_y_speed_4# + mouse_y_speed_5# ) / 5.0 ) * mouselook_y_inc# TurnEntity user, 0.0, -the_yaw#, 0.0 user_camera_pitch# = user_camera_pitch# + the_pitch# If user_camera_pitch# > 90.0 Then user_camera_pitch# = 90.0 If user_camera_pitch# < -90.0 Then user_camera_pitch# = -90.0 RotateEntity user_camera, user_camera_pitch#, 0.0, 0.0 End Function