Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Another problem... "join" (https://forums.graalonline.com/forums/showthread.php?t=79724)

wild8900 05-13-2008 10:26 AM

Another problem... "join"
 
Ok, this is an extremely annoying problem. In a level I have:
PHP Code:

//#CLIENTSIDE
if(created||playerenters){
  
join lightlamp;


If you update the level the lightlamp class works but if you reconnect and dont update level manually, the script acts really weird. Pain in the ass.
Why would it do this?

Robin 05-13-2008 10:32 AM

Try doing

PHP Code:

//#CLIENTSIDE
join("lightlamp"); 

That's assuming your lightlamp class already has an onCreated/onPlayerenters event.

xXziroXx 05-13-2008 02:03 PM

More like:

PHP Code:

join("lightlamp");
//#CLIENTSIDE
function onCreated()
{


Classes should always be joined serversided.

Robin 05-13-2008 02:30 PM

Quote:

Originally Posted by xXziroXx (Post 1390635)
More like:

PHP Code:

join("lightlamp");
//#CLIENTSIDE
function onCreated()
{


Classes should always be joined serversided.

Ah yes :P

Crow 05-13-2008 02:48 PM

Quote:

Originally Posted by xXziroXx (Post 1390635)
Classes should always be joined serversided.

Usually, but not always. There are some classes that wouldn't work when joined serverside ;o

Dan 05-13-2008 02:58 PM

Quote:

Originally Posted by Crow (Post 1390640)
There are some classes that wouldn't work when joined serverside ;o

Like?

Crow 05-13-2008 03:13 PM

Quote:

Originally Posted by Dan (Post 1390642)
Like?

That completely clientsided textbox class I made sometime.
Don't ask me why it won't work joined serverside, it just doesn't.

xXziroXx 05-13-2008 03:39 PM

Quote:

Originally Posted by Crow (Post 1390645)
That completely clientsided textbox class I made sometime.
Don't ask me why it won't work joined serverside, it just doesn't.

Sounds like you forgott to add //#CLIENTSIDE in your class. All classes SHOULD be joined serverside whenever possible, period.

Crow 05-13-2008 03:58 PM

Quote:

Originally Posted by xXziroXx (Post 1390646)
Sounds like you forgott to add //#CLIENTSIDE in your class. All classes SHOULD be joined serverside whenever possible, period.

It is inside the class, it doesnt work when joined serverside, it works super perfectly when joined clientside, MOAR PERIOD.

xXziroXx 05-13-2008 04:00 PM

Quote:

Originally Posted by Crow (Post 1390649)
It is inside the class, it doesnt work when joined serverside, it works super perfectly when joined clientside, MOAR PERIOD.

Did you check if you forgot to add //#CLIENTSIDE? :)

Crow 05-13-2008 04:06 PM

Quote:

Originally Posted by xXziroXx (Post 1390650)
Did you check if you forgot to add //#CLIENTSIDE? :)

Quote:

Originally Posted by Crow (Post 1390649)
It is inside the class

WHITE.

xXziroXx 05-13-2008 04:54 PM

Quote:

Originally Posted by Crow (Post 1390651)
WHITE.

l2read @ me? :cry:

wild8900 05-13-2008 06:56 PM

Great! Thanks so much everyone. All I had to do was serverside the join() command. The different effects of serversided and clientsided things are so frustrating.

zokemon 05-13-2008 06:58 PM

That's not true Ziro. Here's a perfect case:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
this.myobj = new TStaticVar();
  
this.myobj.join("myclass");


You wouldn't be able to do that serverside as your object doesn't exist over there ;).

xXziroXx 05-13-2008 07:42 PM

Quote:

Originally Posted by zokemon (Post 1390679)
That's not true Ziro. Here's a perfect case:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
this.myobj = new TStaticVar();
  
this.myobj.join("myclass");


You wouldn't be able to do that serverside as your object doesn't exist over there ;).

I did say MOST of the time.


All times are GMT +2. The time now is 04:49 PM.

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