PDA

View Full Version : Another problem... "join"


wild8900
05-13-2008, 10:26 AM
Ok, this is an extremely annoying problem. In a level I have:

//#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


//#CLIENTSIDE
join("lightlamp");


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

xXziroXx
05-13-2008, 02:03 PM
More like:


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


Classes should always be joined serversided.

Robin
05-13-2008, 02:30 PM
More like:


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


Classes should always be joined serversided.

Ah yes :P

Crow
05-13-2008, 02:48 PM
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
There are some classes that wouldn't work when joined serverside ;o

Like?

Crow
05-13-2008, 03:13 PM
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
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
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
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
Did you check if you forgot to add //#CLIENTSIDE? :)

It is inside the class

WHITE.

xXziroXx
05-13-2008, 04:54 PM
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:

//#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
That's not true Ziro. Here's a perfect case:

//#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.

zokemon
05-13-2008, 08:59 PM
I did say MOST of the time.

Oh, when I was reading the thread, it seemed to have skipped about 4 posts when I hit page down, haha.

cbk1994
05-13-2008, 10:05 PM
Not to flame Ziro, but just wanted to point out that you also need to join classes to the player on serverside for serverside functions, and in a system weapon on clientside as well for client functions to work.

Tolnaftate2004
05-14-2008, 12:35 AM
All classes SHOULD be joined serverside whenever possible, period.

//#CLIENTSIDE
function onPlayerEnters() {
if (player.ismale) this.join("stuff_for_guys");
else this.join("stuff_for_girls");
}
Here is my simple local NPC which could join classes serverside, but would make my work much more tedious.

Dan
05-14-2008, 09:33 AM
That's not true Ziro. Here's a perfect case:

//#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 this serverside and it works fine?


case "accessClass": {
temp.access = new TStaticVar();
temp.access.join(params[1]);
temp.access.(@ params[2])(@ params[3]);
temp.access.destroy();
return true;
}


Or isn't that what you ment?

Crow
05-14-2008, 09:57 AM
I did this serverside and it works fine?


case "accessClass": {
temp.access = new TStaticVar();
temp.access.join(params[1]);
temp.access.(@ params[2])(@ params[3]);
temp.access.destroy();
return true;
}


Or isn't that what you ment?

He meant that if he had a TStaticVar() on Clientside you couldn't join that on Serverside. Or it would make no sense and wouldn't do anything at least.

zokemon
05-14-2008, 10:41 AM
I did this serverside and it works fine?

Of course it would WORK serverside, but not in the intended purpose as the object created on the serverside wouldn't be accessible clientside which is what we are talking about here.