It is currently Wed Oct 15, 2008 4:30 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: cprop on cfg files
PostPosted: Sun Oct 14, 2007 1:53 pm 
Offline

Joined: Fri Aug 31, 2007 2:25 pm
Posts: 67
how can I add a cproped array into an item, using cfg file?

item id
{
...
cprop name XXXXX
...
}

what do i have to 'put' instead of XXXXX ?
and for dictionaries ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 14, 2007 5:29 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 561
Actually I don't know if it's the official way or even a sensible way, but if I want to store an integer onto an itemdesc item I do this:

Quote:
CProp skillreq i101


The cprop name of skillreq has an integer value of 101. The i means the value is integer.


But of course, you would only want to do this if this value is likely to change. For a constant, better to create a property in itemdesc:
skillreq 101
and then use some cfg file functions to read it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 15, 2007 5:54 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
I took a moment to search through the items.txt file in \pol\data to see how the system represents arrays as CProps.

Here are a couple examples I found. Please remember that syntax is very important when manually placing arrays as CProps.

Example number 1:
CProp Children a3:i1816821i1816232i1816715
This is an array of of three (3) integers. Note the a3: indicating the size of the array and the corresponding three integers eache delimited (seperated) by an 'i'.

Example number 2:
CProp Junk a3:S6:ActiveS6:ActiveS6:Active
This is an array of three (3) strings. Note the a3: followed by the three strings defined by the 'S'. The number after each 'S' is the length of the string it is defining, ie. S6:Active - the word 'Active' is six characters long.

I hope this is helpful.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 12:15 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 772
Location: Chicago, IL USA
Unless you absolutely HAVE to, don't put CProps in cfg files. If the prop will never change, its better to just make a custom entry in the cfg because CProps coming from cfgs take up substantially more memory because it adds that CProp to every item thats made as opposed to just keeping it once as a reference in that file.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 5:50 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
Very good point CWO.

When I have used them I try to have any scripts that used them remove them when they are no longer needed

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl