View Single Post
  #2  
Old 10-16-2009, 12:18 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
Some people (Ziro?) are going to tell you otherwise, but there's no reason to use an "arc" file. You might as well just use a text (.txt) file. Basically, what you're talking about is called a "MUDlib". I'd link you to a Wikipedia article, but I can't on these forums, so just go Google it.

Basically, it's a way to store unique items that can have custom properties. For example, you could easily create a sword with a custom name or stats.

They're traditionally used for RPG servers, but can also be used for other types.

You're going to want to do stuff like:
PHP Code:
temp.vars.loadVars("items/cb/cbk1994/item_1241242452345.txt");
// then you can access stuff like
echo(vars.item_name); 
also look into the functions loadVars and saveVars.

To save you'd do something like

PHP Code:
temp.item = new TStaticVar();
item.item_name "Super Sword";
item.item_weight 1.4;
item.item_power 50;
item.item_class "warrior";

item.saveVars("items/cb/cbk1994/item_random_id_here.txt"); 
You can open the file with File Browser (in RC) to see how it's formatted. Remember that to access files via script, you need to give the NPC-server folder rights, account "(npcserver)" and rights like "rw items/*/*/*".

There are tons of different ways to do it, and everyone likes to do it a different way. You might also want to look into SQLite for item storage.
__________________
Reply With Quote