Jump to content

Weapon coords / CJ facing where camera is facing


Recommended Posts

1. Does anyone know how to know the coordinates of a drawn weapon in San Andreas? A friend of mine is making a lightsaber mod and I wanna attach a "white rod" object for the middle part of the lightsaber blade.

 

2. (I asked this question before; just hoping this time I can get an answer) How can I make CJ's head turn and face where the camera is facing, like in this part of this video and in the game Dragon Age: Origins?

http://img519.imageshack.us/img519/8100/cameralook.png

Link to comment
https://gtaforums.com/topic/441963-weapon-coords-cj-facing-where-camera-is-facing/
Share on other sites

@2: Yeah I get it.

 

Been trying to achieve that myself;

 

You see, the camera.position is set somewhere behind the player; and the camera.pointat is JUST a little bit more close to the player, but still, NOT in front of him - and that's sort of a problem, as you can't use sines/cosines for that, since you obiousvly have no angle.

 

 

 

1. Does anyone know how to know the coordinates of a drawn weapon in San Andreas? A friend of mine is making a lightsaber mod and I wanna attach a "white rod" object for the middle part of the lightsaber blade.

 

2. (I asked this question before; just hoping this time I can get an answer) How can I make CJ's head turn and face where the camera is facing, like in this part of this video and in the game Dragon Age: Origins?

http://img519.imageshack.us/img519/8100/cameralook.png

1. the only chance i see is to give the actor an object in the hand

it makes the original weapon unvisible but the damage function and sound work

I made a cleo mod for Function-X- which shows muzzle flash by c*ntgun and shotgun

and smoke by chainsaw

look here

 

2.

06A9: AS_actor $PLAYER_ACTOR look_at_point don't work for fast execution

needs to give wait of a second

 

{$CLEO .cs}:Camerapoint03A4: name_thread 'CAMPNT':Camerapoint_1wait 1250if0256:   player $PLAYER_CHAR definedjf @Camerapoint_104C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset  0.0  0.0 0.0068D: get_camera_position_to 7@ 8@ 9@ 0087: 5@ = 7@  // floating-point values only0087: 6@ = 8@  // floating-point values only0063: 5@ -= 1@  // floating-point values0063: 6@ -= 2@  // floating-point values0013: 5@ *=  -2.0  // floating-point values0013: 6@ *=  -2.0  // floating-point values005B: 7@ += 5@  // floating-point values 005B: 8@ += 6@  // floating-point values06A9: AS_actor $PLAYER_ACTOR look_at_point 7@ 8@ 3@ 1250 msjump @Camerapoint_1

 

 

look_at_object reacts faster

try it yourself, remove the commentsslashes and make slashes infront of the other opcodes

 

//06A9: AS_actor $PLAYER_ACTOR look_at_point 7@ 8@ 3@ 250 ms//06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 7@ 8@ 3@ 0655: AS_actor $PLAYER_ACTOR look_at_object 31@ 1000 ms

 

 

{$CLEO .cs}:Camerapoint03A4: name_thread 'CAMPNT'31@ = Object.Init(1240, 0.0, 100.0, 950.0):Camerapoint_1wait 250if0256:   player $PLAYER_CHAR definedjf @Camerapoint_104C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset  0.0  0.0 0.0068D: get_camera_position_to 7@ 8@ 9@ 0087: 5@ = 7@  // floating-point values only0087: 6@ = 8@  // floating-point values only0063: 5@ -= 1@  // floating-point values0063: 6@ -= 2@  // floating-point values0013: 5@ *=  -2.0  // floating-point values0013: 6@ *=  -2.0  // floating-point values005B: 7@ += 5@  // floating-point values 005B: 8@ += 6@  // floating-point values//06A9: AS_actor $PLAYER_ACTOR look_at_point 7@ 8@ 3@ 250 msObject.PutAt(31@, 7@, 8@, 3@) //06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 7@ 8@ 3@ 0655: AS_actor $PLAYER_ACTOR look_at_object 31@ 1000 msjump @Camerapoint_1

 

Edited by ZAZ
KyanoAng3l0

1: I see. Well, anyway, my friend already have the "white rod" now. Looks awesome. All it just needs is a little glowing effect (create_flash_light) and some lightsaber sounds.

 

2: Kinda looks similar to the code I tried making. The one of the differences is that your 5@ = 7@ code works, while I get an error message on mine whenever I put something like that in. Should've known I needed the complete opcode (with "0087:"). :|

 

Well, thanks once again, ZAZ. You guys can close this thread now.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.