Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Classes. (https://forums.graalonline.com/forums/showthread.php?t=66576)

xXziroXx 06-09-2006 07:09 PM

Classes.
 
Can a class be joined CLIENTSIDED? If im not completely wrong, Ive done it many times on GS1 but I just cant get it to work in GS2 (serverside it works).

Bl0nkt 06-09-2006 07:56 PM

A clientside segment of a class can be joined clientside, where a serverside segment can be joined serverside.

NPC Code:
function onCreated()
{
this.join("class");
}

//#CLIENTSIDE
function onCreated()
{
this.join("class");
}


contiga 06-09-2006 08:09 PM

You can also do:
join( "class");
//#CLIENTSIDE
function onCreated() {
class::functionhere( params);
}

and inside the class you do
function functionhere( params) {
player.chat = params;
}

Might be more organized, so if you have a few joined classes, you know exactly at what one to look to modify or look up the function's script.

ApothiX 06-12-2006 05:27 AM

Quote:

Originally Posted by contiga
You can also do:
join( "class");
//#CLIENTSIDE
function onCreated() {
class::functionhere(<>params);
}

and inside the class you do
function functionhere(<>params) {
player.chat = params;
}

Might be more organized, so if you have a few joined classes, you know exactly at what one to look to modify or look up the function's script.

Why the hell do you put that damn space there >:[

xXziroXx 06-12-2006 02:07 PM

Quote:

Originally Posted by ApothiX
Why the hell do you put that damn space there >:[

I style similar to that aswell.. Dunno why really, but it makes the script look less.. well, less *smudgy*.

ApothiX 06-13-2006 12:07 AM

Quote:

Originally Posted by xXziroXx
I style similar to that aswell.. Dunno why really, but it makes the script look less.. well, less *smudgy*.

It makes it look like you have a sticky space key. If you're going to do that, atleast be symmetrical about it and put a space before the closing parenthesis.


All times are GMT +2. The time now is 02:14 PM.

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