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
Llian
Newbie


Joined: 28 Aug 2005
Posts: 4

PostPosted: Sun Aug 28, 2005 1:11 pm   

Database Single Option and Optionlist issues
 
So far so good with the database and capturing information automatically. However I am having issues getting it to add anything to fields that are setup as Option List or Single option. The triggers I use for them capture them
Code:
#TRIGGER {Can be worn on: &Item.Wear }

Fields in the database match fields in my triggers exactly (ie trigger captures this field to Wear in my item variable)
Captured as text into the same variable as the rest of the information, yet this type of option is the only one NOT recording into the database.
[Edited]
Name: 'a small shafted spear', Aliases: spear aiel
VNum: [ 1400], RNum: [ 97], Type: WEAPON, SpecProc: None
L-Des: A small spear with a long head.
Can be worn on: TAKE RIGHT HAND LEFT HAND
Set char bits : NOBITS
Extra flags : NOBITS
Weight: 3, Value: 400, Cost/day: 0, Timer: 0, Min Level: 0
In room: Nowhere, In object: None, Carried by: Nobody, Worn by: Nobody
Todam: 0d1, Message type: 39
Affections: None


This is a sample of the MUD output, so as you can see, more than one value is captured. Even with a single option (As in the Type: WEAPON,) it is not capturing it as a value
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 28, 2005 2:43 pm   
 
You are going to have to do some parsing on it to make it into the list format that the database wants. For the Wear I would suggest 2 replaces from your example.
Item.Wear=%replace(%replace(@Item.Wear, " ", ","),"T,HAND","T HAND")

For the Type you may want to check and make sure that the comma is not being captured.

Finally for all option lists I suggest using the check box for allow other. This lets the database add options to the field as you encounter them and can help in debugging. You can always correct case on the added options later. When options are used for a record, case does not have to match between the data submitted and the options in the list.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Llian
Newbie


Joined: 28 Aug 2005
Posts: 4

PostPosted: Tue Aug 30, 2005 3:35 am   
 
OK. I found one issue, although I am unsure if it is meant to be an issue at all. zMUD's database appears to be case sensitive when it comes to capturing data. Changing the options availiable to match EXACTLY the text case-wise has started working for the types. Still trying to write an entire replace script for all types that will need it.

Thanks for the assistance. Will hopefully work perfectly
Mr. Green
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