Have you numbered the speechlines? I think either AGS itself or speech center provides a functionality to automatically number the speech lines.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuMatrix* m = Matrix.CreateFromString("{{4,8},{2,3}}");
String[] Split(this String*, String token) {
String ret[];
int reti = 0;
if (token.Length == 0 || token.Length > this.Length)
{
ret = new String[2];
ret[reti] = this;
reti ++;
}
else
{
ret = new String[this.Length + 1];
int offset = 0;
for (int i = 0; i < this.Length; i ++)
{
if (this.Substring(i, token.Length) == token)
{
if (i - offset != 0) // don't use 0 length slices
{
ret[reti] = this.Substring(offset, i - offset);
reti ++;
}
offset = i + token.Length;
i = offset - 1;
}
}
if (this.Length - offset != 0) // don't use 0 length remainder
{
ret[reti] = this.Substring(offset, this.Length - offset);
reti ++;
}
}
ret[reti] = null;
return ret;
}
int CountToken(this String*, String token){
String sub = this.Copy();
int count = 0;
while(sub.Length > 0){
if(sub.IndexOf(token)==-1){
return count;
}
sub = sub.Substring(sub.IndexOf(token)+token.Length, sub.Length);
count++;
}
return count;
}
String[] Split(this String*, String token){
int count = this.CountToken(token);
if(count<=0){
String r[] = new String[1];
r[0] = null;
return r;
}
String r[] = new String[count+2];
String sub = this.Copy();
int i = 0;
int cur = 0;
while(i < count){
cur = sub.IndexOf(token);
if(cur==-1) cur=sub.Length;
r[i] = sub.Substring(0, cur);
sub = sub.Substring(sub.IndexOf(token)+token.Length, sub.Length);
i++;
}
r[i] = sub.Substring(0, sub.Length);
i++;
r[i] = null;
return r;
}
// room script file
function room_AfterFadeIn() {
String mstr = "1, 232, 9, 55, 744";
String b[] = mstr.Split(", ");
int i=0;
while(b[i]!=null){
Display("%s[[%s", mstr, b[i]);
i++;
}
Display("the end");
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.286 seconds with 15 queries.