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


Joined: 23 Jan 2002
Posts: 3

PostPosted: Wed Jan 23, 2002 3:05 am   

Database
 
Ok i'm about to smash my computer :) Been working on this for days, maybe even a couple weeks..i cant get it to work.

I want to build an eq database off of an identify spell. Heres the mud output after identify is cast:

You feel informed:
Object 'ring titanium', Item type: WORN
Item will give you following abilities: NOBITS
Item is: MAGIC NOBITS
Weight: 0, Value: 10000
Can affect you as :
Affects : HITPOINTS By 55
Affects : SV_SPELL By 3

or something similar depending on the type.
Heres what i have from other people, it looks like it should work, but its not writing anything to the dbase.

#ALIAS ID {#var dbItem {};#var dbItemType {};#T+ Identify;cast 'identify' %1}
#ALIAS CreateItem {#IF (!%null( @dbItem)) { #NEW @dbItemType @dbItem};#T- identify} "Identify"
#TRIGGER {$} {createitem;#T- Identify} "Identify"
#TRIGGER {AC-apply is &dbItem.ac} {} "Identify"
#TRIGGER {AGI By &dbItem.agi} {} "Identify"
#TRIGGER {ARMOR By &dbItem.armor} {} "Identify"
#TRIGGER {CON By &dbItem.con} {} "Identify"
#TRIGGER {DAMROLL By &dbitem.dam} {} "Identify"
#TRIGGER {DEX By &dbItem.Dex} {} "Identify"
#TRIGGER {HITPOINTS By &dbItem.hp} {} "Identify"
#TRIGGER {HITROLL By &dbitem.hit} {} "Identify"

etc, for all the possible stats of the item.

Any ideas why this isnt working? been racking my brains.

Thanks in advance.
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Wed Jan 23, 2002 7:12 am   
 
1. The database's fields must have the same names as the @dbItem's keys.

2. I don't see the trigger where you capture the item's name or its type.

3. Is there a blank line between the prompt at which you enter the command and the block of text for the identification? If so, then CreateItem is firing off the blank line before the block of text and not the blank line after the block of text. You might want to enable the Identify class off the text "You feel informed:" instead of in the alias.

Troubadour
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jan 23, 2002 7:29 am   
 
The & variable storage in a trigger pattern is rather picky. In this case all your triggers are likely trying to match something like "AC-apply is *.ac" and "AGI By *.agi" to overcome this you must encase the variable you wish to assign to in it one set of braces {}. I would really recommend rewriting your triggers to be similar to:
#TRIGGER {AC-apply is (%d)} {#ADDKEY dbItem ac %1}
Also Troubadour has a bunch of valid point and he knows the DB a lot better then me.
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