Graal Forums  

Go Back   Graal Forums > PlayerWorlds > PlayerWorlds Main Forum
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-16-2010, 08:51 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Cubical View Post
what's the advantage to creating a weapon called "-Items" over joining the player to a class?
Clientside functions

HTML Code:
(@ "-Items").onDropItem(id, amount);
(@ "-Items").onGetItemCount();
(@ "-Items").onGetItemQuantity(id);
__________________
Reply With Quote
  #2  
Old 03-16-2010, 08:56 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by xAndrewx View Post
Clientside functions

HTML Code:
(@ "-Items").onDropItem(id, amount);
(@ "-Items").onGetItemCount();
(@ "-Items").onGetItemQuantity(id);
You can actually rename the object name of the WNPC in the weapon script so you can access it by a more... simpler name, instead of doing (@ "-Items"). I think it's name = "Items";... that could be wrong, though.

Also, player-joined classes have clientside functions if you put clientside functions in the class, lol. Just remember though, pretty sure all class-functions joined to a player are accessed by player.function, thus I tend to add functions that represent actions to a player(player.damage()), while putting item-related functions in a WNPC that is appropriately named(items.createitem()), as it would look odd for say, player.createitem().
Reply With Quote
  #3  
Old 03-16-2010, 09:39 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by DustyPorViva View Post
You can actually rename the object name of the WNPC in the weapon script so you can access it by a more... simpler name, instead of doing (@ "-Items"). I think it's name = "Items";... that could be wrong, though.

Also, player-joined classes have clientside functions if you put clientside functions in the class, lol. Just remember though, pretty sure all class-functions joined to a player are accessed by player.function, thus I tend to add functions that represent actions to a player(player.damage()), while putting item-related functions in a WNPC that is appropriately named(items.createitem()), as it would look odd for say, player.createitem().
Oh I didn't know about the player.joined classes had a clientside effect, thank you =D
__________________
Reply With Quote
  #4  
Old 03-16-2010, 01:07 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Weapons are usually preferable since they don't have a few problems player classes on clientside have:
  • They lag behind when logging on since you have to join them clientside in an onCreated function on a weapon. This means you have to delay other scripts until the class loads.
  • They are notoriously hard to update. Often I have to restart my client, and sometimes the NPC-server, to make simple changes.

You will need to join the class to the player on clientside for the clientside portion to work.

Quote:
Originally Posted by DustyPorViva View Post
You can actually rename the object name of the WNPC in the weapon script so you can access it by a more... simpler name, instead of doing (@ "-Items"). I think it's name = "Items";... that could be wrong, though.
PHP Code:
itemControl this
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:54 PM.


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