Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-11-2001, 08:31 AM
ArmadeusWarlock ArmadeusWarlock is offline
Registered User
Join Date: Jun 2001
Posts: 373
ArmadeusWarlock is on a distinguished road
Warping Script Problems

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 Code:

// 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){setplayerpro p #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){setplayerpro p #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&&s trcontains(#c,done)){thise.spoke=8;}
if(this.spoke=8){setlevel #s(level);playerx=#s(x);playery=#s(y);}


Reply With Quote
  #2  
Old 06-11-2001, 06:14 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Could you please put an enter after every ';'? Thanks.
__________________

Reply With Quote
  #3  
Old 06-11-2001, 09:31 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Re: Warping Script Problems

Quote:
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 Code:

// 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){setplayerpro p #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){setplayerpro p #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&&s trcontains(#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 Code:
// 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
__________________
Thanks,
-KJL

Last edited by KJS; 06-11-2001 at 09:45 PM..
Reply With Quote
  #4  
Old 06-11-2001, 09:53 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
NPC Code:
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));
}

__________________

Reply With Quote
  #5  
Old 06-11-2001, 09:55 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Cool I was

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...
__________________
Thanks,
-KJL
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.