It is possible to do such a thing, it's quite easy too.
A total noob, eh? Well... I'll try to explain the basics as well as I can.
You should read the Pawn Scripting section of the Online Help. Andy's basic pawn tutorial should help too (
http://www.freewebs.com/andycr/pawns.htm). Scripts are made of orders which contain all the commands that control pawns. All the commands are listed in the Online Help.
Ok, so let's start building that script. It always starts with a "{" and ends with a "}". Let's add our first order. The basic order layout is in the Online Manual.
Let's call the first order "Spawn". We get something like this:
{
Spawn[ ()
{
} ]
}
Now the pawn won't do anything, because he doesn't have any commands. So let's add our first command. MoveForward-command sounds useful here. Every line ends with a ";".
{
Spawn[ ()
{
MoveForward("WALK",10,500,"WALKSOUND");
} ]
}
You need to change WALK to your moving animation and WALKSOUND to the sound you want to be played while the pawn is moving(If you don't want any sound to be played, use just ""). 10 indicates the speed at which he is walking and 500 indicates how far away he is going to walk. You can change all of these if you want.
Next thing: the idle animation. There's a command called LoopAnimation, which allows us to make the pawn run his idle animation for a certain amount of time and then continue to next commands.
{
Spawn[ ()
{
MoveForward("WALK",10,500,"WALKSOUND");
LoopAnimation("IDLE",10,"IDLESOUND");
} ]
}
Again you have to change IDLE to whatever your idle animation is called and IDLESOUND to the sound you want to be played.
Now it's time for that crazy running. We'll have to make another order for that. The NewOrder - command allows us to jump between orders. Again, all of these commands are from the Online Help.
{
Spawn[ ()
{
MoveForward("WALK",10,500,"WALKSOUND");
LoopAnimation("IDLE",10,"IDLESOUND");
NewOrder("Run");
} ]
Run[ ()
{
Rotate("ROTATEANIMATION",360,0,random(-180,180),0,"ROTATESOUND"); // random rotation
MoveForward("WALK",10,500,"WALKSOUND"); //run like hell!
RestartOrder(); //turn and run again
} ]
}
Ok, I added the Run-order. First thing to do in that order is to turn around randomly. Once again, change ROTATEANIMATION and ROTATESOUND. 360 is the speed at which the pawn turns around, you may change it. The part "0,random(-180,180),0" indicates the rotating angles, X, Y, Z. We want him to rotate around the Y-axis randomly so we set X and Z to 0 and use the random() -command in Y (yes, you can use commands inside commands). Random(-180,180) returns a value somewhere between -180 and 180 so the pawn can turn to any direction.
Then the pawn runs forward for a while like before. After that comes a command called RestartOrder(). The name pretty much explains it, it restarts the order so the pawn will turn randomly again and run to the new direction.
Oh, and by the way. Symbols "//" make the rest of the line comment. That means that the engine will ignore them.
I really hope this helps even a tiny bit. If you have any troubles understanding what I mean, feel free to ask.
Aaaaaaand, I didn't test the script. It may work or it may not work.
![Very Happy :D](./images/smilies/icon_biggrin.gif)