View Single Post
  #2  
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