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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

PostPosted: Fri Dec 12, 2008 1:54 pm   

Examples for EQ database
 
Hello all,

I'm trying to develop a database to capture equipment attributes every time I identify an item. Obviously I'm not a programmer, but usually a quick learner. The documentation on these CMUD features are a little confusing to me. Could someone please point me to a post or other resource for making this happen?
Does it help to use the templates.dbd when creating database objects? Mine is somehow missing when I attempt to create a new DB.

Here are some examples of identified items from my Circle variant mud I play.

You recite a scroll of identify which dissolves.
You feel informed:
Object 'mallet Orcus', Item type: WEAPON
Item is: GLOW MAG ANTI-GOOD ANTI-NEUTRAL NOTHF NOWAR NOPAL NONINJA NOJEDI LIMITED NODONATE
Weight: 10, Value: 10, Minimum Level: 15
Damage Dice is '5D5' for an average per-round damage of: 15.0
Can affect you as :
Affects: WIS By 3
Affects: DAMROLL By 2

You recite a scroll of identify which dissolves.
You feel informed:
Object 'combat jumpsuit', Item type: ARMOR
Item is: GLOW LIMITED
Weight: 4, Value: 20000, Minimum Level: 10
This piece of armor will improve your AC by 6 points.
Can affect you as :
Affects: DAMROLL By 1


You recite a scroll of identify which dissolves.
You feel informed:
Object 'wand invisibility invisible', Item type: WAND
Item is: MAG
Weight: 2, Value: 5500, Minimum Level: 0
Has 3 charges max and 3 charges left.
Level 12 spell of:
invisible


Many thanks for any assistance.
Reply with quote
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

PostPosted: Fri Dec 12, 2008 3:09 pm   Please help with syntax
 
I've played around with a tutorial this morning but without much success:

Here is the code I've used

Code:
#CLASS {identify}
#TRIGGER {Object \'&{EQ.Object}\', Item type: &{EQ.ItemType} } {}
#TRIGGER {Item is: &{EQ.ItemIs} } {}
#TRIGGER {Weight: &{EQ.Weight}, Value: &{EQ.Value}, Minimum Level: &{EQ.MinimumLevel} } {}
#TRIGGER {$} {

#if (%find( @EQ.Object) = "") {#new "" @EQ.Object}
 item = ""
 #t- identify
}

#CLASS 0
#ALIAS ID {
 #t+ identify
 rec identify %1
}


I can create database entries, but it does not populate them with data.
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Fri Dec 12, 2008 8:44 pm   
 
Try change {#new "" @EQ.Object} to {#new "" @EQ}

Also change item="" to EQ=""
Reply with quote
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

PostPosted: Fri Dec 12, 2008 9:18 pm   Another try
 
Rorso,

Thank you for replying.
After some playing around I got some of the code to work. This is the current script.

Code:
#CLASS {identify}
#TRIGGER {Object &{item.object} item type: &{item.itemtype}}
#TRIGGER {item is: &{item.itemis} }
#TRIGGER {Weight: &{item.weight} Value: &{item.value} Minimum Level: &{item.minlevel} }
#TRIGGER {This piece of armor will improve your AC by &{item.ac} points.}
#TRIGGER {It can hold approximately &{item.hold} units. }
#TRIGGER {Affects: HIT_REGEN By {item.hit_regen} }
#TRIGGER {Affects: MANA_REGEN By {item.mana_regen} }
#TRIGGER {Affects: STR By {item.str} }
#TRIGGER {Affects: DEX By {item.dex} }
#TRIGGER {Affects: CHA By {item.cha} }
#TRIGGER {Affects: DAM By {item.dam} }
#TRIGGER {Affects: HIT By {item.hit} }
#TRIGGER {Affects: INT By {item.int} }
#TRIGGER {Affects: WIS By {item.wis} }
#TRIGGER {Affects: CON By {item.con} }

#TRIGGER {$} { #if (%find( @item.object) = "") {#new "" @item}
item = "" 
#t- identify
}

#CLASS 0
#ALIAS identify {
 #t+ identify
 rec identify %1
}


It will capture the Object, ItemType, ItemIs, and AC But nothing else

Any suggestions?
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Fri Dec 12, 2008 9:57 pm   
 
You need to add the & before {variablename}.

E.g rewrite: #TRIGGER {Affects: STR By {item.str} }
so it becomes: #TRIGGER {Affects: STR By &{item.str} }
Reply with quote
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

PostPosted: Sat Dec 13, 2008 4:35 am   Still not working properly
 
