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-06-2001, 02:55 AM
XilosTinsu XilosTinsu is offline
Registered User
Join Date: Jun 2001
Posts: 130
XilosTinsu is on a distinguished road
Send a message via AIM to XilosTinsu Send a message via Yahoo to XilosTinsu
Staff Boots

OK I'm wanting the boots to activate when I say boots on, then it asks what speed, but it's not working here this is what I have so far...
NPC Code:
  // Boots by Secret Agent Smiley :-)
if (strequals(#c,Boots on)) {this.inuse=0}
if (this.inuse==0) {this.inuse=1;
timeout=.05;
setplayerprop #c,What speed?;
this.sleep=5;
this.bootsmode=1} else {this.inuse=0;}}
if (this.sleep=5) {this.sleep--}
if (playerchats && this.bootsmode==1 && this.sleep=0) {setstring bootspeed,#c;
this.bootsmode=0}
if (timeout) {
if (this.inuse=1) {
if (keydown(0)) {playerdir=0;
playery-=(bootspeed/4);}
if (keydown(1)) {playerdir=1;
playerx-=(bootspeed/4);}
if (keydown(2)) {playerdir=2;
playery+=(bootspeed/4);}
if (keydown(3)) {playerdir=3;
playerx+=(bootspeed/4);}}
timeout=.05;}
if (strequals(#c,boots off)) {this.inuse=0}

OR this
NPC Code:
//Boots
if (this.sleep>0) {this.sleep--;}
timeout=.05;
if (strequals(#c,boots on) && this.bootmode==0) {setplayerprop #c,What speed?;
this.sleep=5;
this.bootmode=1;
this.inuse=1;
timeout=.25}
if (playerchats && this.bootmode==1 && this.sleep=0) {setstring bootspeed,#c;
this.wepenmode=0}
if (timeout) {if (this.inuse=1) {if (keydown(0)) {playerdir=0;
playery-=(bootspeed/4);}
if (keydown(1)) {playerdir=1;
playerx-=(bootspeed/4);}
if (keydown(2)) {playerdir=2;
playery+=(bootspeed/4);}
if (keydown(3)) {playerdir=3;
playerx+=(bootspeed/4);}}
timeout=.05;}
if (strequals(#c,boots off)) {this.inuse=0}


Reply With Quote
  #2  
Old 06-06-2001, 09:36 AM
WingDrgn WingDrgn is offline
dur dur dur
WingDrgn's Avatar
Join Date: May 2001
Posts: 698
WingDrgn is on a distinguished road
Shouldn't it be #c,(index)?
__________________
-Wing
Reply With Quote
  #3  
Old 06-06-2001, 09:59 AM
Bravo_NPC-Admin1 Bravo_NPC-Admin1 is offline
Registered User
Join Date: May 2001
Location: Olympia, Washington USA
Posts: 25
Bravo_NPC-Admin1 is on a distinguished road
Send a message via AIM to Bravo_NPC-Admin1 Send a message via Yahoo to Bravo_NPC-Admin1
if (playerchats && strequals(#c,Boots on)) {
timeout=.05;
}
if (playerchats && strequals(#c,boots off)) {
timeout=0;
}
if (playerchats && startswith(#c,bootspeed)) {
tokenize #c;
client.bootspeed=#t(1);
}
if (timeout) {
if (keydown(0)) {playerdir=0; playery-=(client.bootspeed/4); }
if (keydown(1)) {playerdir=1; playerx-=(client.bootspeed/4); }
if (keydown(2)) {playerdir=2; playery+=(client.bootspeed/4); }
if (keydown(3)) {playerdir=3; playerx+=(client.bootspeed/4); }
timeout=.05;
}

Now. Say Boots On for the boots to be on. Boots Off to turn them off. To set speed, say bootspeed <speed>. For example:
bootspeed 2

How about that?
__________________
-Boco
Reply With Quote
  #4  
Old 06-06-2001, 05:05 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
Hmm.

NPC Code:
if (created) this.speed=1;
if (playertouchsme) toweapons Boots thingumajig;
if (weaponfired) this.active=(this.active+1)%2;
if (playerenters||timeout) {
if (this.active==1) {
for (this.k=0;this.k<4;this.k++) if (keydown(this.k)) {
playerx+=vecx(this.k)*this.speed;
playery+=vecy(this.k)*this.speed;
}
}
timeout=0.05;
}
if (playerchats&&startswith(setspeed,#c)) {
tokenize #c;
this.speed=strtofloat(#t(1));
}


Which is basically one of the shortest possible scripts for admin boots with settable speed.
__________________

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 05:00 PM.


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