Graal Forums  

Go Back   Graal Forums > Private forums > Graal4 Forums > Graal V4 Main Forum
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-10-2006, 07:53 PM
Tom Tom is offline
Grraaaaaw
Tom's Avatar
Join Date: May 2005
Posts: 2,037
Tom is on a distinguished road
Suggestion: Clientside Class

Clientside TStaticVar CAN'T join classes. In a former thread it was said it was due to security risk. However, why can't classes be scripted in the Weapon NPC and make the scripts truly class-oriented?

PHP Code:
class item
{
  function 
itemid 0quant // Constructor
  
{
    
this.index id;
    
this.quant quant;
  }
  function 
dropquant )
  {
    if (
quant this.quantquant this.quant;
    if (
quant 1) return false;
    
triggeraction(00"serverside""Items"this.idthis.quant);
  }

Or, even more in depth, more functions to the actual classes:

PHP Code:
class wearableitem : public item
{
  function 
wearableitemid 0quant 1) : item:itemidquant );

  function 
wear()
  {
    if (
this.worn) return true;
 
    
player.wear ++;
    
this.worn true;

    return 
true;
  }
  function 
remove()
  {
    if (!
this.worn) return true;

    
player.wear --;
    
this.worn false;
    return 
true;
  }

  #2  
Old 01-11-2006, 12:24 AM
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
The Graal class system is a matter of organization, and actually more dynamic than the C++ class system since you can join and leave at any time. Like I have said in an earlier thead, it would be possible to add support for joining classes on clientside which are listed in some server option, haven't got time for adding that yet though.
 


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:11 PM.


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