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 09-24-2001, 10:46 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
probs with #t

why dosnt this work?

PHP Code:
if(startswithchangegani,#c)){
  
tokenize #c;
replacegani #t(1),#t(3);

I know it has somehing to do with #t but what?
Reply With Quote
  #2  
Old 09-24-2001, 06:48 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: probs with #t

Quote:
Originally posted by Bhala
why dosnt this work?

PHP Code:
if(startswithchangegani,#c)){
  
tokenize #c;
replacegani #t(1),#t(3);

I know it has somehing to do with #t but what?
PHP Code:
if(startswith(changegani,#c)&&playerchats){
  
tokenize #c;
  
replacegani #t(1),#t(2);

try that or if that doesn't work try putting #s() befor the #t's

but I just changed 3 to 2 so it is the 3rd word
__________________
Thanks,
-KJL
Reply With Quote
  #3  
Old 09-24-2001, 08:52 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Um...isn't it replaceANI?
NPC Code:

if(startswith(changegani,#c)&&playerchats){
tokenize #c;
replaceani #t(1),#t(2);
}

__________________

-=Shard IceFire=-
Reply With Quote
  #4  
Old 09-24-2001, 10:56 PM
Sep3kP2P Sep3kP2P is offline
Registered User
Join Date: Aug 2001
Location: CT
Posts: 183
Sep3kP2P is on a distinguished road
Send a message via ICQ to Sep3kP2P Send a message via AIM to Sep3kP2P
...

wouldn't it be...
PHP Code:
if(playerchats&&startswith(changegani ,#c)){ 
dont you need the space after changegani?
__________________
Sephiroth2k - Co-Owner Of Dragon Quest (Look In Profile For Website)
Reply With Quote
  #5  
Old 09-25-2001, 02:07 AM
Faheria_Admin5 Faheria_Admin5 is offline
Registered User
Join Date: Sep 2001
Posts: 70
Faheria_Admin5 is on a distinguished road
Send a message via AIM to Faheria_Admin5
I see what your saying Kai.

startswith(str,partstr) right?

WAs a problem for me too the 1st time a tried it. jkust flip floped it and it worked.
__________________


Last edited by Faheria_Admin5; 09-25-2001 at 02:09 AM..
Reply With Quote
  #6  
Old 09-25-2001, 03:58 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
whats wrong with this?

if(playerenters){
toweapons Warper;
}
if (playerchats&&startswith(warpto,#c)) {
tokenize #c;
if(tokenscount==3){
setlevel2 #t(1),playerx=(2),playery=(3);
}
}
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #7  
Old 09-25-2001, 04:11 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
kai taught me tokenize yesterday
Reply With Quote
  #8  
Old 09-25-2001, 05:00 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
BLA BLA BLA USE TOKENIZE! lazy bastards
Reply With Quote
  #9  
Old 09-25-2001, 06:33 AM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
since were talking about tokenizing in here i get this error from a warper code.

'Error: Expected format var, var[i], obj[i].attr, function(a), function(a,b)'

the code is
// NPC made by Josey Hunt
if (playerenters&&staff&&!hasweapon(*Warper)){toweapo ns *Warper;}
if (playerenters&&staff&&hasweapon(*Warper)){message ;}
if (playerenters&&!staff){message ;}
if (playerchats&&!staff&&isweapon){set jailed;}
if (playerchats&&startswith(warpto,#c)&&staff&&isweap on){
tokenize #c;}
if (tokenscount==3){setlevel2 #t(1),#t(2),#t(3);}

the #t(3); part gets the error. anyone know why?
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #10  
Old 09-25-2001, 06:44 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
Quote:
Originally posted by joseyisleet
since were talking about tokenizing in here i get this error from a warper code.

'Error: Expected format var, var[i], obj[i].attr, function(a), function(a,b)'

the code is
// NPC made by Josey Hunt
if (playerenters&&staff&&!hasweapon(*Warper)){toweapo ns *Warper;}
if (playerenters&&staff&&hasweapon(*Warper)){message ;}
if (playerenters&&!staff){message ;}
if (playerchats&&!staff&&isweapon){set jailed;}
if (playerchats&&startswith(warpto,#c)&&staff&&isweap on){
tokenize #c;}
if (tokenscount==3){setlevel2 #t(1),#t(2),#t(3);}

the #t(3); part gets the error. anyone know why?
ugh
first let me try to break it down


if (playerenters) {
if (staff) {
if (hasweapon(*Warper)) {
message ;
}
if (playerenters) {
if (!staff) {
message ';
}
}
if (playerchats) {
if (!staff) {
if (isweapon) {
setlevel2 jail.graal,30,30;
}
}
}
if (playerchats) {
tokenize #c;
if (startswith(warpto,#c)) {
if (isweapon) {
if (staff) {
if (tokenscount==3) {
setstring local.level,#t(3);
timeout = .5;
}
}
}
}
}
if (timeout) {
setlevel2 #s(local.level),#t(1),#t(2);
}


i fixed a few little errors and made it more readable, should work now.
say "warpto x y levelname.graal"
Reply With Quote
  #11  
Old 09-25-2001, 07:01 AM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
i tried that and i still get the same error. =/
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #12  
Old 09-25-2001, 07:06 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
here is my code,
which i made yesterday

// NPC made by Merlin
//with teaching from kai ;p
//level warper
if (playerenters) {
toweapons Warper;
setgif shadoworb.gif;
}
if (weaponfired) {
say2 Say,#b
warpto x y levelname.graal#b
to warp.#b
-Merlin;
}
if (playerchats) {
tokenize #c;
if (tokenscount==4) {
if (onduty) {
this.x=strtofloat(#t(1));
this.y=strtofloat(#t(2));
setstring local.level,#t(3);
timeout = .5;
}
else{
setplayerprop #c,Go on duty before warping!;
}
}
}
if (timeout) {
setlevel2 #s(local.level),this.x,this.y;
}
Reply With Quote
  #13  
Old 09-25-2001, 07:51 AM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
i already got it thanks though
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #14  
Old 09-25-2001, 08:28 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
no I the start with thing right

PHP Code:
if(startswith(changegani#c)){
  
tokenize #c;
message #t(1);
replacegani #t(1),#t(3);

out puts walk if player says changegani walk to run but it still dosnt work
Reply With Quote
  #15  
Old 09-25-2001, 08:36 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
try this
if (playerchats) {
if (startswith(changegani,#c)) {

if (tokenscount==3) {
this.oldgani = #t(1);
this.newgani = #t(3);
timeout = .5;
}
if (timeout) {
replaceani this.oldgani,this.newgani;
}

that will work if the command is replaceani but if it is replace gani just add a g before a
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 06:31 AM.


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