I am adapting from scripting with NWN and Kotor, so there are a few new things I need to learn. For instance, advanced waypoint scripting. Right now I am trying to make the castle I am building a little bit more alive, so I want NPC's doing various tasks throughout the castle. I know the basics of scripting waypoings, but where I need help is delaying items in the queue or, at least finidng a way to script on_waypoint_reached events.
The particular situation I am trying to simulate with my script is having an NPC walk a path in my library and stop at certain points and play animations such as "read" or "ponder". Now I cant simply just put an AddCommand all the way down for this, because they all fire at the same time. Is there a way that I can fire a command only after the previous command has been fired?
Here is my script at the moment:
void main()
{
object oPerson = GetObjectByTag("dgman");
object oWay1 = GetObjectByTag("per_way_1");
object oWay2 = GetObjectByTag("per_way_2");
object oWay3 = GetObjectByTag("per_way_3");
object oWay4 = GetObjectByTag("per_way_4");
object oWay5 = GetObjectByTag("per_way_5");
object oWay6 = GetObjectByTag("per_way_6");
object oWay7 = GetObjectByTag("per_way_7");
object oWay8 = GetObjectByTag("per_way_8");
location lPoint1 = GetLocation(oWay1);
location lPoint2 = GetLocation(oWay2);
location lPoint3 = GetLocation(oWay3);
location lPoint4 = GetLocation(oWay4);
location lPoint5 = GetLocation(oWay5);
location lPoint6 = GetLocation(oWay6);
location lPoint7 = GetLocation(oWay7);
location lPoint8 = GetLocation(oWay8);
float fPoint1 = GetFacing(oWay1);
AddCommand (oPerson, CommandMoveToLocation (lPoint1, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint2, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint3, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint4, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint5, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint6, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint7, FALSE, FALSE));
AddCommand (oPerson, CommandMoveToLocation (lPoint8, FALSE, FALSE));
}
Modifié par Doc Valentine, 18 janvier 2010 - 08:54 .





Retour en haut






