Control Issues
Now back to the topic at hand, lets talk scripting.
with solving your problem with the rotation you could set self.yaw_speed to an really high number like 99999999
self.yaw_speed=99999999;
this way the yaw will be changed instantly.
and then specify the direction the pawn should be facing with self.ideal_yaw (it's in radians, you have to use the ConvertDegrees() command if you want to use degrees), like:
self.ideal_yaw=ConvertDegrees(180);
self.ideal_yaw=ConvertDegrees(90);
finally you have to change the yaw of the pawn:
ChangeYaw();
about the animation problem, it's quite complicated you might look at the sample scripts that came with rf and look how they solved it in genericplayer.s...
hope that helps
self.yaw_speed=99999999;
this way the yaw will be changed instantly.
and then specify the direction the pawn should be facing with self.ideal_yaw (it's in radians, you have to use the ConvertDegrees() command if you want to use degrees), like:
self.ideal_yaw=ConvertDegrees(180);
self.ideal_yaw=ConvertDegrees(90);
finally you have to change the yaw of the pawn:
ChangeYaw();
about the animation problem, it's quite complicated you might look at the sample scripts that came with rf and look how they solved it in genericplayer.s...
hope that helps
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
Cool that worked quite well! Thank you very much! 
Edit: Alright here's what I have so far:
The pawn only moves in 4 directions as of right now, but I'm attempting to script it into 8 I'll post that when I finish!
Thanks to everyone who's helped with this so far!
Edit: Alright here's what I have so far:
Code: Select all
{
WALK [Walk] // define the walking animation in a variable
IDLE [Idle] // define the walking animation in a variable
MOVESPEED [100] // define the speed of this Pawn in a variable
Spawn[ ()
{
Console(true); //enable console for debugging
LowLevel("setup"); // Go to low level
} ]
setup[ ()
{
self.ThinkTime = 0.1;
PlayerRender(false); // Don't render the built-in player
AttachCamera(); // attach the camera to this entity
self.yaw_speed = 99999999; // Rotate VERY fast
AnimateHold(IDLE);
self.think = "loop"; // Start executing order called "loop"
} ]
loop[ ()
{
self.ThinkTime = 0; // execute this order every frame
if(IsKeyDown(15)) // Check if key number 15 is pressed
{
self.ideal_yaw=ConvertDegrees(0);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move forward
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
if(IsKeyDown(27)) // Check if key number 27 is pressed
{
self.ideal_yaw=ConvertDegrees(180);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move down
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
if(IsKeyDown(26)) // Check if key number 26 is pressed
{
self.ideal_yaw=ConvertDegrees(270);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move left
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
if(IsKeyDown(28)) // Check if key number 28 is pressed
{
self.ideal_yaw=ConvertDegrees(90);
ChangeYaw();
walkmove(self.current_yaw,MOVESPEED); // move right
if(self.animate_at_end) // check if the current animation is finished before starting a new one
{
AnimateHold(WALK); // play the walking animation
}
}
else // if the key is not pressed...
{
if(self.animate_at_end) // play idle animation, if it is at end
{
AnimateHold(IDLE);
}
}
} ]
}Thanks to everyone who's helped with this so far!