|
dysonsphere Beginner
Joined: 11 Dec 2001 Posts: 16 Location: Canada
|
Posted: Tue Dec 11, 2001 9:15 am
databases again |
ok I got input to a database working except in one case
here is sample mud text
Keywords 'some keywords to define item'
I have the keywords set in my database
and the trigger I use is as follows
Keywords &Item.keywords
and it doesnt take anything
what am I missing?
also on a side note
I also want to set up different groups of items based on 1 master list
is it possible to pull all the info for a given item
store it into the database, and than seperate it into smaller chunks
ie say I ident a sword
which goes into the database
I would also like it put into a seperate group of just swords
Ive seen the options in the database fields but how can you pull that infomation in as well as setting up the record field ????
one last thing how can I stop duplication of enteries? |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Tue Dec 11, 2001 11:02 am |
1)
When there are quotes surrounding the text you want to capture, then you need to put those quotes in the trigger pattern as well:
TRIGGER {Keywords '&Item.Keywords'} {}
The above will put all those words in the same field.
2)
You don't need to store items on different databases, because you can use the view option to sort them based on certain characteristics. You can make another window in the same database which only lists the swords, or armor, etc. Just go to View|New in the database menu to set it up.
3)
To prevent duplication of your item, you define a query function before you add them.
#IF (!%null( %query( &Name = @Item.Name & &Level = @Item.LeveL, All))) {
#SAY {Item already exists}
#VARIABLE Record %null
#VARIABLE Item %null
} {
#NEW All {@Item}
#SAY {Item added}
#DBSAVE
#VARIABLE Record %null
#VARIABLE Item %null
}
This searches the database for matches on the item you've just id'd and returns the record number. If a match is found it doesn't add it again, if the item doesn't already exist it is added.
Acaila |
|
|
|
dysonsphere Beginner
Joined: 11 Dec 2001 Posts: 16 Location: Canada
|
Posted: Tue Dec 11, 2001 1:30 pm |
[quote]
1)
When there are quotes surrounding the text you want to capture, then you need to put those quotes in the trigger pattern as well:
TRIGGER {Keywords '&Item.Keywords'} {}
The above will put all those words in the same field.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I got it but what about multiclass or optionlists?? |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Tue Dec 11, 2001 3:16 pm |
Never had much use for those before, so I don't know. Probably just set the field type in the database itself, and then add multiple items to the same field.
Acaila |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Dec 11, 2001 7:12 pm |
quote: ie say I ident a sword
which goes into the database
I would also like it put into a seperate group of just swords
Sure, just define a database view named "swords". It's not really a separate database, just a limited selection of the records.
Option lists are just multiple-choice database fields. You define what the choices are, and whether it's single-choice or multi-choice, when you create/modify the database structure. You access/use the information from these lists the same as any other field -- by using functions and/or database views.
LightBulb |
|
|
|
|
|