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 06-14-2011, 02:56 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
is there a limit on the number of flags an account can have?

Is there a limit to the number of flags a player can have saved in their account file? and if not is there a limit to the number of flags that would make saving them to the player not a feasible option?
Reply With Quote
  #2  
Old 06-14-2011, 03:27 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
There is no limit but after 64k (or so) of data it disconnects people's RC when they attempt to open someone with too much flag data.

This is a (fairly rare) problem on Zodiac due to limitless-bag type inventory.
__________________
Quote:
Reply With Quote
  #3  
Old 06-14-2011, 03:32 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
so it doesn't hinder performance at all?
Reply With Quote
  #4  
Old 06-14-2011, 03:48 AM
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
It's going to hinder performance to the extent that it's stored in memory and it saves on logout (possibly while logged in, not sure). Unless you have a ridiculous amount of flags you should be fine (Kingdoms is using over 500 flags without problems).
__________________
Reply With Quote
  #5  
Old 06-14-2011, 04:06 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
I'm currently storing items like this
clientr.item.(@realname).(@itemid) = {temp.iteminfo};
i could see it loading the account file up quickly with a flag saved for each item.
Reply With Quote
  #6  
Old 03-01-2012, 01:22 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Going to bump because I don't remember how I ended up handling it last time. If I were to save every item as a flag with a unique ID similar to what I was doing above after a while I could see someone accumulating enough items to cause this issue. Is there anyway to work around this? I know I had tested before and it was quite a bit of flags I added to my account before I started getting errors however I want to cut out the possibility of it even happening while still keeping it so all itemids are unique. Any suggestions?
Reply With Quote
  #7  
Old 03-01-2012, 02:09 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
What if you store ItemID's in arrays depending on what type of item it is?
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #8  
Old 03-01-2012, 02:20 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
That could cause the array itself to get too big. I know there is a limit on how much you can store in one I just don't remember what it is
Reply With Quote
  #9  
Old 03-01-2012, 02:42 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
How it's done on Zodiac...

clientr.item-Item Name={quantity, arc}
clientr.mud_Item Name={itemdata}

If you want to use item ids you could use:

clientr.item.itemid = {quantity, item_data}

My Zodiac V2 used a hybrid of the above..

clientr.item.itemid = quantity
clientr.mud.itemid = {item_data}

However my clientr flags were merely a 'cached' version of what was stored in the SQL DB. I also had a 'stackable' property so when I added an item, if it was stackable I would look for a stack to place it in, if there was no stack I would create a new one and assign it's own unique id. To keep the amount of items to a minimum I would impose a bag limit.
__________________
Quote:
Reply With Quote
  #10  
Old 03-01-2012, 04:39 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
is it stupid to update the item information everytime it is equipped like say i cached every item into a DBNPC from flat files and every time someone equips something it pulls the item information from that? or would it be better just to store all the item data in a clientr variable instead of just the itemid and name of the item. it would allow for more flags but would also make more request to the server.

edit: also my item id is a unique id for the actual item ex;

Potion itemid-> 47288
weapon -> 47289
randomly dropped item in dungeon lets say its a pair of gloves -> 52920

I basically want it for item tracking
Reply With Quote
  #11  
Old 03-01-2012, 06:42 AM
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
I don't store any item data directly on clients on Maloria. What I do is that everytime I need to read the data of an item, I do a query from a weapon NPC called "CACHE" that retrieves the data from the SQL table, saves it on both clientside and serverside, and then returns said data with the query. If item data has already been queried by a player during the session and tries to query it again, I simply return the stored data.

Everytime the SQL database is updated with my item database tool, which only happens when I edit items, it sends a query to CACHE to update the data for all players that are online who have said item.


When it comes to owned items, I store them in a TStaticVar.
Stackable items (non-unique): player.items.ITEMIDENTIFIER
Non-stackable items (unique): player.items.UNIQUEITEMID

Subvars to each item includes identifier, id, quantity and some other misc. things - usually data that is unique to this particular item, such as skin, special properties added by crafting etc.

Cubes, if you want to study it indepth, just poke me when I'm online and I'll set you up.
__________________
Follow my work on social media post-Graal:Updated august 2025.

Last edited by xXziroXx; 03-01-2012 at 06:59 AM..
Reply With Quote
  #12  
Old 03-01-2012, 07:22 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Cubical View Post
is it stupid to update the item information everytime it is equipped like say i cached every item into a DBNPC from flat files and every time someone equips something it pulls the item information from that? or would it be better just to store all the item data in a clientr variable instead of just the itemid and name of the item. it would allow for more flags but would also make more request to the server.

edit: also my item id is a unique id for the actual item ex;

Potion itemid-> 47288
weapon -> 47289
randomly dropped item in dungeon lets say its a pair of gloves -> 52920

I basically want it for item tracking
All of the item info can be stored in a DB yea, like image/thumbnail/weight/etc.

And just store the item ID and quantity in the client flags like explained above.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #13  
Old 03-01-2012, 08:18 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by BlueMelon View Post
All of the item info can be stored in a DB yea, like image/thumbnail/weight/etc.

And just store the item ID and quantity in the client flags like explained above.
I don't think you get what I'm attempting to do. I'm trying to make every item have it's own unique I'd for easy item tracking so quantity would be irrelevant. My initial question was involving the amount of flags one can store my second question was asking if calling a request to the server everyone an item is equipped was a good idea or not. I already know how to store the information I just wanted to know the best way to implement it.

Thanks for the replies, I think I'll just go ahead and give things like potions and gold non unique ids and other items unique ids

@ziro, I'll message you on maloria later
Reply With Quote
  #14  
Old 03-01-2012, 09:52 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Cubical View Post
I don't think you get what I'm attempting to do. I'm trying to make every item have it's own unique I'd for easy item tracking so quantity would be irrelevant. My initial question was involving the amount of flags one can store my second question was asking if calling a request to the server everyone an item is equipped was a good idea or not. I already know how to store the information I just wanted to know the best way to implement it.

Thanks for the replies, I think I'll just go ahead and give things like potions and gold non unique ids and other items unique ids

@ziro, I'll message you on maloria later
Unique ID for every single new item? Like for example the same weapon, but different IDs for it?
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #15  
Old 03-01-2012, 10:12 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Yes an item would have an Id that would reference the item information And another that would reference that specific item. Like a monster drops 2 of the same item each would have a unique id and an id that would identify the item
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 01:29 AM.


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