I figured using scripts on heartbeat would be a way of doing it, and have been able to knock a scrip together that does technically work but it's not perfect. If anyone could show me another way to do it, or a way to make the intervals between each statement more uniform, I would appreciate it! The way I've done it, because the characters heartbeats aren't synced up, they speak in the correct order but the timings are all wrong.
Btw I've only started learning today so please don't be too complex!!!
and thanks for any help!!
Edit: Okay so the code I copied and pasted is all messed up! using BBCode button seems to have fixed it, but now it's lost all indentation!!
#include "hench_i0_monsho"
#include "ginc_behavior"
void main()
{
object self = OBJECT_SELF;
object guard1 = GetObjectByTag("npc_castleguardspk1");
object guard2 = GetObjectByTag("npc_castleguardspk2");
object guard3 = GetObjectByTag("npc_castleguardspk3");
// already assigned counts
int g1count = GetLocalInt(guard1, "count");// this is 1, as he speaks first
int g2count = GetLocalInt(guard2, "count");// 0
int g3count = GetLocalInt(guard3, "count");// 0
if (self == guard1) { // if guard 1 is running the script
switch (g1count){
case 1:
SpeakString("I say the first line"); // say line 1 if count = 1
g2count = 1; // set guard2's count = 1, so he will say his first line
break;
case 2:
SpeakString("I respond to guard 3"); //say line 2
g3count = 2; // set guard3's count = 2, so he will say his next line
break;
case 3:
SpeakString("I respond to guard 2. This is the last line."); // say line 3, last line
break;
}
} else if (self == guard2) { // if guard 2 is running the script
switch (g2count){
case 1:
SpeakString("I respond to guard 1"); // say line 1 if count = 1
g3count = 1; // set guard3's count = 1, so he will say his first line
break;
case 2:
SpeakString("I respond to guard 3. This is my last line."); //say line 2
g1count = 3; // set guard1's count = 3, so he will say his next line
break;
default:
return;
}
}
else if (self == guard3) { // if guard 3 is running the script
switch (g3count){
case 1:
SpeakString("I respond to guard 2"); // say line 1 if count = 1
g1count = 2; // set guard1's count = 2, so he will say his second line
break;
case 2:
SpeakString("I respond to guard 1. This is my last line."); //say line 2
g2count = 2; // set guard2's count = 2, so he will say his next line
break;
default:
return;
}
}
SetLocalInt(guard1, "count", g1count); //updates the local variable for guard 1
SetLocalInt(guard2, "count", g2count); //updates the local variable for guard 2
SetLocalInt(guard3, "count", g3count); //updates the local variable for guard 3
SetLocalInt(self, "count", -1); //Sets own count to unusable value.
}
Modifié par JamieaaWroe11, 29 juillet 2010 - 10:46 .





Retour en haut






