Scri[ted player to Rotate Right and Left ( Low Level)

Topics regarding Scripting with Reality Factory
Post Reply
rgdyman
Posts: 84
Joined: Tue Jul 05, 2005 7:05 am

Scri[ted player to Rotate Right and Left ( Low Level)

Post by rgdyman »

Need someone to turn a light on for me please..

I have a scripted player.

He walks forward just fine.

I have a " Turn Right" command and he turns to the right just fine.

After pressing the key ,Now he's looking to the right.

But, He still walks the original direction. ( Now it's sideways) Follow me?

What do I nee to update to change his facing direction so he walks forward after turning to the right ?
I thought it wiuld be his YAW. didnt seem to work though.

Any ideas?

"All Lowlevel commands"

Thanks all,
rgdyman
shadow
Posts: 81
Joined: Mon Jul 25, 2005 5:37 am

Post by shadow »

How are you turning your pawn? What command are you using?

A command similar to this is usually used.

ai_face[ ()
{
   self.ideal_yaw = enemy_yaw;
   ChangeYaw(); // rotate to face enemy
} ]

So, take your self.current_yaw and add the necessary degrees (remember to convert to radians) to self.ideal_yaw.

turn_rt = self.current_yaw + (45/0.0174532925199433);

turn_right[ ()
{
   self.ideal_yaw = turn_rt;
   ChangeYaw();
} ]

Just make sure that while turning you don't keep updating turn_rt or your pawn will keep spinning in circles.
rgdyman
Posts: 84
Joined: Tue Jul 05, 2005 7:05 am

Post by rgdyman »

TY shadow.


Done.


Forgot radians.. :oops: // feeling stupid.
Post Reply