View Single Post
  #5  
Old 10-22-2014, 06:23 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
Quote:
Originally Posted by i8bit View Post
So I always wondered something.

Let's say, you have a weapon in a player that does this.
PHP Code:
//#CLIENTSIDE
function onCreated(){
 
onTimeOut();
}

function 
onTimeOut(){
 
setTimer(0.1);
 
player.+= 1;

The player will just keep moving right. And all other players can see that movement being done also.


Now lets apply the same thing to a npc..
PHP Code:
function onCreated(){
 
onTimeOut();
}

function 
onTimeOut(){
 
setTimer(0.1);
 
this.+= 1;

The NPC keeps moving to the right. Everyone can see it. Great.
But why can't the NPC be clientside also?
Does client and serverside work different between players and NPCs?


For example, if I have this on a NPC...
PHP Code:
//#CLIENTSIDE
function onPlayerTouchsMe(){
 
this.chat "Touch";

Why can't everyone in the area see the change in function of the same NPC. Is there a way to do this all in clientside? (Showing same NPC movement for all players in real-time)

I feel like no one here really anwsered your question. The difference between clientside and serverside is that when something happens on client It HAPPENS for you since its on your client. So if your changing a npc looks or lets say its chat under //#CLIENTSIDE, thats only happening for you. However if you removed the clientside portion, the changes would be done on serverside that all players are synced to, all players would see the changes.

when you do playertouchsme on clientside its only changing the clientside coords thats within the playerscope thats touching it. However if you did it on serverside its still within the playerscope but your changing the server coords that all players are synced to.
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote