|
lblaszczyk Newbie
Joined: 08 Nov 2001 Posts: 7 Location: USA
|
Posted: Tue Nov 13, 2001 12:11 am
Cannot Add Item To Database |
I am having trouble running my database script to read text from an identify. Right now I'm not worried about turning my class on and off because I'm just debugging and testing it. I have an 'Identify' class with all the triggers and variables. The 'Identify_End' Alias will be called from an upper level trigger that matched my prompt(ie. new line and ID should be over). For now I am just calling 'Identify_End' manually.
Here is my problem: The test from the mud is parsed just fine. When I look at the 'NewItem' variable that holds the DB item to be added all the data is correct. But I can't add it to the database! This is my code for adding item 'NewItem' into the database:
#DBLOAD Equipment
#ADDKEY NewItem Affects @Identify_Affects
#show @NewItem // Debug print
#NEW All @NewItem
#DBSAVE Equipment
#DBCLOSE Equipment
#UNVAR NewItem
I know I have to have a database 'Equipment' and all of the fields in 'NewItem'. I believe this to be the prolem. I opened the DB editor and created all of the field necessary with the corresponding "types" for each. Then I saved the DB as 'Equipment.db' (or .dbd). So this should make it possible to load my DB 'Equipment' and add the 'NewItem' yes?
Im confused, please help.
--Thank You
P.S. I am using zMud 6.22 and the new Trigger States. May this be the issue?
Here is an example of identify text from the mud:
You feel informed:
Object 'sword shimmering sworn', Item type: WEAPON
Item is: ANTI-GOOD ANTI-NEUTRAL ANTI-MAGE ANTI-THIEF ANTI-CLERIC ANTI-PALADIN ANTI-ANTI_PAL ANTI-BARBARIAN ANTI-MONK ANTI-RANGER ANTI-BARD TWO-HANDED
Weight: 99, Value: 5000000
Damage Dice is '30D5'
Can affect you as:
Affects : DAMROLL By 8
Affects : DEX By -4
Affects : MAGIC MISSILE By 5
Affects : HITROLL By 13
This is the class code copied from the trigger editor.
#CLASS {Identify}
#ALIAS Identify_End {
#show Item Added!
#DBLOAD Equipment
#ADDKEY NewItem Affects @Identify_Affects
#show @NewItem
#NEW All @NewItem
#DBSAVE Equipment
#DBCLOSE Equipment
#UNVAR NewItem
}
#VAR Identify_AntiAlignments {"ANTI-GOOD"|"ANTI-NEUTRAL"|"ANTI-EVIL"} {ANTI-GOOD|ANTI-NEUTRAL|ANTI-EVIL}
#VAR Identify_AntiClasses {"ANTI-MAGE"|"ANTI-THIEF"|"ANTI-CLERIC"|"ANTI-PALADIN"|"ANTI-ANTI_PAL"|"ANTI-BARBARIAN"|"ANTI-MONK"|"ANTI-RANGER"|"ANTI-BARD"|"ANTI-WARRIOR"} {ANTI-MAGE|ANTI-THIEF|ANTI-CLERIC|ANTI-PALADIN|ANTI-ANTI_PAL|ANTI-BARBARIAN|ANTI-MONK|ANTI-RANGER|ANTI-BARD|ANTI-WARRIOR}
#VAR Identify_AffectsTypes {"AC"|"ARMOR"|"STR"|"DEX"|"CON"|"INT"|"WIS"|"HITROLL"|"DAMROLL"} {AC|ARMOR|STR|DEX|CON|INT|WIS|HITROLL|DAMROLL}
#VAR Identify_Affects {"MAGIC MISSILE By 5"} {}
#VAR tempalign {"ANTI-GOOD"|"ANTI-NEUTRAL"}
#VAR tempclass {"ANTI-MAGE"|"ANTI-THIEF"|"ANTI-CLERIC"|"ANTI-PALADIN"|"ANTI-ANTI_PAL"|"ANTI-BARBARIAN"|"ANTI-MONK"|"ANTI-RANGER"|"ANTI-BARD"}
#TRIGGER {Object '(*)', Item type: (%w)} {
#VAR NewItem %null
#ADDKEY NewItem Name {%1}
#ADDKEY NewItem ItemType %2
#var Identify_Affects {}
#TEMP {$} {
#DBLOAD Equipment
#NEW All @NewItem
#UNVAR NewItem
#DBSAVE Equipment
}
}
#COND {Item is: (*)} {
#VAR tempalign %null _nodef Identify
#VAR tempclass %null _nodef Identify
#LOOP %numwords( %1) {
#IF %ismember( %word( {%1}, %i), @Identify_AntiAlignments) {#ADDITEM tempalign %word( {%1}, %i)} {
#IF %ismember( %word( {%1}, %i), @Identify_AntiClasses) {#ADDITEM tempclass %word( {%1}, %i)} {
#ADDKEY NewItem Attributes %word( {%1}, %i)
}
}
}
#ADDKEY NewItem AntiAlignment @tempalign
#ADDKEY NewItem AntiClass @tempclass
} {"within"|"param=1"}
#COND {Weight: (%d), Value: (%d)} {
#ADDKEY NewItem Weight %1
#ADDKEY NewItem Value %2
} {"within"|"param=1"}
#COND {Damage Dice is '(%w)'} {#ADDKEY NewItem DamageDice %1} {"within"|"param=1"}
#TRIGGER {Affects : (*) By (%n)} {#if (%ismember( %1, @Identify_AffectsTypes)) {#ADDKEY NewItem {%1} {%2}} {
#ADDITEM Identify_Affects %concat( %1, " By ", %2)
}}
#CLASS 0 |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Tue Nov 13, 2001 7:08 am |
Be sure to have your database actually open (manually). Just #DBLOAD to do it in the background doesn't work.
Acaila |
|
|
|
lblaszczyk Newbie
Joined: 08 Nov 2001 Posts: 7 Location: USA
|
Posted: Wed Nov 14, 2001 12:35 am |
Okay I feel silly now... but at least that made it work :).
Thanks |
|
|
|
|
|
|
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
|
|