Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-10-2006, 07:41 PM
Tom Tom is offline
Grraaaaaw
Tom's Avatar
Join Date: May 2005
Posts: 2,037
Tom is on a distinguished road
Player clientside class functions

In working with Relic, I have encountered numerous programming problems that I do believe shouldn't have bothered me, but has!

For instance, player.func() defined in the ( serverside ) join command with a clientside segment doesn't work:

Example:

PHP Code:
Class pfunc:

function 
onCreated()
{
  echo(
"Class DID join");
}

//#CLIENTSIDE

public function test() 
{
this.chat "test"

PHP Code:
Weapon anything:

function 
onCreated()
{
  
player.join("pfunc");
}

//#CLIENTSIDE

function onCreated()
{
  
player.test(); // GraalScript: Function test not found in script of Weapon anything
  
player.pfunc::test(); // GraalScript: Function test not found in script of Weapon anything

As seen in these codes, the player class does not actually carry over the class functions...

Last edited by Tom; 01-10-2006 at 07:55 PM..
Reply With Quote
  #2  
Old 01-10-2006, 08:06 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Tom
In working with Relic, I have encountered numerous programming problems that I do believe shouldn't have bothered me, but has!

For instance, player.func() defined in the ( serverside ) join command with a clientside segment doesn't work:

Example:

PHP Code:
Class pfunc:

function 
onCreated()
{
  echo(
"Class DID join");
}

//#CLIENTSIDE

public function test() 
{
this.chat "test"

PHP Code:
Weapon anything:

function 
onCreated()
{
  
player.join("pfunc");
}

//#CLIENTSIDE

function onCreated()
{
  
player.test(); // GraalScript: Function test not found in script of Weapon anything
  
player.pfunc::test(); // GraalScript: Function test not found in script of Weapon anything

As seen in these codes, the player class does not actually carry over the class functions...
onCreated() serverside is called when the WNPC is updated. onCreated() clientside is called when the player logs into the server (or receives the weapon.) The only way your script would function correctly would be if you hit the update button the exact milisecond the player logs in, before onCreated() clientside is called.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 01-10-2006, 08:09 PM
Tom Tom is offline
Grraaaaaw
Tom's Avatar
Join Date: May 2005
Posts: 2,037
Tom is on a distinguished road
Unless, of course, in the testing of this, you updated the weapon, and thus, joined before it actually tested.

onCreated clientside is activated AS the weapon is updated. So is the serverside, thereby, in the debugging purpose, it still is a valid argument.
Reply With Quote
  #4  
Old 01-10-2006, 08:11 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Tom
Unless, of course, in the testing of this, you updated the weapon, and thus, joined before it actually tested.

onCreated clientside is activated AS the weapon is updated. So is the serverside, thereby, in the debugging purpose, it still is a valid argument.
Just for the hell of it, try:

PHP Code:
function onActionserverside(cmd) {
  if(
cmd=="created") {
    
player.join("classname");
    
triggeraction(00"clientside""WEAPONNAME""created");
  }
}

//#CLIENTSIDE
function onCreated() {
  
triggeraction(00"serverside""WEAPONNAME""created");
}

function 
onActionclientside(cmd) {
  if(
cmd=="created") {
    
player.functionname();
  }

__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 01-10-2006, 08:27 PM
Tom Tom is offline
Grraaaaaw
Tom's Avatar
Join Date: May 2005
Posts: 2,037
Tom is on a distinguished road
As I say... It doesn't work.
Reply With Quote
  #6  
Old 01-10-2006, 08:30 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Tom
As I say... It doesn't work.
Odd. Clientside class functions work fine in my mudlib
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 01-10-2006, 09:49 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
They never did for me. :/
Or triggering the class, rather.
Reply With Quote
  #8  
Old 01-11-2006, 01:17 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I don't think this will work, only npcs have clientside scripts. But there is already something for this purpose, the weapons/GUI scripts.
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 06:26 PM.


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