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 03-17-2005, 04:45 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
hasweapon()

I'm just trying to make a warp ring. The weapon itself is fine, it's the place where you pick it up i'm having trouble with.

I'm trying to use hasweapon(Warp Ring) to decide whether to show or hide the pickup npc.

like this:

NPC Code:

//#CLIENTSIDE
if (playerenters && hasweapon(Warp Ring)) hide;
else show;



It works fine offline.. but as soon as i upload the level it wont work.

Do i need to do something else to get this to work properly?
Reply With Quote
  #2  
Old 03-17-2005, 04:56 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
KSI-GS
__________________
Reply With Quote
  #3  
Old 03-17-2005, 05:09 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
what's wrong with that?

Should i have braces around the show and hide? If so, why? In other languages it's poor convention to use begin and end when there is only one line after the condition.
Reply With Quote
  #4  
Old 03-17-2005, 05:10 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Your weak link is, this is #gscript. What I really think he was reffering to is your placement of the hide; next to your if statement , and the &&.
__________________


CAUTION
Reply With Quote
  #5  
Old 03-17-2005, 05:44 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by JkWhoSaysNi
what's wrong with that?
You're not adhering to KSI-GS. In particular, you have code outside of event blocks.
__________________
Reply With Quote
  #6  
Old 03-17-2005, 05:55 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Ok. Thanks. I added the braces and it works now.
Reply With Quote
  #7  
Old 03-17-2005, 06:20 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by JkWhoSaysNi
Ok. Thanks. I added the braces and it works now.
Okay. But if that's all you did then you're still not adhering to KSI-GS.
__________________
Reply With Quote
  #8  
Old 03-19-2005, 02:04 AM
Amagius Amagius is offline
Cult of the Winky
Amagius's Avatar
Join Date: Sep 2001
Location: The USoCR's friendly twin
Posts: 3,225
Amagius is on a distinguished road
I believe Kai is referring to your If statement. He might not mean this, but I think you should change it to nested 'If' statements instead of connecting two predominantly detached events.
__________________
[AIM:RitaReplusa]
mail:[email protected]]
Reply With Quote
  #9  
Old 03-20-2005, 10:23 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Amagius
I believe Kai is referring to your If statement
Well, you are kind of right, but only because that statement covers the entire of his script. No, my criticism is simply that he's ignoring the first rule of KSI-GS.
__________________
Reply With Quote
  #10  
Old 03-20-2005, 06:30 PM
Amagius Amagius is offline
Cult of the Winky
Amagius's Avatar
Join Date: Sep 2001
Location: The USoCR's friendly twin
Posts: 3,225
Amagius is on a distinguished road
Quote:
Originally Posted by Kaimetsu
Well, you are kind of right, but only because that statement covers the entire of his script. No, my criticism is simply that he's ignoring the first rule of KSI-GS.
Ah, okay.
__________________
[AIM:RitaReplusa]
mail:[email protected]]
Reply With Quote
  #11  
Old 03-21-2005, 03:13 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Should be

NPC Code:

//#CLIENTSIDE
if (playerenters) {
if (hasweapon(Warp Ring))
hide;
else
show;
}



Kai: helping someone with their scripts is more important than some scripting guide :/ Sorry but such answers are pissing me
Reply With Quote
  #12  
Old 03-21-2005, 04:01 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Stefan
Kai: helping someone with their scripts is more important than some scripting guide :/ Sorry but such answers are pissing me
Stefan, the point is that if he applied the rule then he would fix his problem. By directing him to it, I am helping him. Giving him a script will make things easier for him in the short-term, but he won't actually learn anything that could be used in the future.

Also: Even if he didn't take my advice - even if I didn't help him - did I actually harm him in any way? Did I obstruct his progression or make fun of his difficulties? I may not have contributed in the way that you would prefer, but I certainly didn't do anything bad.
__________________

Last edited by Kaimetsu; 03-21-2005 at 04:14 AM..
Reply With Quote
  #13  
