Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-18-2007, 08:52 PM
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
item database query

so, I have made an item database, however I don't know how to do it now. Here's how it works so far

It creates an arc file, and adds the contents of that arc file to a database.
HTML Code:
1003.AmmoLimit=9999
1003.AmmoName=Uzi
1003.BulletGani=era_uzireload
1003.BulletsFire=1
1003.BulletsReduce=1
1003.ClipAmount=32
[Yes, on it's own line]
However, would this cause any lag? I can simply do from another NPC

HTML Code:
[Control].id.AmmoLimit
to return 9999

However, I could also make each item have it's own line, to control that data. However, each time I would want to check something, I'd need to look inside the array

Here's what I mean

HTML Code:
1003 = { {"AmmoLimit", 9999}, {"AmmoName", "Uzi"}, {"ClipAmount", 32}};
To gain the ammo name, I'd end up doing

HTML Code:
getData(id, name) {
  for (temp.i: this.(@ temp.id) {
    if (temp.i[0] == temp.name) {
      return temp.i[1];
    }
  }
}
What do you think would be better for the server?
__________________
Reply With Quote
 


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:06 AM.


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