Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-01-2005, 05:47 AM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
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;
}

Reply With Quote
  #2  
Old 09-01-2005, 09:48 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
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.
__________________
torankusu's
Reply With Quote
  #3  
Old 09-02-2005, 04:26 AM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
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?
Reply With Quote
  #4  
Old 09-02-2005, 04:31 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
is this GS2?
__________________
torankusu's
Reply With Quote
  #5  
Old 09-02-2005, 05:38 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Torankusu_2002
is this GS2?
Yes.
__________________
Liek omigosh.

Reply With Quote
  #6  
Old 09-02-2005, 07:44 AM
Krattos Krattos is offline
Banned
Join Date: Aug 2005
Posts: 33
Krattos is on a distinguished road
Ugh good that he works for me
Reply With Quote
Reply


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 10:17 AM.


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