Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
dysonsphere
Beginner


Joined: 11 Dec 2001
Posts: 16
Location: Canada

PostPosted: 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?
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: 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
Reply with quote
dysonsphere
Beginner


Joined: 11 Dec 2001
Posts: 16
Location: Canada

PostPosted: 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??
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net