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 08-18-2005, 04:23 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
Script Error

What is wrong with this script
NPC Code:

// NPC made by Jay
if (created) {}
if (playerchats && (strequals(#a,alissalee))) {}
if (strequals(#p(0),kick)) {}
with(getplayer(#p(2))){
setlevel2 reborn_startlocal,30,30;
}

Reply With Quote
  #2  
Old 08-18-2005, 04:39 AM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
1) Use are checking parameters, not the players chat.
2) You are closing the playerchats event before it has a chance to execute anything.
3) There is an empty if (created) block.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #3  
Old 08-18-2005, 04:43 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
4. Your level has no file extension.
Reply With Quote
  #4  
Old 08-18-2005, 04:47 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
NPC Code:


// NPC made by Jay
if (playerchats && strequals(#a,alissalee))) {}
if (startswith(/kick,#a)) {
with(getplayer(#p(2))){
setlevel2 reborn_startlocal.nw,30,30;
}


is that right now?
Reply With Quote
  #5  
Old 08-18-2005, 12:35 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
No.
1. You are still closing the playerchats block ({} is an empty block).
2. In the startswith, you are checking against #a (thier account), whereas you mean to put #c (thier chat).
3. Paramater 2 (#p(2)) does not exist (in the context of this script), as it is set when a triggeration or other parameter sending function gets called. You need to use tokenize, then the #t() tokens here to get the second word of the players chat.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #6  
Old 08-18-2005, 10:21 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
4. You are missing a closing bracket.
Reply With Quote
  #7  
Old 08-19-2005, 03:01 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally Posted by Polo
No.
1. You are still closing the playerchats block ({} is an empty block).
2. In the startswith, you are checking against #a (thier account), whereas you mean to put #c (thier chat).
3. Paramater 2 (#p(2)) does not exist (in the context of this script), as it is set when a triggeration or other parameter sending function gets called. You need to use tokenize, then the #t() tokens here to get the second word of the players chat.
1. in my opinion, if she can't figure this out,, she shouldn't even be scripting.
2. again... why does she even bother?
3. I have to disagree here. Tokenize is totally inefficient in this situation. It would be better to use #e().
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #8  
Old 08-19-2005, 03:19 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Quote:
Originally Posted by konidias
1. in my opinion, if she can't figure this out,, she shouldn't even be scripting.
Hey, everybody has to start somewhere... Yeah, it makes my head hurt too... But really.
Reply With Quote
  #9  
Old 08-19-2005, 03:54 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
i am not a she good damnit every time i script it it says script error
Reply With Quote
  #10  
Old 08-19-2005, 06:28 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
I would seriously consider picking up a C book or something like that, alissalee. They have far better guides for syntax, and many of the syntax properties of C and C++ can be carried into GS. Trust me.
Reply With Quote
  #11  
Old 08-19-2005, 08:17 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
were can u give me a url Scriptagonist
Reply With Quote
  #12  
Old 08-19-2005, 11:07 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Quote:
Originally Posted by konidias
3. I have to disagree here. Tokenize is totally inefficient in this situation. It would be better to use #e().
True. Perchance I was jaded by thier original use of #p().
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #13  
Old 08-19-2005, 04:59 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally Posted by alissalee
were can u give me a url Scriptagonist
http://cplus.about.com/od/beginnerct...1/l/blctut.htm

C and C++ have alot more documentation that GScript, so you may find it easier to learn. Then, once you learn a sufficient amount, you'll be able to carry over the habits you form into GS.
Reply With Quote
  #14  
Old 08-19-2005, 05:45 PM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
thxsman
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 11:11 PM.


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