Graal Forums

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

ChibiChibiLuc 09-01-2005 05:47 AM

Clientside classes
 
Could tell me how to call a clientside function in a class joined to the player?

For example, I want to join a class that has a bunch of math functions to a player when they log on.

I can make it join and such, but it won't let me call the functions. I know it's possible, since I've done it before and seen it done before..

NPC Weapon
NPC Code:
function onCreated() {
player.chat = Clamp(10.6,1);
}



Class
NPC Code:
public function Clamp(value,clamp) {
return 123;
}


Torankusu_2002 09-01-2005 09:48 PM

in the class, I think you need
//#CLIENTSIDE

not too sure, but, by looking over loriel's scripts, most of his classes have the same functions done serverside and clientside.

Example:

NPC Code:

// Loriel's script

function addmessage() {
addstring client.addmessage,#s(this.msg);
setstring this.msg,;
}
function clearmessages() {
set client.clearmessages;
}
//#CLIENTSIDE
function addmessage() {
addstring client.addmessage,#s(this.msg);
setstring this.msg,;
}
function clearmessages() {
set client.clearmessages;
}



Not sure if you've already tried that, but, I don't have access to an NPC-server, and it's been 2+ years since I've messed around with classes.

ChibiChibiLuc 09-02-2005 04:26 AM

Sorry, I forgot to put the clientside in.

The function isn't being called at all. :/
I've tried having it in both the clientside and serverside, but it didn't make a difference..

Anyone know?

Torankusu_2002 09-02-2005 04:31 AM

is this GS2?

Ajira 09-02-2005 05:38 AM

Quote:

Originally Posted by Torankusu_2002
is this GS2?

Yes.

Krattos 09-02-2005 07:44 AM

Ugh good that he works for me :)


All times are GMT +2. The time now is 11:50 AM.

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