Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   General Item System Queries (https://forums.graalonline.com/forums/showthread.php?t=84082)

[email protected] 02-08-2009 02:28 PM

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

Crow 02-08-2009 06:44 PM

Quote:

Originally Posted by [email protected] (Post 1464178)
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.

[email protected] 02-08-2009 06:47 PM

Quote:

Originally Posted by Crow (Post 1464222)
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?

Skyld 02-08-2009 07:46 PM

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).

Crow 02-08-2009 09:27 PM

Quote:

Originally Posted by [email protected] (Post 1464224)
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.

xXziroXx 02-09-2009 04:50 PM

http://forums.graalonline.com/forums...ad.php?t=81961

That's what I would do.


All times are GMT +2. The time now is 09:56 PM.

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