PDA

View Full Version : Warping Script Problems


ArmadeusWarlock
06-11-2001, 09:31 AM
I can do warping in an easier way, but Im not that good of a scripter, and this script I could use help with. It comes up with an error somewhere in the setlevel2 part. HELP!


// NPC made by Reese-=I would be an awesome ET member. NOT KIDDING!>=D=-
if (playerenters) {
}
if (playertouchsme) {toweapons Warper;destroy;
}
if(weaponfired){setplayerprop #c,What level?;sleep 1;setplayerprop #c, ;this.spoke=1}
if(this.spoke=1&&playerchats){setstring level,#c;sleep 2;setplayerprop #c,Saving...;sleep 2; setplayerprop #c, ;this.spoke=2;}
if(this.spoke=2){sleep 2; setplayerprop #c,X position?;sleep 1;setplayerprop #c, ;this.spoke=3;}
if(this.spoke=3&&playersaysnumber<65){setstring x,#c;sleep 2;setplayerprop #c,Saving...;sleep 2; setplayerprop #c, ;this.spoke=4;}
if(playersaysnumber>64&&this.spoke=3){setplayerprop #c,Invalid Number. Please try again; setplayerprop #c, ;this.spoke=2;}
if(this.spoke=4){sleep 2; setplayerprop #c, Y postion?;sleep 1;setplayerprop #c, ;this.spoke=5;}
if(this.spoke=5&&playersaysnumber<65){setstring y,#c;sleep 2;setplayerprop #c,Saving...;sleep 2; setplayerprop #c, ;this.spoke=6;}
if(playersaysnumber>64&&this.spoke=5){setplayerprop #c,Invalid Number. Please try again;setplayerprop #c, ; this.spoke=4;}
if(this.spoke=6){setplayerprop #c, Are you done?;this.spoke=7;}
if(this.spoke=7&&playerchats&&!playersaysnumber&&strcontains(#c,done)){thise.spoke=8;}
if(this.spoke=8){setlevel #s(level);playerx=#s(x);playery=#s(y);}

grim_squeaker_x
06-11-2001, 07:14 PM
Could you please put an enter after every ';'? Thanks.

KJS
06-11-2001, 10:31 PM
Originally posted by ArmadeusWarlock
I can do warping in an easier way, but Im not that good of a scripter, and this script I could use help with. It comes up with an error somewhere in the setlevel2 part. HELP!


// NPC made by Reese-=I would be an awesome ET member. NOT KIDDING!>=D=-
if (playerenters) {
}
if (playertouchsme) {toweapons Warper;destroy;
}
if(weaponfired){setplayerprop #c,What level?;sleep 1;setplayerprop #c, ;this.spoke=1}
if(this.spoke=1&&playerchats){setstring level,#c;sleep 2;setplayerprop #c,Saving...;sleep 2; setplayerprop #c, ;this.spoke=2;}
if(this.spoke=2){sleep 2; setplayerprop #c,X position?;sleep 1;setplayerprop #c, ;this.spoke=3;}
if(this.spoke=3&&playersaysnumber<65){setstring x,#c;sleep 2;setplayerprop #c,Saving...;sleep 2; setplayerprop #c, ;this.spoke=4;}
if(playersaysnumber>64&&this.spoke=3){setplayerprop #c,Invalid Number. Please try again; setplayerprop #c, ;this.spoke=2;}
if(this.spoke=4){sleep 2; setplayerprop #c, Y postion?;sleep 1;setplayerprop #c, ;this.spoke=5;}
if(this.spoke=5&&playersaysnumber<65){setstring y,#c;sleep 2;setplayerprop #c,Saving...;sleep 2; setplayerprop #c, ;this.spoke=6;}
if(playersaysnumber>64&&this.spoke=5){setplayerprop #c,Invalid Number. Please try again;setplayerprop #c, ; this.spoke=4;}
if(this.spoke=6){setplayerprop #c, Are you done?;this.spoke=7;}
if(this.spoke=7&&playerchats&&!playersaysnumber&&strcontains(#c,done)){thise.spoke=8;}
if(this.spoke=8){setlevel #s(level);playerx=#s(x);playery=#s(y);}


here let me make it readable (more orginized

// NPC made by Reese-=I would be an awesome ET member. NOT KIDDING!>=D=-
if (playertouchsme) {
toweapons Warper;
destroy;
}
if(weaponfired){
setplayerprop #c,What level?;
sleep 1;
setplayerprop #c, ;
this.spoke=1
}
if(this.spoke==1 && playerchats){
setstring level,#c;
sleep 2;
setplayerprop #c,Saving...;
sleep 2;
setplayerprop #c, ;
this.spoke=2;
}
if(this.spoke==2){
sleep 2;
setplayerprop #c,X position?;
sleep 1;
setplayerprop #c, ;
this.spoke=3;
}
if(this.spoke==3 && playersaysnumber<65){
setstring newx,#c;
sleep 2;
setplayerprop #c,Saving...;
sleep 2;
setplayerprop #c, ;
this.spoke=4;
}
if(playersaysnumber>64 && this.spoke==3){
setplayerprop #c,Invalid Number. Please try again;
setplayerprop #c, ;
this.spoke=2;
}
if(this.spoke==4){
sleep 2;
setplayerprop #c, Y postion?;
sleep 1;
setplayerprop #c, ;
this.spoke=5;
}
if(this.spoke==5 && playersaysnumber<65){
setstring newy,#c;
sleep 2;
setplayerprop #c,Saving...;
sleep 2;
setplayerprop #c, ;
this.spoke=6;
}
if(playersaysnumber>64 && this.spoke==5){
setplayerprop #c,Invalid Number. Please try again;
setplayerprop #c, ;
this.spoke=4;
}
if(this.spoke==6){
setplayerprop #c, Are you done?;
this.spoke=7;
}
if(this.spoke==7 && playerchats && !playersaysnumber && strcontains(#c,done))
this.spoke=8;
if(this.spoke==8)
setlevel2 #s(level), #s(newx), #s(newy);
//NOTE: you didn't want to call the x and y
//x and y because that is the npcs x and y


I fixed some of it up...
but I dont really feel like reading it all

grim_squeaker_x
06-11-2001, 10:53 PM
if (playertouchsme) toweapons warpto;
if (playerchats&&startswith(warpto,#c)) {
tokenize #c;
if (tokenscount==2) setlevel #t(1);
if (tokenscount==3) {
playerx=strtofloat(#t(1));
playery=strtolfoat(#t(2));
}
if (tokenscount==4) setlevel2 #t(1),strtofloat(#t(2)),strtofloat(#t(3));
}

KJS
06-11-2001, 10:55 PM
I was going to post a thing that used tokenize for warpto
but after I made the other coding all colorfull I forgot all about it lol...