Sorry for the late answer, back at work today.
You musn't call your own script by ExecuteScript, you are creating a loop, that explain why lines are displayed again and again. You must call the NWN2 default script instead.
To do what you want you need also a counter to display line 0 during the first heartbeat then line 1 during the second heartbeat and so on. Use a local integer variable attached to the NPC. Let's call it "Counter". Although not mandatory because 0 is default value, it's a good habit to set the variable in the NPC properties. When the counter reaches 3, reset it to 0.
The script should look now :
// your comment
void main()
{
object oNPC = OBJECT_SELF;
int c = GetLocalInt(oNPC, "Counter"); // read the counter
switch© // display the corresponding line
{
case 0 : s = "We are the rightous ones.."; break;
case 1 : s = "..in his eyes."; break;
case 2 : s = "And let us smite these monsters.."; break;
case 3 : s = "..unto their deaths"; break;
}
c++; // increment counter
if (c > 3) c = 0; // loop back when all lines exhausted
SetLocalInt(oNPC, "Counter", c); // store the counter
ExecuteScript("nw_c2_default1", oNPC); // execute NWN2 default script
}
Modifié par Claudius33, 02 septembre 2013 - 06:38 .