Hey all.
This is my first attempt at scripted player stuff. So Please excuse my ignorance.
This may not even work
What Im doing is trying to shoot at a enemy pawn wether the enemy is in front of, higher than or lower than the plawer pawn.
So far I have the pawn realizing who is the new enemy pawn when the cursor is over the new enemy pawn.
Now I need to update the OFF_Set_Y in the SetTargetPoint( );
Or to simplify this ordeal.... I would like the bullet to aim at my mouse cursor. and fire in that direction.
Any Ideas how to do this?
Heres what I have thus far......( updated the new enemy not included )
SHOOT[()
{
AnimationSpeed(SHOOTSPEED);
MatchPlayerAngles();
UpdateTarget();
????? HERE I think------> SetTargetPoint(0,NEED THE UPDATED Y ,360);
if(self.animate_at_end)
{
FireProjectile("Shot","BIP01 R HAND",0,0,0,"PHealth");
PlaySound("deagle.wav");
if(self.lbutton_pressed=false)
{
ANM=StringCopy("Idle");
Animate(ANM);
think="Stand_Idle";
}
}
}]
I may be going about this all wrong in the first place.. if so.... any suggestions on the proper way to tackle this
sorry i forgot... im in 3rd person view
SetTargetPoint () Update the Y offset
Re: SetTargetPoint () Update the Y offset
There's a variable called self.camera_pitch that tells the pitch of the camera.
So it's pretty simple to calculate the correct offsets with trigonometry:
So it's pretty simple to calculate the correct offsets with trigonometry:
Code: Select all
SetTargetPoint(0,360*sin(self.camera_pitch),360*cos(self.camera_pitch));
Pain is only psychological.
Re: SetTargetPoint () Update the Y offset
There. Thank you Juutis.
I tried the camera_pitch w/out the trig... obviously my route didnt work...
[SetTargetPoint(0,360*sin(-self.camera_pitch)+50,360*cos(self.camera_pitch));]
( side " dumb" question ..... * this means what? )
Just had to make the Y= a Neg number and add 50 to hit my crosshair..
Thanks again
rgdy
I tried the camera_pitch w/out the trig... obviously my route didnt work...
[SetTargetPoint(0,360*sin(-self.camera_pitch)+50,360*cos(self.camera_pitch));]
( side " dumb" question ..... * this means what? )
Just had to make the Y= a Neg number and add 50 to hit my crosshair..
Thanks again
rgdy
Re: SetTargetPoint () Update the Y offset
That's the multiplication sign.rgdyman wrote:( side " dumb" question ..... * this means what? )
Pain is only psychological.
Re: SetTargetPoint () Update the Y offset
I thought so.. was afraid I was way off base.. Eithere way "Looken stupid"
Impressive
Impressive