Page 1 of 1

RoatateMoveToPoint

Posted: Sat Feb 28, 2009 5:29 pm
by metal_head
I started a small script for a one of the characters in the game. I want the character to say "Oh Jake, I was almost going to shoot you!" while playing a talking animation, than say "The commander needs you in the control room, come with me" then play an animation that is some sort of waving to show the Player the way. Then move to an elevator switch, play a pressing animation and trigger a trigger that opens the doors. There's a trigger model in the elevator and the script will check if that trigger is pressed, if yes, close the doors of the elevator. OK, so I almost know how to do this, but I got some problems with the RotateMoveToPoint command.

Code: Select all

{

Spawn[ ()
{
Console(true);
NewOrder("Start");
} ]

Start[ ()
{
PlayerDistOrder(120, "StartTalking");
} ]

StartTalking[ ()
{
Delay("talk1", 3, "grunt1.wav");
Delay("talk2_wave", 2.5, "grunt2.wav");
NewOrder("Move");
} ] 

Move[ ()
{
NextPoint();
RotateMoveToPoint("run", 200, 120, true, "");
NewOrder("Start");
} ]
}code]
When the time for the "Move" order to be executed comes, the gme crashes and shows some sort of an "[ERROR]" message about this pawn..it's something about the parameters, what have I done wrong again?


EDIT:
Yes, I know that at this point the script will execute the "Start" order again when the pawn's reached the script point :D

Re: RoatateMoveToPoint

Posted: Sat Feb 28, 2009 7:12 pm
by Juutis
Move() is a high level script command and you have an order called 'Move'. What happens is RF thinks you're calling the scripting command when you're actually trying to go to the 'Move' order, and naturally nothing good can come out of that. Rename the order and it should be fine.

On another note, RotateMoveToPoint() only rotates the pawn to face the point while moving forward. It doesn't actually move the pawn to the point. So you gotta add a MoveToPoint() command there too.

***EDIT***
Oh, and for your future endeavors: Paste any errors you get to your post. Saying "it's something about the parameters" isn't really helpful, whereas the full error "[ERROR] Incorrect # of parameters in command 'Move' in Script 'Pawn1' Order 'Move'" would've helped a lot. Now I had to test the script myself. :idea:

Re: RoatateMoveToPoint

Posted: Sat Feb 28, 2009 8:50 pm
by metal_head
Saying "it's something about the parameters" isn't really helpful, whereas the full error "[ERROR] Incorrect # of parameters in command 'Move' in Script 'Pawn1' Order 'Move'" would've helped a lot. Now I had to test the script myself.
Oh sorry, I didn't realize it's so important :oops:

Now the script works, thanks!