Thank you for responding to my problem.

I made the corrections which were obviously dumb errors on my part.
However, this did little to change what is being pulled into the database:

Code:
#TRIGGER {Weight: &{item.weight} Value: &{item.value} Minimum Level: &{item.minlevel}}

For example, in the above code only the minlevel data is being pulled into the database, which makes no sense to me. All of my database fields are named as they are called above.

I'm sorry to be a pest and appreciate the help
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Dec 13, 2008 3:59 pm   
 
This is all assumes you captured everything correctly. You can do #SHOWDB on @item to make sure you capture everything as you expected. That way you'll know you are attempting to add the complete information. Also I don't remember if the DB module is case sensitive or not (I didn't think it was) but you may want to check for that as well.
_________________
Asati di tempari!
Reply with quote
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

PostPosted: Sat Dec 13, 2008 7:14 pm   My results
 
Here is an item I identifieid:
Quote:

You recite a scroll of identify which dissolves.
You feel informed:
Object 'red wyvern scale bracelet', Item type: ARMOR
Item is: GLOW HUM
Weight: 3, Value: 1500, Minimum Level: 0
This piece of armor will improve your AC by 3 points.
Can affect you as :
Affects: HITROLL By 2
Affects: DAMROLL By 1


Here is the #showdb @eq command output I ran per your suggestion

Mana: 0
ManaRegen: 0
Wis: 0
Ac: 3
ItemIs:
Int: 0
ItemType: ARMOR
Dam: 0
MinimumLevel: 0
Value: 0
Con: 0
Dex: 0
Hit: 0
Weight: 0
Cha: 0
Num: 0eq
DamageDice:
HitRegen: 0
Hold: 0
Object: 'red wyvern scale bracelet',
Str: 0
AverageDamage: 0


Here is the script
Code:
#CLASS {identify}
#TRIGGER {Object &{eq.Object} item type: &{eq.itemtype}}
#TRIGGER {Item is: &{item.itemis} }
#TRIGGER {Weight\: &{eq.weight} Value: &{eq.value} Minimum Level: &{eq.MinimumLevel}} 
#TRIGGER {This piece of armor will improve your AC by &{eq.Ac} points.}
#TRIGGER {It can hold approximately &{eq.Hold} units. }
#TRIGGER {Damage Dice is &{eq.DamageDice} for an average per-round damage of: &{AverageDamage}}
#TRIGGER {HIT_REGEN By &{eq.HitRegen} }
#TRIGGER {MANA_REGEN By &{eq.ManaRegen} }
#TRIGGER {STR By &{eq.Str} }
#TRIGGER {DEX By &{eq.Dex} }
#TRIGGER {CHA By &{eq.Cha} }
#TRIGGER {Affects: DAMROLL By &{eq.Dam} }
#TRIGGER {Affects: HITROLL By &{eq.Hit} }
#TRIGGER {INT By &{eq.Int} }
#TRIGGER {WIS By &{eq.wis} }
#TRIGGER {CON By &{eq.Con} }
#TRIGGER {MANA By &{eq.Mana} }

#TRIGGER {$} { #if (%find( @eq.Object) = "") {#new "" @eq}
eq = "" 
#t- identify
}
 
#CLASS 0
#ALIAS identify {
 #t+ identify
 rec identify %1
}


So im a little confounded. I made sure everthing was case sensitive just in case. I may have made an error, but I don't think so.

Thank you for your help!
Reply with quote
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Sat Dec 13, 2008 7:41 pm   
 
Your ItemIs trigger stores the value in item.itemis instead of eq.itemis. It also needs to be changed to handle spaces or you will only get the first word:
Code:
#TRIGGER {Item is: &{eq.itemis}$}


Your weight trigger needs to have the \ removed before the :
Code:
#TRIGGER {Weight: &{eq.weight} Value: &{eq.value} Minimum Level: &{eq.MinimumLevel}}


Your HITROLL and DAMROLL triggers both have an extra space at the end of the pattern. Should be:
Code:
#TRIGGER {Affects: DAMROLL By &{eq.Dam}}
#TRIGGER {Affects: HITROLL By &{eq.Hit}}


Those are the only ones I can confirm from the output you provided, but you have a bunch of other triggers that all have an extra space at the end of the pattern which are probably all incorrect as well.
Reply with quote
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

PostPosted: Sun Dec 14, 2008 3:29 am   Thanks!
 
After a little more tweaking it now works great.
Thanks for all your assistance!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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