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
TSM
Beginner


Joined: 12 Dec 2000
Posts: 21
Location: Canada

PostPosted: Sun Jul 11, 2004 6:44 pm   

Database question
 
option list

Hi, I'm trying to log stuff in a database, and I was wondering if there was any way to append the field type "opotion list" through multiple triggers.

When ID items, I want it to automatically check off which flags are affecting the item. Heres a sample ID:

This object, a demon-headed talisman can be referred to as 'talisman demon demonic'.
It is made of adamantite and weighs 10 pounds 15 ounces.
***It radiates light.
***It can't be dropped with ease.
***It can't be removed.
When worn, it protects you against piercing for 9,
bashing for 9, slashing for 9 and magic for 0 points each.
When worn, it affects your dexterity by -8 points and your strength by -10 points.

I put the *'s beside the three lines with the flags on them. So I want each trigger to check off ANOTHER option, one for glowing, one for no_drop, and one for no_rem. The way I have it now, it will only check off one and clear the rest. I've set it so that you can select multiple items, so I can do it manually, but I wanted to streamline it so the triggers will check multiple options off for me.

This is the format of the triggers I'm using right now for this:
#TRIGGER {It radiates light.} {#addkey NewItem flags "glowing"}

Thanks for any help
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jul 12, 2004 12:43 am   
 
Do one manually, then display the record, using its record number, to see what format the option-list should be in. I think option-lists are comma-separated values (CSV) but I might be wrong. Spaces do matter. I haven't used any but that doesn't mean they aren't needed. You should use exactly the same format that a manually created record has.
#SHOWDB 1
#SHOW &2eq

Once you've determined the correct format, make your triggers to enter the data in that format. For instance, if the format is CSV:
#TR {It radiates light.} {#IF %iskey( @NewItem, flags) {#ADDK NewItem {flags} {%db( @NewItem, flags),glowing}} {#ADDK NewItem {flags} {glowing}}}
#TR {It can't be dropped with ease.} {#IF %iskey( @NewItem, flags) {#ADDK NewItem {flags} {%db( @NewItem, flags),no_drop}} {#ADDK NewItem {flags} {no_drop}}}
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