low level move command
-
- Posts: 7
- Joined: Thu Nov 23, 2006 9:46 pm
low level move command
I am sure there is a low level command for movement like MoveLeft and MoveRight but these are for high level command but i dont know any. does anyone know those commands?
from the RF manual:
Those two should do the trick. Keep in mind that you still have to apply an animation with Animate() and a sound file with PlaySound() if you want these.ForceRight(float Amount );
Apply an force to the right of Amount to the Pawn's actor.
ForceLeft(float Amount );
Apply an force to the left of Amount to the Pawn's actor.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
-
- Posts: 7
- Joined: Thu Nov 23, 2006 9:46 pm
i have though of that but wouldn't it make it go too fast and is there a time command for HighLevel like LowLevel commands. for example:
LowLevel
if (time>0.1)
{
FireProjectile(...);
}
But i know there is a timer for highlevel commands. What i want to do is use the timer for shooting as if you would do it with that piece of code for a lowlevel section.
LowLevel
if (time>0.1)
{
FireProjectile(...);
}
But i know there is a timer for highlevel commands. What i want to do is use the timer for shooting as if you would do it with that piece of code for a lowlevel section.
Timing is very simple - when you know how.
You have a global variable (self.time) that contains the number of seconds that have passed since you went into LowLevel.
if you want to time something you first have to save the last time you have done this and then compare it with the current time.
Because this sounds a bit complicated at first, here is some code to demonstrate that:
at the beginning of the script (before any order, but still after the first '{') we declare some variables that we are going to use later in the script:
and then in the script itself:
About the Force Commands i think you have to try since they are not that well documented and i haven't used them much.
You have a global variable (self.time) that contains the number of seconds that have passed since you went into LowLevel.
if you want to time something you first have to save the last time you have done this and then compare it with the current time.
Because this sounds a bit complicated at first, here is some code to demonstrate that:
at the beginning of the script (before any order, but still after the first '{') we declare some variables that we are going to use later in the script:
Code: Select all
LAST_FIREPROJECTILE [0] //contains the last time-value when
// a projectile was fired
TIME_PROJECTILE_FIRE [1] //every 1 second a projectile is fired
...
Code: Select all
if (self.time > LAST_FIREPROJECTILE+TIME_PROJECTILE_FIRE)
{
FireProjectile(...);
LAST_FIREPROJECTILE=self.time; //remember the current time.
}
About the Force Commands i think you have to try since they are not that well documented and i haven't used them much.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
-
- Posts: 7
- Joined: Thu Nov 23, 2006 9:46 pm
No, it wouldn't. It's the time that has passed since the script last went to low level, so it simply doesn't work in high level.
You could also move the pawn to any direction with the walkmove() command. Along with flymove, it's absolutely the best way to move pawns around.
To move left, you would need to put it like this:
walkmove(self.current_yaw + 1.57,MOVESPEED);
and to right:
walkmove(self.current_yaw - 1.57,MOVESPEED);
You could also move the pawn to any direction with the walkmove() command. Along with flymove, it's absolutely the best way to move pawns around.
To move left, you would need to put it like this:
walkmove(self.current_yaw + 1.57,MOVESPEED);
and to right:
walkmove(self.current_yaw - 1.57,MOVESPEED);
Pain is only psychological.
-
- Posts: 7
- Joined: Thu Nov 23, 2006 9:46 pm
It will move to direction 'self.current_yaw + 1.57' (in radians), which means that the pawn's yaw isn't affected in any way. So yes, it will strafe to the left.
Last edited by Juutis on Sat Jan 20, 2007 3:28 pm, edited 1 time in total.
Pain is only psychological.
Just to make this more clear, MOVESPEED in Juutis' example is a variable you set for the speed you want the pawn to move at, not a command, which must be declared at the top of your script. For example...
MOVESPEED [0]
and it could really be called anything you want...
CRUNCHBERRY [0]
followed by
walkmove(self.current_yaw + 1.57,CRUNCHBERRY);
later in the script would do the same thing.
Also, I always found it easier to convert degrees to radians, for example if I want a pawn to move left, I'd have a variable called DIRECTION and would use...
DIRECTION = ConvertDegrees(90); // 90 degrees, 270 would move right
CRUNCHBERRY = 100; // how fast to move, higher number = faster
walkmove(self.current_yaw + DIRECTION,CRUNCHBERRY);
Anyway, I was just reading through some posts... hello to everyone!
[Edit QuestOfDreams: Corrected variable name]
MOVESPEED [0]
and it could really be called anything you want...
CRUNCHBERRY [0]
followed by
walkmove(self.current_yaw + 1.57,CRUNCHBERRY);
later in the script would do the same thing.
Also, I always found it easier to convert degrees to radians, for example if I want a pawn to move left, I'd have a variable called DIRECTION and would use...
DIRECTION = ConvertDegrees(90); // 90 degrees, 270 would move right
CRUNCHBERRY = 100; // how fast to move, higher number = faster
walkmove(self.current_yaw + DIRECTION,CRUNCHBERRY);
Anyway, I was just reading through some posts... hello to everyone!
[Edit QuestOfDreams: Corrected variable name]