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-21-2004, 01:49 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Clientside and serverside

The commands say and say2 are clientside, right?

And what about functions that have both clientside and serverside commands in them, which side of the "//#CLIENTSIDE" statement do I put them on, or how do I otherwise deal with them?

And is it okay to use "if (this.variable=number)" conditions on the clientside part of the script?
__________________
Reply With Quote
  #2  
Old 06-21-2004, 02:45 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Googi
The commands say and say2 are clientside, right?
I think so.

Quote:
Originally Posted by Googi
And what about functions that have both clientside and serverside commands in them, which side of the "//#CLIENTSIDE" statement do I put them on, or how do I otherwise deal with them?
And is it okay to use "if (this.variable=number)" conditions on the clientside part of the script?
I did not understand this part, are you saying something like this?

Quote:
if(created) this.variable = 5;

//#CLIENTSIDE

if(playerenters){
this.var = 5;
if(this.var == this.variable) say2 Yes, it is;
}
Because the clientside part will read "this.variable" as 0, since it is on serverside part.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #3  
Old 06-21-2004, 04:59 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
I'm talking about, like.

NPC Code:
function thing() {
this.var=3;
say2 I said something!;
}



Would that go clientside or serverside?
__________________
Reply With Quote
  #4  
Old 06-21-2004, 05:19 AM
Trevor Trevor is offline
True
Trevor's Avatar
Join Date: Mar 2003
Posts: 2,253
Trevor is on a distinguished road
Would depend on where you call the function from I would think.
__________________


name: Trevor Fancher
email: trevor at fancher dot org
home page: fancher.org
Reply With Quote
  #5  
Old 06-21-2004, 05:32 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by Googi
The commands say and say2 are clientside, right?
say = client;
say2 = client/server;

Quote:
And what about functions that have both clientside and serverside commands in them, which side of the "//#CLIENTSIDE" statement do I put them on, or how do I otherwise deal with them?
Im going to use an example of how ive come to understand it, for example, on an npc i have made i use if (playertouchsme) on the serverside, and if a player has touched it, it will be destroyed. That way to prevent any other players from touching it, so only one person can get the prize. If i had put it on the clientside, it only destroyed for the player that touched it, but every other player has come and touched it too, and gotten the prize that only the first person should have gotten.

In other words, i think it is mostly about the effect you want, if they can be used on both sides.

Quote:
And is it okay to use "if (this.variable=number)" conditions on the clientside part of the script?
If you set them on the clientside, yes
__________________

Last edited by Andy0687; 06-21-2004 at 10:13 AM..
Reply With Quote
  #6  
Old 06-21-2004, 08:17 AM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
say2 works serverside and clientside for me, but say works serverside only for me.
I haven't been able to get say to work clientside. The sign just doesn't appear unless I put it serverside.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #7  
Old 06-23-2004, 07:35 PM
Trevor Trevor is offline
True
Trevor's Avatar
Join Date: Mar 2003
Posts: 2,253
Trevor is on a distinguished road
Quote:
Originally Posted by DarkShadows_Legend
say2 works serverside and clientside for me, but say works serverside only for me.
I haven't been able to get say to work clientside. The sign just doesn't appear unless I put it serverside.
I don't know if `say' is officially deprecated or not, but it is in bad taste to use it.
__________________


name: Trevor Fancher
email: trevor at fancher dot org
home page: fancher.org
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:56 PM.


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