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
Mr.Nobody
Newbie


Joined: 11 Jan 2012
Posts: 8

PostPosted: Sat Feb 04, 2012 9:52 pm   

need help adding output to the database please
 
Now I'm working on adding things to the database. I've never once used the database before, and so far I've worked out adding things manually. Now, in the documentation it gives an example of how to add things to the db with triggers when items are identified and such, but my mud's output is (as always) a little different than the examples given, and after messing with it for a couple hours i had to come back and ask for help again.

All I want is the output from using a 'scroll of legend lore' to be sorted and saved into the database for me.

My output:

for a weapon with some bonuses - "the axe of throwing"

You recite a scroll of legend lore which dissolves.
You feel informed:
Object 'axe throwing battle'
Item Type: WEAPON
Mat Class: metal Material: steel
Weight : 28 Value : 800

Affects : HITROLL by 2
Affects : DAMROLL by 2
Item is : HUM
Class : battle_axe
Damage : 5D5
An image of the axe spinning in the air comes to your mind. Suddenly, the
axe jarringly strikes a wooden wall, the head of the axe stuck deeply into
the woodwork. <--the field in the db for this, on any weapon, with any message, could be called "Spec" for my purposes and would just be 'Spec: Damage' or something similar. not against having to add this manually since it would be either non-existent or totally different for each weapon with a special attack.

and an example of a piece of worn equipment with bonuses - “a dark onyx ring”

You recite a scroll of legend lore which dissolves.
You feel informed:
Object 'ring onyx dark'
Item Type: WORN
Mat Class: natural Material: stone
Weight : 2 Value : 200

Affects : SAVING_PARA by -1
Affects : casting level by 1
Effects : DETECT_MAGIC
Item is : MAGIC

The Mat Class/Material fields are not important to me whatsoever so those can be left out i suppose, but the rest matter. Just not sure how to go about this. Would love for the string "You feel informed:" to tell zmud when to start looking for stuff to add. No idea what's going on.

The closest thing I've found in the forums to what I'm trying to do is this:

Quote:
Code:

#DBLOAD Equipment
#ADDKEY NewItem Affects @Identify_Affects
#show @NewItem // Debug print
#NEW All @NewItem
#DBSAVE Equipment
#DBCLOSE Equipment
#UNVAR NewItem


followed by an example from his mud:

Quote:

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


followed again by this info from, i'm guessing, the above object in his db:

Quote:

Code:

#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


I don't really know what any of this means, but it'll give someone trying to help me less typing to do hopefully. I hate being new at this :) The above quote combined with my output should give someone that DOES know what the heck they're doing a little more to work with, but not real sure. Please help. Thanks.
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