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-07-2011, 02:15 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
If you're familiar with C, joining classes in GS2 is basically #include
__________________
Reply With Quote
  #2  
Old 08-07-2011, 10:46 AM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Thank you all for your replies

Yepp, I figuered it wasn't "meant" to be like in Java. Yes it's very similar to C's #include, from now on I'll just think of it like that!

I'm a little confused regarding server- and clientside though. If I create a variable, let's call it his.test, on the serverside of an NPC; will that variable "exist" on the clientside aswell? Or should I look at serverside and clientside as to different "machines" so to say?

It feels like it's coming to me know! Although, I have a lot more to learn
Reply With Quote
  #3  
Old 08-07-2011, 10:52 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Adddeeee View Post
I'm a little confused regarding server- and clientside though. If I create a variable, let's call it his.test, on the serverside of an NPC; will that variable "exist" on the clientside aswell? Or should I look at serverside and clientside as to different "machines" so to say?
No, it won't exist on clientside if you create it serverside (there are some exceptions of synced variables, though). You absolutely should look at them as two machines, because they are. Serverside is handled by the NPC-server, clientside is handled by the player's computer.

Quote:
Originally Posted by cbk1994 View Post
There are essentially two different ways you script: on serverside, or on clientside. If a script is serverside, it means that the NPC-server interprets and performs the code. The advantage to this is that you know the code can't be tamperered with. If the code is clientside, it means that it is ran on the computer of the player. This has the advantage of being faster and not requiring communication with the server, but has the disadvantage of being less secure.

Since serverside is not performed for a specific player it cannot display interface graphics (HUDs, etc). It also can't handle player chat events, among others.

To communicate between the server and the client you use something called a trigger.
There's some more information here and here.
__________________
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 02:58 PM.


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