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 02-08-2009, 02:28 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
General Item System Queries

So- I was wondering how would you do certain things? (you as an individual)

1,) How would you script an item system? (adding/removing/equip)
I'd make it as a player class, simple and easy to use. (player.addItem("name", quant (+/-))
I'd also say it's a pretty secure way to control it this way with logs.

2,) How would you arrange your item strings?
I'd use two, one to hold the item information and another to hold the item quantity that you have. (item_name=data, items={{name, amount}})


thanks
Reply With Quote
  #2  
Old 02-08-2009, 06:44 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by [email protected] View Post
1,) How would you script an item system? (adding/removing/equip)
I'd make it as a player class, simple and easy to use. (player.addItem("name", quant (+/-))
I'd also say it's a pretty secure way to control it this way with logs.
It's obviously not. Several people, including myself, managed to drop an item without this being logged on Era in the past. That's why I moved the savelog2() call into the item class. Also, throwing that stuff into a class joined to a player doesn't seem right. Wouldn't trust it.
Reply With Quote
  #3  
Old 02-08-2009, 06:47 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by Crow View Post
It's obviously not. Several people, including myself, managed to drop an item without this being logged on Era in the past. That's why I moved the savelog2() call into the item class. Also, throwing that stuff into a class joined to a player doesn't seem right. Wouldn't trust it.
What do you suggest using?
Reply With Quote
  #4  
Old 02-08-2009, 07:46 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
On Rudora I have a system quite like Era where the database contains a list of item IDs matched to the actual item data. The client flag is the same as the item description in the database, except the first element is the quantity of items. My item manipulation functions are kept in a class joined to the player (since that way the player object is already specified and it is not necessary to do further work identifying the player object).
Reply With Quote
  #5  
Old 02-08-2009, 09:27 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by [email protected] View Post
What do you suggest using?
Can't suggest anything. I have no idea about item systems, I don't know what's secure and what's not, I just wanted to remind you of that issue.
Reply With Quote
  #6  
Old 02-09-2009, 04:50 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
http://forums.graalonline.com/forums...ad.php?t=81961

That's what I would do.
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 12:47 AM.


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