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 01-27-2005, 12:30 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
A Few Scripting Questions o.O

1. What is /clientside in the script? I read the FAQs, and everything, and don't see what it means.
2. If you are a Scripter for a server, what would be you job? Tell a LAT a script for... Something like what? See I need help, really bad? Can someone help meh?
Arnack
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #2  
Old 01-27-2005, 12:43 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Arnack
1. What is /clientside in the script? I read the FAQs, and everything, and don't see what it means.
2. If you are a Scripter for a server, what would be you job? Tell a LAT a script for... Something like what? See I need help, really bad? Can someone help meh?
Arnack
1) "//#CLIENTSIDE" is a separator. The scripting above is serverside, the scripting below is clientside.

2) A scripter usually authors and repairs scripts as his superiors/other staff direct.

(Also: please don't sign your posts, use a signature for such things.)
Reply With Quote
  #3  
Old 01-27-2005, 12:48 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
Sry, but I really did'nt get the 1st question, yeah I am slow.
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #4  
Old 01-27-2005, 12:49 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Arnack
Sry, but I really did'nt get the 1st question, yeah I am slow.
Could you be a little more specific? What part didn't you understand?
Reply With Quote
  #5  
Old 01-27-2005, 12:51 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
That it separates... Umm stuff?
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #6  
Old 01-27-2005, 12:56 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Arnack
That it separates... Umm stuff?
Okay, how about this: what do you think the difference between serverside and clientside scripts are? Hint: There's a hint.
Reply With Quote
  #7  
Old 03-01-2005, 07:42 PM
TESTRETIS TESTRETIS is offline
Zvarri!
TESTRETIS's Avatar
Join Date: Oct 2003
Posts: 970
TESTRETIS has a spectacular aura about
Quote:
Originally Posted by Lance
(Also: please don't sign your posts, use a signature for such things.)
Reminds me of Jinx
Reply With Quote
  #8  
Old 01-27-2005, 12:53 AM
Sildae Sildae is offline
Elven sorceress!
Sildae's Avatar
Join Date: Dec 2001
Location: Lothlòrien
Posts: 159
Sildae is on a distinguished road
Quote:
Originally Posted by Arnack
1. What is /clientside in the script? I read the FAQs, and everything, and don't see what it means.
It is a division by "clientside", which looks like a global floating point variable.

Quote:
2. If you are a Scripter for a server, what would be you job?
It would be coordinating a team of lower scripters to create the scripts needed for the playerworld's design.

Quote:
Tell a LAT a script for... Something
Well, sure. But that is not directly related to a staff position.
I also think that you are not a scripter if you speak about "telling a script".

Quote:
like what?
Usually it is stuff like "Can you tell me the script for a custom HP system that features multiple damage types and also guns?".

Quote:
See I need help, really bad?
Oh, yes.

Quote:
Can someone help meh?
Yes, try reading documentation.
__________________
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
-- George Bernard Shaw
Reply With Quote
  #9  
Old 01-27-2005, 02:04 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
Quote:
Originally Posted by Sildae
It is a division by "clientside", which looks like a global floating point variable.
*Alarm* Unqualified support attempt detected *Alarm*

He was talking about //#CLIENTSIDE obviously, if you didn't know then i would think twice about helping others... If you did and you were saying that just to spite him, that's not wanted either.

For Arnack:

Generally clientside scripts are for displaying things like Inventories (Q menus), GUIs like health meters and clocks, and controls player movement. Serverside scripts are for things like changing gralats, setting player parameters, and warping. Many things that require serverside simply won't work clientside. Good luck becoming more familiar with serverside scripting It opens a whole new world compared to just clientside, offline scripting.
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #10  
Old 01-27-2005, 02:46 PM
Sildae Sildae is offline
Elven sorceress!
Sildae's Avatar
Join Date: Dec 2001
Location: Lothlòrien
Posts: 159
Sildae is on a distinguished road
Quote:
Originally Posted by HoudiniMan
*Alarm* Unqualified support attempt detected *Alarm*
*Alarm* More qualified than you. By far. *Alarm*
See how the asterisks make my post 40% more convincing.

Quote:
He was talking about //#CLIENTSIDE obviously
He was appropriately informed of what //#CLIENTSIDE does. Where is your problem?

Quote:
if you didn't know then i would think twice about helping others...
I knew. If you did not know that you should think twice about responding to my post.

Quote:
If you did and you were saying that just to spite him, that's not wanted either.
I do not think that you have any influence on what is wanted. Your flames are unneeded at least as much as my post.

Quote:
For Arnack:
Stop talking to Arnack in a post that is a reply to my post. wtf.

Also you need to be stabbed for your "advice".
__________________
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
-- George Bernard Shaw
Reply With Quote
  #11  
Old 01-27-2005, 01:01 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
Umm? I don't know? Client side is...umm, your cpu.,and umm, server side is umm... The server?! But why would youseperate it and stuff?
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #12  
Old 01-27-2005, 01:05 AM
Sildae Sildae is offline
Elven sorceress!
Sildae's Avatar
Join Date: Dec 2001
Location: Lothlòrien
Posts: 159
Sildae is on a distinguished road
Quote:
Originally Posted by Arnack
But why would youseperate it and stuff?
Can you think of any reason toseperate it and stuff?
__________________
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
-- George Bernard Shaw
Reply With Quote
  #13  
Old 01-27-2005, 01:06 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Arnack
Umm? I don't know? Client side is...umm, your cpu.,and umm, server side is umm... The server?! But why would youseperate it and stuff?
Clientside scripts are executed on the client.
Serverside scripts are executed on the server.

As you learn scripting, you will learn which types of scripts are more suited for the client and which are more suited for the server.
Reply With Quote
  #14  
Old 01-27-2005, 01:12 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
1 last ques. I think. What is the dif? Between those 2? What plans on there scripts?
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #15  
Old 01-27-2005, 01:27 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Arnack
1 last ques. I think. What is the dif? Between those 2? What plans on there scripts?
The clientside has control over the client and things that the client does.
The serverside has control over players and database npcs.
__________________
Skyld
Reply With Quote
  #16  
Old 01-27-2005, 01:32 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
Can you give meh and ex for both?
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #17  
Old 01-27-2005, 01:30 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Clientside: the player's computer runs the script
Serverside: the gserver runs the script

in addition to that some commands are different and blah blah.
Reply With Quote
  #18  
Old 01-27-2005, 01:43 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
if (created) {
message the server runs this;
}


or


//#CLIENTSIDE
if (created) {
message your computer runs this.;
}
Reply With Quote
  #19  
Old 01-27-2005, 01:46 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
When you mean to your cpu, it does...? Only just for you, not other people on the server?
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #20  
Old 01-27-2005, 02:04 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
all players in the level recieve the script and run it clientside when you use //#CLIENTSIDE
__________________

Reply With Quote
  #21  
Old 01-27-2005, 04:02 AM
Shaun Shaun is offline
Registered User
Shaun's Avatar
Join Date: Jul 2003
Location: Canada
Posts: 1,070
Shaun is a jewel in the roughShaun is a jewel in the rough
Ha, I have finally learned what //#CLIENTSIDE actually does just now. I used to think that since there is // infront, it was just some sort of comments. Why would there be comment bars for part of the script ran? That doesn't seem right.

Just about a month ago I noticed scripts don't work, most of the time, unless they have //#CLIENTSIDE, so I stuck that in all the scripts from then on. Now I see that it actually means something specific. Still think it shouldn't look like a comment though.
Reply With Quote
  #22  
Old 01-27-2005, 04:30 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
I always figured it was done that way for compatibility with the built in NPC editor.

it doesn't belong in ALL scripts, just certain things require it

the NPC server's job is to handle scripts, things are often done better serverside
when you use clientside the client has to compile and execute the script itself, causing more network data being sent
__________________

Reply With Quote
  #23  
Old 01-27-2005, 04:59 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Shaun
Ha, I have finally learned what //#CLIENTSIDE actually does just now. I used to think that since there is // infront, it was just some sort of comments. Why would there be comment bars for part of the script ran? That doesn't seem right.

Just about a month ago I noticed scripts don't work, most of the time, unless they have //#CLIENTSIDE, so I stuck that in all the scripts from then on. Now I see that it actually means something specific. Still think it shouldn't look like a comment though.
-----

#!/usr/bin/perl
#
#Script goes here

------

#include
#define

-----

etc

There are plenty of valid reasons for things to 'look like a comment.'
Reply With Quote
  #24  
Old 01-27-2005, 02:38 PM
Sildae Sildae is offline
Elven sorceress!
Sildae's Avatar
Join Date: Dec 2001
Location: Lothlòrien
Posts: 159
Sildae is on a distinguished road
Quote:
Originally Posted by Lance
#include
#define
# are not comments. Comments are /* */ and optionally //.
__________________
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
-- George Bernard Shaw
Reply With Quote
  #25  
Old 01-27-2005, 04:55 PM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
Quote:
Originally Posted by Sildae
# are not comments. Comments are /* */ and optionally //.
In Perl, # is used for inline comments.
Reply With Quote
  #26  
Old 01-27-2005, 09:09 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Sildae
# are not comments. Comments are /* */ and optionally //.
I was not talking about graal scripting there.
Reply With Quote
  #27  
Old 01-28-2005, 02:27 PM
Sildae Sildae is offline
Elven sorceress!
Sildae's Avatar
Join Date: Dec 2001
Location: Lothlòrien
Posts: 159
Sildae is on a distinguished road
Quote:
Originally Posted by Lance
I was not talking about graal scripting there.
Neither was I.
__________________
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
-- George Bernard Shaw
Reply With Quote
  #28  
Old 01-27-2005, 01:18 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 Shaun
Why would there be comment bars for part of the script ran?
Because it is not part of the script. It is not executed.
__________________
Reply With Quote
  #29  
Old 01-27-2005, 01:25 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
I used to think there was such thing as //#SERVERSIDE and if you didnt put it then your scripts would break XD
__________________
Reply With Quote
  #30  
Old 01-27-2005, 05:13 PM
Shaun Shaun is offline
Registered User
Shaun's Avatar
Join Date: Jul 2003
Location: Canada
Posts: 1,070
Shaun is a jewel in the roughShaun is a jewel in the rough
I thought Gscript was copying C and C++.

In C, C++, #define is used, but # is also not a comment.

Kaimetsu, it still has an impact on how the script works. You at least agree it is not just a comment?
Reply With Quote
  #31  
Old 01-27-2005, 05:19 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 Shaun
Kaimetsu, it still has an impact on how the script works. You at least agree it is not just a comment?
It's more accurate to think of it as two separate scripts. The //#CLIENTSIDE directive is not part of either, nor does it affect how they operate. It simply tells the server how to divide the code.
__________________
Reply With Quote
  #32  
Old 01-28-2005, 02:32 AM
Shaun Shaun is offline
Registered User
Shaun's Avatar
Join Date: Jul 2003
Location: Canada
Posts: 1,070
Shaun is a jewel in the roughShaun is a jewel in the rough
Quote:
Originally Posted by Kaimetsu
It's more accurate to think of it as two separate scripts. The //#CLIENTSIDE directive is not part of either, nor does it affect how they operate. It simply tells the server how to divide the code.
Do you agree //#CLIENTSIDE has some overall effect on how the script (or scripts) are ran, that without //#CLIENTSIDE, things may be different?
Reply With Quote
  #33  
Old 01-28-2005, 02:53 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
obviously they would be different

without //#CLIENTSIDE they wouldn't be clientside....

it's hard to explain it..... x.x
__________________

Reply With Quote
  #34  
Old 01-28-2005, 03:26 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
What is a good moderate scripter scripting guide?
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #35  
Old 01-28-2005, 01:17 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 Shaun
Do you agree //#CLIENTSIDE has some overall effect on how the script (or scripts) are ran
Only indirectly.

Look: Directives are not commands. Comments are as good a medium for expressing them as any other.
__________________
Reply With Quote
  #36  
Old 01-28-2005, 06:22 PM
Shaun Shaun is offline
Registered User
Shaun's Avatar
Join Date: Jul 2003
Location: Canada
Posts: 1,070
Shaun is a jewel in the roughShaun is a jewel in the rough
Quote:
Originally Posted by Kaimetsu
Only indirectly.

Look: Directives are not commands. Comments are as good a medium for expressing them as any other.
Would you agree that // are no longer just comments, if they can have any effect (direct or indirect) on how any script is ran?
Reply With Quote
  #37  
Old 02-28-2005, 08:08 AM
Zero Hour Zero Hour is offline
Stiff Upper Lip
Zero Hour's Avatar
Join Date: Oct 2006
Location: Nova Scotia, Canada
Posts: 0
Zero Hour is on a distinguished road
Send a message via AIM to Zero Hour
I don't mean to poke my nose in, I normally don't.

Why is the "//" part used, anyways? Does the server check the script for "//#CLIENTSIDE" then send the part below to the client?
Why isn't it something like "#Clientside" or some other means of breaking it without it having the appearance of a comment?

I guess those are my only two questions. (I understand clientside, and serverside... so you don't need to explain)
[EDIT]
Quote:
Originally Posted by Polo
http://ilfirin.org/graal/GScript2
Thats the best resource I know of.
That's very comprehensive
[/EDIT]
__________________
Reply With Quote
  #38  
Old 02-28-2005, 11:12 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by Zero Hour
I don't mean to poke my nose in, I normally don't.

Why is the "//" part used, anyways?
probably easier to make it a comment for the regular scripting engine and have something else examine for serverside/clientside parts, or was rather since we have a new engine that doesn't entirely work any bit at all the same
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #39  
Old 03-01-2005, 03:53 AM
Arnack Arnack is offline
Kojiro Chang
Arnack's Avatar
Join Date: Oct 2004
Posts: 154
Arnack is on a distinguished road
Link doesn't work o=
__________________
I support the 2k1 Revision!

|AIM| ghettoghuy1337
|MSN| [email protected]
|Email| [email protected]
Reply With Quote
  #40  
Old 03-01-2005, 03:44 PM
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
The server is parsing the script before compiling it, it searches for occurences of "sparringzone" and "//#CLIENTSIDE" and eventually divides the script into 2 subscripts for serverside and clientside. The marker "//#CLIENTSIDE" was choosen for making it possible that script editors can still analyze the whole script even if they don't know what the marker means (they will just ignore it).
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:25 PM.


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