Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-18-2014, 01:07 AM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Clientside vs Serverside confusion

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)
Reply With Quote
 


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 09:56 PM.


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