Old 03-21-2005, 05:50 PM
EikeSiewertsen EikeSiewertsen is offline
Fry
EikeSiewertsen's Avatar
Join Date: Apr 2001
Location: Germany
Posts: 64
EikeSiewertsen is on a distinguished road
Send a message via ICQ to EikeSiewertsen
Quote:
Originally Posted by Stefan
Should be

NPC Code:

//#CLIENTSIDE
if (playerenters) {
if (hasweapon(Warp Ring))
hide;
else
show;
}



Kai: helping someone with their scripts is more important than some scripting guide :/ Sorry but such answers are pissing me
Quote:
Originally Posted by this forum's rules
2) Likewise, don't post whole scripts for people. Post wordy solutions, certainly, but not things that people can just copy & paste into their levels without any effort.
...
__________________
Graal Wiki - Graal Forum
Reply With Quote
  #14  
Old 03-21-2005, 07:17 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
Quote:
Originally Posted by EikeSiewertsen
...
Shut up Fry. He didn't post a whole script for someone, he gave him the help he asked for. Try to understand that that rule is in place so people dont come here asking for a "warp ring" script, instead of actually doing it themselfs.
__________________
Reply With Quote
  #15  
Old 03-21-2005, 09:21 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Quote:
Originally Posted by zell12
Shut up Fry. He didn't post a whole script for someone, he gave him the help he asked for. Try to understand that that rule is in place so people dont come here asking for a "warp ring" script, instead of actually doing it themselfs.
I basically agree with you and stefan, he came asking for HELP, rather than coming to us saying "can any1 plz maek me warp ring script plzzz", but Kai is also right in that his script was horribly formatted.
__________________


CAUTION
Reply With Quote
  #16  
Old 03-21-2005, 10:08 PM
Amagius Amagius is offline
Cult of the Winky
Amagius's Avatar
Join Date: Sep 2001
Location: The USoCR's friendly twin
Posts: 3,225
Amagius is on a distinguished road
Quote:
Originally Posted by zell12
Shut up Fry. He didn't post a whole script for someone, he gave him the help he asked for. Try to understand that that rule is in place so people dont come here asking for a "warp ring" script, instead of actually doing it themselfs.
He did post the whole script. It does the action the thread starter wanted, so how can you say otherwise? Not that I think it was wrong of him to do this, as if he hadn't we probably would've gone in loops of "READ THIS"; still, formatting it so that it'll work is giving him the script.
__________________
[AIM:RitaReplusa]
mail:[email protected]]
Reply With Quote
  #17  
Old 03-21-2005, 10:13 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
He posted the part that was giving him trouble, Stefan didn't make the warp ring for him. That is why I said that to Fry. What the heck are you saying; how am I saying otherwise?
__________________
Reply With Quote
  #18  
Old 03-21-2005, 10:15 PM
Darlene159 Darlene159 is offline
Administrator
Darlene159's Avatar
Join Date: Aug 2001
Location: Florida
Posts: 12,470
Darlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud of
I dont know who made that rule, but giving someone a whole script when asked would not be a good idea, but when someone posts a script, and asks what is wrong with it, I see nothing wrong with someone showing them what they are doing wrong, showing the correct script, and then explaining what they did and why..there is no loss of learning there, and it isnt like they would be asking for an entire script to be handed to them. I know how frustrating it is to try to get a script working, and not being able to do it. I would never bring my question here because I know I wouldn't get help, and that's sad....
__________________
FORUM RULES
GRAAL BIBLE (Lots of useful info)
INFO ABOUT REPUTATIONS.
INFO ABOUT INFRACTIONS.
HOW TO APPLY FOR THE NON-GRAAL RELATED FORUM (<<READ THOROUGHLY!)

SUPPORT: http://support.toonslab.com

NOTE: YOU ARE RESPONSIBLE FOR YOUR OWN POSTS.
READ>THINK>POST
Reply With Quote
  #19  
Old 03-21-2005, 10:20 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
That rule I belive, like I said in my second last post, is so people dont come here looking for whole scripts. Like, for example, comming on here saying I need a Door scripted. Can someone make me a door? OH! How about making me a RC Car too!

But taking the piece of script that is giving you the trouble here, and asking for some help is alright. That is how it should be.
__________________
Reply With Quote
  #20  
Old 03-21-2005, 10:25 PM
Darlene159 Darlene159 is offline
Administrator
Darlene159's Avatar
Join Date: Aug 2001
Location: Florida
Posts: 12,470
Darlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud of
Quote:
Originally Posted by zell12
That rule I belive, like I said in my second last post, is so people dont come here looking for whole scripts. Like, for example, comming on here saying I need a Door scripted. Can someone make me a door? OH! How about making me a RC Car too!

But taking the piece of script that is giving you the trouble here, and asking for some help is alright. That is how it should be.
And I agree with you fully, personally I would like to know that I could come here for help since I suck at scripting, and take hours to find a problem with a script and alot of times it is something simple such as forgetting ; or a {}
__________________
FORUM RULES
GRAAL BIBLE (Lots of useful info)
INFO ABOUT REPUTATIONS.
INFO ABOUT INFRACTIONS.
HOW TO APPLY FOR THE NON-GRAAL RELATED FORUM (<<READ THOROUGHLY!)

SUPPORT: http://support.toonslab.com

NOTE: YOU ARE RESPONSIBLE FOR YOUR OWN POSTS.
READ>THINK>POST
Reply With Quote
  #21  
Old 03-21-2005, 10:30 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Quote:
Originally Posted by zell12
Shut up Fry. He didn't post a whole script for someone, he gave him the help he asked for. Try to understand that that rule is in place so people dont come here asking for a "warp ring" script, instead of actually doing it themselfs.
Yes, he didn't ask for a whole script, he asked what was wrong with his script, Kai told him but he didn't really listen to it.
Now, what has he learned of it? Stefan didn't tell him what was wrong and it doesn't seem like he read the KSI-GS which would've solved his problem. It doesn't look like he learned anything of it so he is always going to ask for someone to fix his scripts and is never going to know what exactly the problem with it was.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #22  
Old 03-21-2005, 10:34 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Luigi203
Kai is also right in that his script was horribly formatted.
Man, I didn't say anything about formatting.
__________________
Reply With Quote
  #23  
Old 03-21-2005, 10:39 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
Quote:
Originally Posted by Fry
Yes, he didn't ask for a whole script, he asked what was wrong with his script, Kai told him but he didn't really listen to it.
Now, what has he learned of it? Stefan didn't tell him what was wrong and it doesn't seem like he read the KSI-GS which would've solved his problem. It doesn't look like he learned anything of it so he is always going to ask for someone to fix his scripts and is never going to know what exactly the problem with it was.
I'm pretty stupid when it comes to scripting and I can still find the difference between Stefans script and the other one. He was already told what was wrong.
__________________

Last edited by zell12; 03-21-2005 at 11:00 PM..
Reply With Quote
  #24  
Old 03-21-2005, 10:51 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Quote:
Originally Posted by Kaimetsu
Man, I didn't say anything about formatting.
I never said you said anything about anything, but in which other ways did he not 'adhere' to the first rule of the KSI-GS?
__________________


CAUTION
Reply With Quote
  #25  
Old 03-21-2005, 11:00 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Luigi203
I never said you said anything about anything, but in which other ways did he not 'adhere' to the first rule of the KSI-GS?
Formatting is completely outside of the bounds of KSI-GS.
__________________
Reply With Quote
  #26  
Old 03-21-2005, 11:09 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Alright, maybe I have my terms mixed up? What do you call the process of "improving the readability of a code"?
__________________


CAUTION
Reply With Quote
  #27  
Old 03-21-2005, 11:16 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Luigi203
Alright, maybe I have my terms mixed up? What do you call the process of "improving the readability of a code"?
Well, I call it precisely that.
__________________
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 10:47 PM.


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